Page 1 of 4

SolarEdge individual optimizer dzVents script

Posted: Monday 18 May 2020 12:55
by Dols
Another way to request data from the SolarEdge inverter.

Why:
- This also requests the individual optimizers data

it is an pure dzVents script that polls layout data from the website. It does not use the official API calls. Instead the API key, it uses the username, password and siteid to get the data. It's the result of one evening hobby. It works, no fancy stuff.

https://github.com/RDols/dzRequestSolarInfo

Regards,
Richard

Re: SolarEdge individual optimizer dzVents script

Posted: Tuesday 19 May 2020 17:19
by snellejellep
great project!

Re: SolarEdge individual optimizer dzVents script

Posted: Tuesday 19 May 2020 17:36
by McMelloW
Hello Richard,

What is the request you sending to the SolarEdge site?
The site is only updated every 15 minutes

Re: SolarEdge individual optimizer dzVents script

Posted: Tuesday 19 May 2020 23:27
by Dols
It does an http get on:

https://monitoring.solaredge.com/solare ... ut/logical

XXXXXXX = Your siteId
It uses basic HTTP authentication. To test, you can login to your regular monitoring page, do a request to above URL (replace XXXXXXX with your siteid) and get JSON info.

It updates more often then 15 minutes, but it's dependend on how often the inverter (and optimizers) update there data. for the optimizers its close to every 5 minutes.

Re: SolarEdge individual optimizer dzVents script

Posted: Wednesday 20 May 2020 12:06
by McMelloW
Dols wrote: Tuesday 19 May 2020 23:27 It does an http get on:

https://monitoring.solaredge.com/solare ... ut/logical

XXXXXXX = Your siteId
It uses basic HTTP authentication. To test, you can login to your regular monitoring page, do a request to above URL (replace XXXXXXX with your siteid) and get JSON info.

It updates more often then 15 minutes, but it's dependend on how often the inverter (and optimizers) update there data. for the optimizers its close to every 5 minutes.
Richard, thanks very much.

A 5 minutes interval is not bad. The monitor page is updated every 15 minutes.
This generates a lot of data. I will look into this.

Re: SolarEdge individual optimizer dzVents script

Posted: Wednesday 20 May 2020 19:36
by freijn
Hi Richard

Well done. Will give it a go this long weekend.
Question How do you display the data ?
I was thinking Grafana?

Re: SolarEdge individual optimizer dzVents script

Posted: Wednesday 20 May 2020 19:51
by Bikey
That would be nice. Although then it would be more logical to perhaps skip the use of Domoticz altogether and directly post it to a database like Influx (or to MQTT and then to Influx).

Re: SolarEdge individual optimizer dzVents script

Posted: Wednesday 20 May 2020 21:01
by Eddiever
Maybe I am just a bit stupid. But if I use your script I get:

Solaredge_optimizers.lua:86: attempt to call field 'toBase64' (a nil value)

I triple checked my account data in line 81 - 83. They are correct. What am I overlooking? Manually trying the http get works and I see a lot of data.

Code: Select all

80 local function RequestSolardEdge(domoticz)
81    local username = "my username"
82    local password = "my password"
83    local siteID = "my siteID"
84    
85    local authorization = string.format("%s:%s", username, password)
86    authorization = string.format("Basic %s", domoticz.utils.toBase64(authorization))

Re: SolarEdge individual optimizer dzVents script

Posted: Wednesday 20 May 2020 21:22
by waaren
Eddiever wrote: Wednesday 20 May 2020 21:01 Maybe I am just a bit stupid. But if I use your script I get:
Solaredge_optimizers.lua:86: attempt to call field 'toBase64' (a nil value)
I implemented the toBase64 function in dzVents 2.5.2 (domoticz V4.11543). If you are on an older version this script will not work.

Re: SolarEdge individual optimizer dzVents script

Posted: Wednesday 20 May 2020 21:45
by Eddiever
Thanks, I do have a older version on my Synology. Going to upgrade right away. Due to the lack of sun I don't suppose it wil work right away

Re: SolarEdge individual optimizer dzVents script

Posted: Wednesday 20 May 2020 22:02
by Eddiever
That did it! It works:

Code: Select all

2020-05-20 22:01:01.843 Status: dzVents: dzRequestSolarInfo : Inverter Inverter 1 = 13508.00 Wh
2020-05-20 22:01:01.843 Status: dzVents: dzRequestSolarInfo : Optimizer Panel 1.1.1 = 916.00 Wh
2020-05-20 22:01:01.843 Status: dzVents: dzRequestSolarInfo : Optimizer Panel 1.1.2 = 983.00 Wh
2020-05-20 22:01:01.843 Status: dzVents: dzRequestSolarInfo : Optimizer Panel 1.1.3 = 968.00 Wh
2020-05-20 22:01:01.843 Status: dzVents: dzRequestSolarInfo : Optimizer Panel 1.1.4 = 1000.50 Wh
2020-05-20 22:01:01.843 Status: dzVents: dzRequestSolarInfo : Optimizer Panel 1.1.5 = 1007.75 Wh
2020-05-20 22:01:01.843 Status: dzVents: dzRequestSolarInfo : Optimizer Panel 1.1.6 = 1009.75 Wh
2020-05-20 22:01:01.843 Status: dzVents: dzRequestSolarInfo : Optimizer Panel 1.1.7 = 1018.00 Wh
2020-05-20 22:01:01.843 Status: dzVents: dzRequestSolarInfo : Optimizer Panel 1.1.8 = 959.75 Wh
2020-05-20 22:01:01.843 Status: dzVents: dzRequestSolarInfo : Optimizer Panel 1.1.9 = 880.75 Wh
2020-05-20 22:01:01.843 Status: dzVents: dzRequestSolarInfo : Optimizer Panel 1.1.10 = 1002.75 Wh
2020-05-20 22:01:01.843 Status: dzVents: dzRequestSolarInfo : Optimizer Panel 1.1.11 = 1007.00 Wh
2020-05-20 22:01:01.843 Status: dzVents: dzRequestSolarInfo : Optimizer Panel 1.1.12 = 1011.00 Wh
2020-05-20 22:01:01.843 Status: dzVents: dzRequestSolarInfo : Optimizer Panel 1.1.13 = 987.75 Wh
2020-05-20 22:01:01.843 Status: dzVents: dzRequestSolarInfo : Optimizer Panel 1.1.14 = 1000.25 Wh

Re: SolarEdge individual optimizer dzVents script

Posted: Wednesday 20 May 2020 22:29
by McMelloW
Dols wrote: Monday 18 May 2020 12:55 Another way to request data from the SolarEdge inverter.

Why:
- This also requests the individual optimizers data

it is an pure dzVents script that polls layout data from the website. It does not use the official API calls. Instead the API key, it uses the username, password and siteid to get the data. It's the result of one evening hobby. It works, no fancy stuff.

https://github.com/RDols/dzRequestSolarInfo

Regards,
Richard
I find it still a bit frustrating to get all these data from the SolarEdge website, while it is all present in your SolarEdge Inverter.
Your inverter is sending it to the SolarEdge website and the dzVents Script is getting back from the SolarEdge website to you home.

Re: SolarEdge individual optimizer dzVents script

Posted: Wednesday 20 May 2020 22:31
by McMelloW
Bikey wrote: Wednesday 20 May 2020 19:51 That would be nice. Although then it would be more logical to perhaps skip the use of Domoticz altogether and directly post it to a database like Influx (or to MQTT and then to Influx).
With the use of dzVent, you need Domoticz. dzvents is a part of Domoticz

Re: SolarEdge individual optimizer dzVents script

Posted: Thursday 21 May 2020 8:40
by Alain
This looks interesting. We have two inverters here. Will give it a try next week.

Re: SolarEdge individual optimizer dzVents script

Posted: Thursday 21 May 2020 9:52
by Rene001
Interesting. Going to check it out this weekend.

Re: SolarEdge individual optimizer dzVents script

Posted: Thursday 21 May 2020 11:17
by Rene001
To find out the name of the panels took some time.
The name of the optimizer in my case is "Panel 1.1.1"

as the site of my inverter
"name":"Module 1.1.1","displayName":"1.1.1"
Spoiler: show
020-05-21 11:09:02.189 Status: dzVents: Info: ------ Start internal script: SolarEdge Optimizers: HTTPResponse: "SolarEdgeWebRespondse"
2020-05-21 11:09:02.223 Status: dzVents: dzRequestSolarInfo : Inverter Inverter 1 = 7166.00 Wh
2020-05-21 11:09:02.225 Status: dzVents: dzRequestSolarInfo : String String 1.1 = 7235.50 Wh
2020-05-21 11:09:02.226 Status: dzVents: dzRequestSolarInfo : Optimizer Panel 1.1.1 = 637.75 Wh
2020-05-21 11:09:02.227 Status: dzVents: dzRequestSolarInfo : Optimizer Panel 1.1.2 = 629.75 Wh
2020-05-21 11:09:02.228 Status: dzVents: dzRequestSolarInfo : Optimizer Panel 1.1.3 = 555.00 Wh
2020-05-21 11:09:02.228 Status: dzVents: dzRequestSolarInfo : Optimizer Panel 1.1.4 = 639.50 Wh

Re: SolarEdge individual optimizer dzVents script

Posted: Thursday 21 May 2020 21:20
by McMelloW
Hello Richard,

This works great, well done.

Here is my log output.

Code: Select all

2020-05-21 21:05:01.224 Status: dzVents: dzRequestSolarInfo : -=[ Start HTTP Request]=======================================
2020-05-21 21:05:01.225 Status: dzVents: dzRequestSolarInfo : -=[ End ]=====================================================
2020-05-21 21:05:05.659 Status: dzVents: dzRequestSolarInfo : -=[ Start HTTP Response ]=====================================
2020-05-21 21:05:05.660 Status: dzVents: dzRequestSolarInfo : Inverter "Inverter 1" Energy = 22976.00 Wh Current Power = 39.91 W
2020-05-21 21:05:05.660 Status: dzVents: dzRequestSolarInfo : to monitor create an dummy device type="Electric (Instant+Counter) name="Inverter 1"
2020-05-21 21:05:05.660 Status: dzVents: dzRequestSolarInfo : String "String 1.1" Energy = 22926.25 Wh Current Power = 0.00 W
2020-05-21 21:05:05.661 Status: dzVents: dzRequestSolarInfo : to monitor create an dummy device type="Electric (Instant+Counter) name="String 1.1"
2020-05-21 21:05:05.661 Status: dzVents: dzRequestSolarInfo : Optimizer "Panel 1.1.1" Energy = 1944.50 Wh Current Power = 13.23 W
2020-05-21 21:05:05.661 Status: dzVents: dzRequestSolarInfo : to monitor create an dummy device type="Electric (Instant+Counter) name="Panel 1.1.1"
2020-05-21 21:05:05.661 Status: dzVents: dzRequestSolarInfo : Optimizer "Panel 1.1.2" Energy = 1962.25 Wh Current Power = 10.74 W
2020-05-21 21:05:05.661 Status: dzVents: dzRequestSolarInfo : to monitor create an dummy device type="Electric (Instant+Counter) name="Panel 1.1.2"
2020-05-21 21:05:05.661 Status: dzVents: dzRequestSolarInfo : Optimizer "Panel 1.1.3" Energy = 1981.50 Wh Current Power = 9.85 W
2020-05-21 21:05:05.662 Status: dzVents: dzRequestSolarInfo : to monitor create an dummy device type="Electric (Instant+Counter) name="Panel 1.1.3"
2020-05-21 21:05:05.662 Status: dzVents: dzRequestSolarInfo : Optimizer "Panel 1.1.4" Energy = 1952.75 Wh Current Power = 7.31 W
2020-05-21 21:05:05.662 Status: dzVents: dzRequestSolarInfo : to monitor create an dummy device type="Electric (Instant+Counter) name="Panel 1.1.4"
2020-05-21 21:05:05.662 Status: dzVents: dzRequestSolarInfo : Optimizer "Panel 1.1.5" Energy = 1944.50 Wh Current Power = 7.31 W
2020-05-21 21:05:05.662 Status: dzVents: dzRequestSolarInfo : to monitor create an dummy device type="Electric (Instant+Counter) name="Panel 1.1.5"
2020-05-21 21:05:05.662 Status: dzVents: dzRequestSolarInfo : Optimizer "Panel 1.1.6" Energy = 1973.75 Wh Current Power = 8.73 W
2020-05-21 21:05:05.663 Status: dzVents: dzRequestSolarInfo : to monitor create an dummy device type="Electric (Instant+Counter) name="Panel 1.1.6"
2020-05-21 21:05:05.663 Status: dzVents: dzRequestSolarInfo : Optimizer "Panel 1.1.7" Energy = 1848.75 Wh Current Power = 11.37 W
2020-05-21 21:05:05.663 Status: dzVents: dzRequestSolarInfo : to monitor create an dummy device type="Electric (Instant+Counter) name="Panel 1.1.7"
2020-05-21 21:05:05.663 Status: dzVents: dzRequestSolarInfo : Optimizer "Panel 1.1.8" Energy = 1887.25 Wh Current Power = 10.46 W
2020-05-21 21:05:05.663 Status: dzVents: dzRequestSolarInfo : to monitor create an dummy device type="Electric (Instant+Counter) name="Panel 1.1.8"
2020-05-21 21:05:05.663 Status: dzVents: dzRequestSolarInfo : Optimizer "Panel 1.1.9" Energy = 1856.75 Wh Current Power = 9.06 W
2020-05-21 21:05:05.663 Status: dzVents: dzRequestSolarInfo : to monitor create an dummy device type="Electric (Instant+Counter) name="Panel 1.1.9"
2020-05-21 21:05:05.664 Status: dzVents: dzRequestSolarInfo : Optimizer "Panel 1.1.10" Energy = 1900.00 Wh Current Power = 11.53 W
2020-05-21 21:05:05.664 Status: dzVents: dzRequestSolarInfo : to monitor create an dummy device type="Electric (Instant+Counter) name="Panel 1.1.10"
2020-05-21 21:05:05.664 Status: dzVents: dzRequestSolarInfo : Optimizer "Panel 1.1.11" Energy = 1876.00 Wh Current Power = 12.52 W
2020-05-21 21:05:05.664 Status: dzVents: dzRequestSolarInfo : to monitor create an dummy device type="Electric (Instant+Counter) name="Panel 1.1.11"
2020-05-21 21:05:05.664 Status: dzVents: dzRequestSolarInfo : Optimizer "Panel 1.1.12" Energy = 1798.25 Wh Current Power = 8.59 W
2020-05-21 21:05:05.664 Status: dzVents: dzRequestSolarInfo : to monitor create an dummy device type="Electric (Instant+Counter) name="Panel 1.1.12"
2020-05-21 21:05:05.664 Status: dzVents: dzRequestSolarInfo : -=[ End ]=====================================================

Re: SolarEdge individual optimizer dzVents script

Posted: Friday 22 May 2020 12:21
by McMelloW
Hello Richard,

Is there no figure for the Total Lifetime Energy? (Totale energie) I could not find it in the test output.
https://monitoring.solaredge.com/solare ... ut/logical

imo This a counter within the Inverter? At least it is also available on the monitor homepage.
SolarEdgeHeader.png
SolarEdgeHeader.png (11.45 KiB) Viewed 4715 times

Re: SolarEdge individual optimizer dzVents script

Posted: Friday 22 May 2020 19:37
by freijn
I muat be doing something stupid but this is the only output I get

2020-05-22 19:34:00.531 Status: dzVents: dzRequestSolarInfo : -=[ Start HTTP Request]=======================================
2020-05-22 19:34:00.531 Status: dzVents: dzRequestSolarInfo : -=[ End ]=====================================================

any hint ?

I do net get how the
callback = 'SolarEdgeWebResponse'

should work, any hint ??

Re: SolarEdge individual optimizer dzVents script

Posted: Friday 22 May 2020 19:56
by McMelloW
Did you fill in your email, password and SiteID?

It looks like you are getting no response on the HTTP Request