Delta Solivia

1,090 views
Skip to first unread message

Ben Price

unread,
Oct 18, 2013, 3:21:49 AM10/18/13
to webso...@googlegroups.com
Hi All,

I have just got my Delta Solivia 3.3 working with WebSolarLog, just drop the DeltaSolivia.php and DeltaSoliviaPy folder into classes and it should work.

NOTE:

I have an Aurora and Delta inverter so I have had to hard code $this->PORT = '/dev/ttyUSB1';


DeltaSolivia.zip
Message has been deleted

Ben Price

unread,
Oct 18, 2013, 3:28:58 AM10/18/13
to webso...@googlegroups.com

Marco

unread,
Oct 18, 2013, 4:05:02 AM10/18/13
to webso...@googlegroups.com
Hi Ben,

This looks great and thanx for sharing this with us and the demo looks good!

Did you write the python scripts you're self?

regards,
Marco

Ben Price

unread,
Oct 18, 2013, 4:52:24 AM10/18/13
to webso...@googlegroups.com
No I can't take credit for the initial python code it was made by stik79 ( https://github.com/stik79/DeltaPVOutput)

all I did was adapt if to your generic "driver" class system then added a few missing Delta solivia calls from kommandos.xls  found at https://code.google.com/p/pvbeancounter/issues/detail?id=251#c16 

I am still having problems getting WebSolarLog  stable-release-1.0.0 to work with both an Aurora inverter on /dev/ttyUSB0 and the Delta inverter on /dev/ttyUSB1

Ben Price

unread,
Nov 5, 2013, 2:08:43 AM11/5/13
to webso...@googlegroups.com
Can the following be added to trunk so updates do not mean manual changes. I have been using the communication classes in trunk so I can use both /dev/ttyUSB0 and /dev/ttyUSB1 for different inverters. This was done by modifying ./classes/objects/Device.php:69. Delta inverters do not have a history function so I have had to return null.

./classes/services/DeviceService.php:92
                               
       array('value'=>'DeltaSolivia','type'=>'production','name'=>'DeltaSolivia'),
                               
       
       
       
./classes/objects/Device.php:69:
       
       $communicationService = new CommunicationService();
       $communication = $communicationService->load($this->communicationId);
       
        if ($this->deviceApi == "DeltaSolivia") {
            new DeltaSolivia($config->aurorapath, $this->comAddress, $config->comDebug);
            $api->setCommunication($communication, $this);
            return $api;
        }

./js/templates/misc.hb:35:   

        {{#if_eq this.deviceApi compare="DeltaSolivia"}}
        This device is using Python.<br>
        The software can be installed using<br>
        apt-get install python
        {{/if_eq}}
       
./classes/devices/

Delta Trunk 20131105.zip needs to be extracted into ./classes/devices/
Delta Trunk 20131105.zip

Sander van Leeuwen

unread,
Nov 12, 2013, 5:23:11 AM11/12/13
to webso...@googlegroups.com
Thanks for the directions Ben!

I try to make it work with your zip file and doing the modifications by hand (on the latest trunk version of wsl).
I successfully added my inverter, but logging doesn't work yet. I had to modify this part:


./classes/objects/Device.php:
69:
       
       $communicationService
= new CommunicationService();
       $communication
= $communicationService->load($this->communicationId);
       
       
if ($this->deviceApi == "DeltaSolivia") {
           
new DeltaSolivia($config->aurorapath, $this->comAddress, $config->comDebug);
            $api
->setCommunication($communication, $this);
           
return $api;
       
}



to:

./classes/objects/Device.php:
69:

       
       
if ($this->deviceApi == "DeltaSolivia") {

           
return new DeltaSolivia($config->aurorapath, $this->comAddress, $config->comDebug);
       
}


To make it conform the other devices.
Maybe that is the reason why it won't work?

By the way how /where do we have to configure the rs485 devices address? "/dev/ttyUSB0"
I put that in the "(RS485/IP) address:" configuration field now. In the "communication" combobox above that field I can't select anything since there are no options. I am not sure if that's correct?

Thanks!

Marco

unread,
Nov 12, 2013, 6:02:34 AM11/12/13
to webso...@googlegroups.com
Hi Ben and Sander,

Thanks for your input!

A few days ago i sent Ben and email about his input, but until now i got no response.
The code for WSL looks good.
However, I have some concerns about the modified version of the script DeltaSolivia.py.
We could not add this script to the codebase of WSL. This because when we add it, people could expect support from us.

A few month ago i also sent the developer of DeltaSolivia.py an email to ask him if he could make some changes in the favour of WSL.
Unfortunately I have not received a response from him.

If you ask me, we need to ask the developer of DeltaSolivia.py if he could make changes to the script.

Regards,
Marco

Ben Price

unread,
Nov 12, 2013, 6:48:02 AM11/12/13
to webso...@googlegroups.com
Sorry for not replying. 

I use this:

$communicationService = new CommunicationService();
$communication 
= $communicationService->load($this->communicationId);

so I can use the WSL::configuration::communication manager instead of settings in WSL::configuration::advanced but you can put /dev/ttyUSB0 in Aurora PowerOne(RS485): field in advanced settings to set the communication port.

I need to use the communication manager because this allows me to set 2 different communication devices /dev/ttyUSB0 and /dev/ttyUSB1

I am happy that code be added without python code which can be added post install (dropping a folder into devices). If WebSolarLog can be updated without deleting any additional folders in the device directory then this could be a great solution.

I feel I am between a rock and a hard place here I understand and can support DeltaSolivia.py code but it was not originally developed by me, and I have been unable to get in contact with original developer. I can even write a help doc explaining how it works and were Delta command codes come from including lists of others that are currently not used.

I am also happy to re-write DeltaSolivia.py to better suit WSL if given a basic class structure, but I think it would need to stay in python.

Martin Diphoorn

unread,
Nov 12, 2013, 7:01:13 AM11/12/13
to webso...@googlegroups.com
Great to hear that the communication manager is working for you. Keep in mind that this is the way i want to have it work on alle devices, but it is not yet the case. So you are actually a head of my code, Now i know that it is working good for you. I hopefully will find some time to convert the other devices also to the communication manager.

Thanks for testing it already :D

About the python script, it all depends the license model. If the license allow you to fork it then you can. Probably you should then open a github or sourceforge like place to keep your code and develop it further. You first need to check if you are allowed to do that. If you can't do that, then you can always make your own script as long it aint a copy.

WSL is written to support multiple output of scripts. By using a converter it will be converterd to data we understand, but you probably already saw that.

Sander van Leeuwen

unread,
Nov 12, 2013, 8:13:47 AM11/12/13
to webso...@googlegroups.com
The author of the script allows for forking / modifying the code as long as "we" don't change the license.
@Ben: it would be best to have one piece of code that will work either for the pvoutput script and for WSL. I can help if you need help

Marco

unread,
Nov 12, 2013, 8:31:08 AM11/12/13
to webso...@googlegroups.com
An fork of the project with support for WSL sounds great!

Regarding multi-inverter on multi port;
Admin::Devices::Device::RS485/IP field could be "used" for this.
For example;
add /dev/ttyUSB1 to this field

This value can be found in for example;
/classes/devices/deltaSolivia.php
    function __construct($path, $address, $debug) {
        $this->ADR = $address;  //will contain "/dev/ttyUSB1"
        $this->DEBUG = $debug;
        $this->PATH = $path;
    }
    
Next you could use this value in Device->execute() so this device call uses the given USB port.
This is option could be used for as long the communication manager is not yet fully functional.

If the comm. man. is ready, we do not have this issue anymore. Then is possible to "connect" a device directly to a USB port.

Ben Price

unread,
Nov 13, 2013, 5:43:36 AM11/13/13
to webso...@googlegroups.com
I will make a fork of https://github.com/stik79/DeltaPVOutput this weekend and make it work for WSL and pvoutput

To keep the same DeltaPVOutput functionality if no arguments are given then script will upload to PVOutput but if WSL sends it arguments returns will what WSL requires.


Marco

unread,
Nov 13, 2013, 9:10:57 AM11/13/13
to webso...@googlegroups.com
That's great!

Please keep us informed so we could help with testing and/or coding.

Sander van Leeuwen

unread,
Nov 14, 2013, 2:56:41 AM11/14/13
to webso...@googlegroups.com
That sounds like a good idea. By the way I modded the pvoutput script so it can extract more information. That information is then send to pvoutput using the extended data fields. I also added a hardware temperature sensor to the rpi.
Feel free to use some of my code:

http://www.savale.nl/files/deltaPvoutput.zip

p.he...@gmail.com

unread,
Jan 11, 2014, 3:57:38 AM1/11/14
to webso...@googlegroups.com
Hello Ben. Good to read that you are busy with the Delta inverter. I have that Solivia 3.0 inverter from may last year and i aim trying to monitot to pvoutput.org with the raspberry Pi. I tried the program from stik79 but then i get an error from PVOutput.org (bad request 400: Missing energy and power Value). I aim not aible to fix that so no i try to do it with Websolarlog. I used the Installation manual for Websolarlog but don't know what to do now. I have the following questions: Where can i after i logged in choose my Solivia, where can i put mu ttyUSB0, do i also have to copy the deltasolivia and the deltasolivia trunk file to the raspberry. Do i have to to something extra for outputting data the pvoutput.org? I aim not an ict engeneer, Dutch and 70 years old so in fact that's a double handicap! I hope that you can help me further with this matery. On the other side, if there is anything i can do for you in the way of testing something let me know because i have plenty of time.

Regards Piet Herrema

Ben Price

unread,
Jan 13, 2014, 7:04:29 PM1/13/14
to webso...@googlegroups.com
Hi P Herrema,

I have made a project at:

https://github.com/bprice/DeltaPVOutput

This is still a work in progress as I have it working with PVOutput but have not fixed the bug for getting it working with WebSolarlog just yet. I hope to have this complete before the end of the month.

In its current form you should be able to use it to upload info to PVOutput.

Please give it as shot as per the instructions to make sure instructions work.

I hope you can wait for the websolar log release as this gives much better information that PVOutput.

P Herrema

unread,
Jan 14, 2014, 7:30:47 AM1/14/14
to webso...@googlegroups.com
Hi Ben, 

Thank you for your reaction ans i'll give it a try. I aim not at home for the coming 5 weeks but i'll be back.

P Herrema

unread,
Jan 14, 2014, 9:25:21 AM1/14/14
to webso...@googlegroups.com
Hi Ben,

I tried the program but i get an error: bad request 400: Missing energy and power value No response from inverter - shutdown?
With the program from stik79 a have connection with the inverter but i get the same error.

Ben Price

unread,
Jan 14, 2014, 10:46:12 PM1/14/14
to webso...@googlegroups.com
If you put:

print cmd after line 252 eg:
 
           #Send it all off to PVOutput.org
            cmd = ['/usr/bin/curl',
                '-d', t_date,
                '-d', t_time,
                '-d', t_energy,
                '-d', t_power,
                '-d', t_volts,
                '-d', t_temp,
                '-d', t_volts1,
                '-d', t_dcPavg,
                '-d', t_acPavg,
                '-d', t_dcPmax,
                '-d', t_acPmax,
                '-H', 'X-Pvoutput-Apikey: ' + APIKey,
                '-H', 'X-Pvoutput-SystemId: ' + str(SystemID),
                'http://pvoutput.org/service/r1/addstatus.jsp']
            print cmd
            ret = subprocess.call (cmd)

when you run the script it should display all the readings obtained from your inverter. If you paste the result here I will see if your inverter is just missing one value or if you are missing all the values. 

I have just finished getting my Delta working again with websolar log, but this will not work for you until pvoutput script works correctly. 

kommandos.xls shows the delta commands required to interrogate the inverter. 

https://github.com/rsltrifork/DeltaPVOutput has made a fork specificly to suit Delta SOLIVIA 3.0 EU G4 TR  (delta30EUG4TRInv.py) if this is what you have. 
 


P Herrema

unread,
Jan 15, 2014, 4:05:17 AM1/15/14
to webso...@googlegroups.com
I put the print cmd in started with python DeltaPVOutput.py and got File"DeltaPVOutput.py", line 253  print cmd. Attached the outcom from the Protocol test. I aim sorry that i have to leave now because i have to go to the airport. My wife is getting nervous already. Ik hope to test things again after 20 february. Thank you so far. The protocol for the Delta 3.0 from stik79 is very different then mine. I think i have the same protocol as in your program.
Delta Solivia Protocol test.doc

Ben Price

unread,
Jan 15, 2014, 5:44:42 PM1/15/14
to webso...@googlegroups.com
Well the prototcol test seemed to work correctly, you are getting data from the inverter, so that rules out a port problem. The protocol test also seems to show data in the right fields.

print cmd should have returned something like this

['/usr/bin/curl', '-d', 'd=20140116', '-d', 't=09:05', '-d', 'v1=441', '-d', 'v2=850', '-d', 'v6=236', '-d', 'v5=42', '-d', 'v7=274', '-d', 'v8=864', '-d', 'v9=830', '-d', 'v10=3654', '-d', 'v11=850', '-H', 'X-Pvoutput-Apikey: 0000000000000000000000000000000000000000 
', '-H', 'X-Pvoutput-SystemId: 00000', 'http://pvoutput.org/service/r1/addstatus.jsp']

And V5 is correct it is 42C here in Adelaide Australia and its only 9.05AM 

Are you sure you have put:

[Inverter1]
SystemID: 00000
APIKey: 0000000000000000000000000000000000000000
Port: /dev/ttyUSB0
PortSpeed: 19200
InvNo: 1

in the config.ini file with your system ID and APIKey.

You may also want to check the setup inside your inverter to see that InvNo is set to 1 and PortSpeed is set to 19200 

if it is not then you might want to update your configuration file. 



P Herrema

unread,
Jan 16, 2014, 8:50:48 AM1/16/14
to webso...@googlegroups.com
Hi Ben,
It is not possible yet to test anything because i aim on Gran Canaria now for a 5 weeks holiday. But i got the info out of the inverter when i was connected by an virt. com port. Normaly i aim connected by a RS485 to usb converter. 
The config.ini is correct and i checked it before. I run things like python DeltaPVOutput.org and that's the right way to do it?


P Herrema

unread,
Jan 16, 2014, 11:48:08 AM1/16/14
to webso...@googlegroups.com
Hi Ben,

I have been thinking that there could be something wrong with the USB input on the raspberry. Is there a way to test that? Because i used Windows 8 and the Delta protocoltester in combination with a virtual serial port connected to my inverter. Is it possible to create a com port on the raspberry so i can connect that port from the raspberry to my inverter? May be there is an easyer way to do it?
I aim on holiday but still busy with it.... and my wife does not like it.

Willem Stolk

unread,
Jan 16, 2014, 2:26:18 PM1/16/14
to webso...@googlegroups.com
p. Herrema,

take a look at the script (click "download hier") from http://www.frankgroot.nl/index.php/raspberry-pi/koppeling-soladin600. There is method of connect a com port to the usb. Don't know if this is what you are searching for?


P Herrema

unread,
Jan 16, 2014, 4:14:21 PM1/16/14
to webso...@googlegroups.com
I don't think so. I already have an rs485 to ftp converter and i have to connect it with the RJ45 connector on the router. So i think that if i make a virtual com port may be i can pick it up on the raspberry. But i hope that i can get everything working with the usb connection on the raspberry.

Ben Price

unread,
Jan 16, 2014, 10:50:01 PM1/16/14
to webso...@googlegroups.com
I have a USB-To-RS485-TTL-Interface-Board that plugs into the raspberry pi usb which then allows me to query inverter on /dev/ttyUSB0 in the linux distribution on the raspberry pi

I don't think this script will work any other way. Connection between the interface board and the RJ45 plug on delta inverter used these pins:



Ben Price

unread,
Jan 16, 2014, 10:57:48 PM1/16/14
to webso...@googlegroups.com
I did have a problem with the USB interface not always working because my USB hub back feeds. Instead of plugging in the power on the raspberry pi, I use the backfeed from the usb hub to power the pi from the output usb's I believe this is dangerous to the pi because there is no power protection for the pi but when you can buy a pi for such a low cost my thoughts were I can buy another.

P Herrema

unread,
Jan 17, 2014, 12:39:52 PM1/17/14
to webso...@googlegroups.com
The USB to RS485 interface i have lookes the same as the one on your photo. I bought it from China. What do you advice me to do now when i aim back home. If it is possible to connect the raspberry with my RS485 to FTP interface i can try that before i buy another USB to RS485 interface. Is there anything i can adjust for the USB to RS485 interface i use now? And do you know how to create a com port on the raspberry? 

Ben Price

unread,
Jan 17, 2014, 7:52:54 PM1/17/14
to webso...@googlegroups.com

1) You do not know if your rasperry pi can communicate with your delta inverter. 


If you put:

print cmd after line 252 eg:
 
           #Send it all off to PVOutput.org
            cmd = ['/usr/bin/curl',
                '-d', t_date,
                '-d', t_time,
                '-d', t_energy,
                '-d', t_power,
                '-d', t_volts,
                '-d', t_temp,
                '-d', t_volts1,
                '-d', t_dcPavg,
                '-d', t_acPavg,
                '-d', t_dcPmax,
                '-d', t_acPmax,
                '-H', 'X-Pvoutput-Apikey: ' + APIKey,
                '-H', 'X-Pvoutput-SystemId: ' + str(SystemID),
                'http://pvoutput.org/service/r1/addstatus.jsp']
            print cmd
            ret = subprocess.call (cmd)

Then run the command python DeltaPVOutput.py you should get something like:

['/usr/bin/curl', '-d', 'd=20140116', '-d', 't=09:05', '-d', 'v1=441', '-d', 'v2=850', '-d', 'v6=236', '-d', 'v5=42', '-d', 'v7=274', '-d', 'v8=864', '-d', 'v9=830', '-d', 'v10=3654', '-d', 'v11=850', '-H', 'X-Pvoutput-Apikey: 0000000000000000000000000000000000000000 
', '-H', 'X-Pvoutput-SystemId: 00000', 'http://pvoutput.org/service/r1/addstatus.jsp']

  if there is an error before this put the output in this thread so it can be traced back to where error occurred.

This will show if you can communicate between the pi and inverter.

2) Check out if you are backfeeding your pi, remove power input from pi and see if it starts with the power from your USB powered hub. If you are not using a powered hub it might be an idea to use one as the pi has very limited output power to feed devices. If you are backfeeding your pi you need to get another usb hub that does not backfeed or run the pi using the backfeed only. my RS485 ports did not always work until i removed 1 power source.  

I do not know how to create a com port on the pi.


P Herrema

unread,
Jan 18, 2014, 11:29:59 AM1/18/14
to webso...@googlegroups.com
Thank you so far Ben. When i aim back home i'll try the tips you gave me. I'll back at the end of february i hope.

stik79

unread,
Jan 20, 2014, 7:47:21 AM1/20/14
to webso...@googlegroups.com
Hi All, author of the original python script here :) 

Just thought I'd pop in and say I've updated the code base and added the MIT licence to clear up any issues with the WSL fork. This licence is basically a free for all. Go nuts! :)

I apologise if I missed some attempts to be contacted but had a new baby around the time it looks like people were trying to get to me and so I may have let some emails/PM's fall through the cracks.

I suspect the WSL capabilities are best suited to their own fork as I don't have the time to maintain more code at the moment.

Looks like so nice changes have been made to my original quick knock up script :)

Ben Price

unread,
Jan 27, 2014, 7:46:15 PM1/27/14
to webso...@googlegroups.com
Can the following now be added to current trunk:
 
http://tracker.websolarlog.com/view.php?id=164

I have been running this now for about a month and now the communication manager is complete it integrates really nicely.

I have tested on:

Delta Solivia 2.5
Delta Solivia 3.3
Delta Solivia 5.0

Update should direct any users to download https://github.com/bprice/DeltaPVOutput project into the devices directory in WSL. 

Tim

unread,
Jan 31, 2014, 5:48:27 AM1/31/14
to webso...@googlegroups.com
Hello Ben

Nice work.
I want to ask you, how do I need to config my Solivia 2.5.
I added a communicationin the communication manager but I dont understand what I need to put in the uri field.
I think the communication pot should be the port on which the rs485 convertor is on or am I wrong.

On the command prompt I get info from my convertor with the python script but I don't see any data in websolarlog.

Could you provide me screen shots for the communication an device configuration in websolarlog.  

Thanks

Ben Price

unread,
Jan 31, 2014, 8:33:15 PM1/31/14
to webso...@googlegroups.com

Since the begging of this post the code has change  as I moved from the stable release to the trunk release for additional class structures developed for WSL

Here are the current instruction on getting WSL working with a Delta inverter.

1)          1)  Upgrade WSL to the latest trunk

2)          2)  Add the code in notes  section of http://tracker.websolarlog.com/view.php?id=164

·         ./classes/services/DeviceService.php:101

·         ./classes/objects/Device.php:68

·         ./js/templates/misc.hb:35

3)    Download http://tracker.websolarlog.com/file_download.php?file_id=27&type=bug and put:

·         DeltaSolivia.php in ./classes/devices

·         DeltaSoliviaConverter.php in ./classes/converters

4)    Download https://github.com/bprice/DeltaPVOutput into ./classes/devices/DeltaSoliviaPy Eg:

·         Cd ./classes/devices

·          git clone https://github.com/bprice/DeltaPVOutput.git DeltaSoliviaPy

5)    Add a communication record to WSL::Configuration::Communication

·         Add a name

·         Add the connection port your Pi uses to talk to your inverter (default should be /dev/ttyUSB0)

6)    Add a device record to WSL::Configuration::Devices

·         Device Api should be DeltaSolivia

·         communication: should be the communication record name you set up in step 5

·         (RS485/IP) address should be the delta id of the inverter (default is 1 in setup menu on Delta Solivia inverter)


Hopefully in the near future all the php (http://tracker.websolarlog.com/view.php?id=164) will be included in the trunk and all that will be required is to download the python code and add the 2 setup records.

Hope this helps.

Reply all
Reply to author
Forward
Message has been deleted
0 new messages