Page 1 of 1

Python Plugin: SolarEdge Public

Posted: Saturday 02 December 2017 15:59
by Noudje
I wrote a plugin to get data from a SolarEdge Public Dashboard. Unfortunately I was not able to get the current power, but only the produced power during the last 15 minutes. In the plugin the device is created with:

Code: Select all

Domoticz.Device(Name="Power", Unit=1, TypeName="kWh").Create()
The device is updated with the standard procedure:

Code: Select all

Devices[Unit].Update(nValue=nValue, sValue=str(sValue))
In Domoticz I get the device as:
haarlemnoorderlicht.PNG
haarlemnoorderlicht.PNG (10.22 KiB) Viewed 969 times
I have 2 question:

1. I expected to get the nValue (=15) in to top right corner. Now nValue and sValue (='Produced...Watt') are both shown as text.
How do I get nValue in the top right corner?

2. If I click on the Edit button, change Type from Usage to Return and click on Update, the change is not updated, so also the icon will not change.
How can I enable the possibility to change the Usage or how can I change the icon as shown in:
winddelen.PNG
winddelen.PNG (11.63 KiB) Viewed 969 times

Re: Python Plugin: SolarEdge Public

Posted: Sunday 10 December 2017 8:54
by Dnpwwo
@Noudje,

Domoticz devices can be hard to work out :cry:

For my power measuring plugin i used

Code: Select all

Domoticz.Device(Name="Usage", Unit=1, Type=243, Subtype=29, Switchtype=0, Image=0, Options="").Create()
Domoticz.Device("Total", 2, 113).Create()
and got
Untitled.png
Untitled.png (95.56 KiB) Viewed 911 times
not sure if that helps

Re: Python Plugin: SolarEdge Public

Posted: Monday 11 December 2017 18:34
by AndreFR
@Noudje,
Do you need another ‘tester’ of de plug-in? ;) Do you use The API or do you use the info which is sent to The SolarEdge portal?

Re: Python Plugin: SolarEdge Public

Posted: Monday 11 December 2017 23:39
by Noudje
Thanks for the help. It is very complex to get data from a public SolarEdge device. I stopped this project and I am thinking of a crontab job to retrieve the daily report by executing:

url = "https://monitoringpublic.solaredge.com/ ... /p/charts/" + fieldID + "/chartExport?st=" + str(st) + "&et=" + str(et) + "&fid=" + fieldID + "&timeUnit=2&pn0=Power&id0=0&t0=0&hasMeters=false"

where:

fieldID = unique id of the SolarEdge device
st = (datetime.date(date.year, date.month, date.day) - since1970).days * 86400000

This will give a CSV file with the produced power every 15 minutes.

I got too many problems to write a plugin by specifying devices, https calls, etc.