SolarEdge individual optimizer dzVents script
Moderator: leecollings
-
- Posts: 536
- Joined: Friday 23 December 2016 16:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: Netherlands Purmerend
- Contact:
Re: SolarEdge individual optimizer dzVents script
i did , and if i do the url manual i get the response with a lot of content
Perhaps.......
how did you create the script ? as a file directly in the directory or (as i did ) in the gui interface ?
Perhaps.......
how did you create the script ? as a file directly in the directory or (as i did ) in the gui interface ?
- McMelloW
- Posts: 434
- Joined: Monday 20 November 2017 17:01
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V2024.1
- Location: Harderwijk, NL
- Contact:
Re: SolarEdge individual optimizer dzVents script
Just in the gui. save it. switch it on and saved it again. Then it is active in generated scripts
Greetings McMelloW
-
- Posts: 536
- Joined: Friday 23 December 2016 16:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: Netherlands Purmerend
- Contact:
Re: SolarEdge individual optimizer dzVents script
What type of script ? timer I assume ?
- McMelloW
- Posts: 434
- Joined: Monday 20 November 2017 17:01
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V2024.1
- Location: Harderwijk, NL
- Contact:
Re: SolarEdge individual optimizer dzVents script
Copy - Paste from dzRequestSolarInfo.lua at github in the event gui.
Then saved it.
Then saved it.
Greetings McMelloW
-
- Posts: 536
- Joined: Friday 23 December 2016 16:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: Netherlands Purmerend
- Contact:
Re: SolarEdge individual optimizer dzVents script
Hi Richard,
Very interested in your code but somehow I can't get it to work
Below my extra debug steps.
Below that the logfile of it.
of course I double checked my login password and site-id. Just thinking, could the capta be the issue here?
Very interested in your code but somehow I can't get it to work

Below my extra debug steps.
Below that the logfile of it.
of course I double checked my login password and site-id. Just thinking, could the capta be the issue here?
Code: Select all
--------------------------------------------------------------------------------
execute = function(domoticz, item)
--------------------------------------------------------------------------------
if (item.isTimer) then
LogDebug(domoticz, "-=[ Start HTTP Request]=======================================")
RequestSolardEdge(domoticz)
elseif (item.isHTTPResponse) then
LogDebug(domoticz, "-=[ Start HTTP Response ]=====================================")
if (item.ok) then
LogDebug(domoticz, "Item.ok")
local info = { Inverters = {}, Strings = {}, Optimizers = {} }
LogDebug(domoticz,info)
for _, child in pairs(item.json.logicalTree.children) do
LogDebug(domoticz, "Loop GetInverterDatar")
local inverter = GetInverterData(item.json, info, child)
if inverter then
table.insert(info.Inverters, inverter)
end
end
for _, device in ipairs(info.Inverters) do
LogDebug(domoticz, "Loop Inverters")
UpdateDevice(domoticz, "Inverter", device)
end
for _, device in ipairs(info.Strings) do
LogDebug(domoticz, "Loop String")
UpdateDevice(domoticz, "String", device)
end
for _, device in ipairs(info.Optimizers) do
LogDebug(domoticz, "Loop Optimizer")
UpdateDevice(domoticz, "Optimizer", device)
end
else
LogDebug(domoticz, string.format("Error in HTTP request. Error %d - %s", item.statusCode, item.statusText))
end
end
LogDebug(domoticz, "-=[ End ]=====================================================")
end
}
Code: Select all
2020-05-22 20:58:00.375 Status: dzVents: dzRequestSolarInfo : -=[ Start HTTP Request]=======================================
2020-05-22 20:58:00.375 Status: dzVents: dzRequestSolarInfo : https://monitoring.solaredge.com/solaredge-apigw/api/sites/480XXX/layout/logical
2020-05-22 20:58:00.375 Status: dzVents: dzRequestSolarInfo : -=[ End ]=====================================================
2020-05-22 20:58:03.335 Status: dzVents: dzRequestSolarInfo : -=[ Start HTTP Response ]=====================================
2020-05-22 20:58:03.335 Status: dzVents: dzRequestSolarInfo : Item.ok
2020-05-22 20:58:03.335 Status: dzVents: dzRequestSolarInfo : table: 0xad15cdc0
2020-05-22 20:58:03.335 Status: dzVents: dzRequestSolarInfo : -=[ End ]=====================================================
2020-05-22 20:58:08.052 Status: dzVents: Write file: /home/pi/domoticz/scripts/dzVents/generated_scripts/dzRequestSolarInfo.lua
2020-05-22 20:59:02.555 Status: dzVents: dzRequestSolarInfo : -=[ Start HTTP Response ]=====================================
2020-05-22 20:59:02.555 Status: dzVents: dzRequestSolarInfo : Item.ok
2020-05-22 20:59:02.555 Status: dzVents: dzRequestSolarInfo : table: 0xa61a7338
2020-05-22 20:59:02.555 Status: dzVents: dzRequestSolarInfo : Loop GetInverterDatar
2020-05-22 20:59:02.555 Status: dzVents: dzRequestSolarInfo : -=[ End ]=====================================================
- McMelloW
- Posts: 434
- Joined: Monday 20 November 2017 17:01
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V2024.1
- Location: Harderwijk, NL
- Contact:
Re: SolarEdge individual optimizer dzVents script
Hmmm, strange.
Just copy / paste the script from github. Change the lines for email, password and siteID. Saved it and switched to active.
It works like a charm. See my output in previous posting.
Just copy / paste the script from github. Change the lines for email, password and siteID. Saved it and switched to active.
It works like a charm. See my output in previous posting.
Greetings McMelloW
-
- Posts: 536
- Joined: Friday 23 December 2016 16:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: Netherlands Purmerend
- Contact:
Re: SolarEdge individual optimizer dzVents script
Richard,
I had to change :
if component.data and component.data.type == "INVERTER" then
into :
if component.data and component.data.type == "INVERTER_3PHASE" then
Now its working!
Cheers,
Frank
I had to change :
if component.data and component.data.type == "INVERTER" then
into :
if component.data and component.data.type == "INVERTER_3PHASE" then
Now its working!
Cheers,
Frank
- McMelloW
- Posts: 434
- Joined: Monday 20 November 2017 17:01
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V2024.1
- Location: Harderwijk, NL
- Contact:
Re: SolarEdge individual optimizer dzVents script
Today, I discover a difference in values of my Daily Energy Production. See picture below.
Actueel Vermogen SE = directly taken from the Inverter via a LAN connection to my RPi
Inverter 1 = With the use of the lua script from the Solaredge Monitor website
String 1.1 = With the use of the lua script from the Solaredge Monitor website
Why do I have 3 different values of Vandaag, all 3 from the same inverter.
Actueel Vermogen SE = directly taken from the Inverter via a LAN connection to my RPi
Inverter 1 = With the use of the lua script from the Solaredge Monitor website
String 1.1 = With the use of the lua script from the Solaredge Monitor website
Why do I have 3 different values of Vandaag, all 3 from the same inverter.
Greetings McMelloW
-
- Posts: 27
- Joined: Friday 15 January 2016 14:22
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: SolarEdge individual optimizer dzVents script
Not in that json file. Maybe with different uri. I haven't found it yet. But even then, looks like its only for the inverter, not for the individual optimizer. Thinking about this, the original web hardware already does this.McMelloW wrote: ↑Friday 22 May 2020 12:21 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
Not having tot the total energy gives some problems with the day graphs, which needs a continuous increasing value.
In my commit of may 21, i have the first attempt to calculate the "total" energy from the cumulative day energy. It failed. Currently testing a second attempt. Will take a few days to verify if this works correctly.
- McMelloW
- Posts: 434
- Joined: Monday 20 November 2017 17:01
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V2024.1
- Location: Harderwijk, NL
- Contact:
Re: SolarEdge individual optimizer dzVents script
Thanks for your answer.Dols wrote: ↑Friday 22 May 2020 22:15
Not in that json file. Maybe with different uri. I haven't found it yet. But even then, looks like its only for the inverter, not for the individual optimizer. Thinking about this, the original web hardware already does this.
Not having tot the total energy gives some problems with the day graphs, which needs a continuous increasing value.
In my commit of may 21, i have the first attempt to calculate the "total" energy from the cumulative day energy. It failed. Currently testing a second attempt. Will take a few days to verify if this works correctly.
Getting the information directly from the inverter via a LAN connection contains the total lifetime production. See my picture "Totaal Vermogen SE"
Can I redirect the the http respond to a file, so I can investigate all information received from Solaredge.
Greetings McMelloW
-
- Posts: 27
- Joined: Friday 15 January 2016 14:22
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: SolarEdge individual optimizer dzVents script
Looks like it can't find the data. Some items in the json are localized. What is you language setting in you solaredge monitoring web site? Can be found under account settings. My guess is that you have metric setting and language dutch. That should work.
Never mind, you found the real problem.

Last edited by Dols on Friday 22 May 2020 22:38, edited 1 time in total.
-
- Posts: 27
- Joined: Friday 15 January 2016 14:22
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: SolarEdge individual optimizer dzVents script
If you want can you send me one json result? I have just a 1 phase converter. I want to check if there is more different.
-
- Posts: 27
- Joined: Friday 15 January 2016 14:22
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: SolarEdge individual optimizer dzVents script
What does the solaredge website say?McMelloW wrote: ↑Friday 22 May 2020 21:34 Today, I discover a difference in values of my Daily Energy Production. See picture below.
SE-DailyProduction.png
Actueel Vermogen SE = directly taken from the Inverter via a LAN connection to my RPi
Inverter 1 = With the use of the lua script from the Solaredge Monitor website
String 1.1 = With the use of the lua script from the Solaredge Monitor website
Why do I have 3 different values of Vandaag, all 3 from the same inverter.
I don't trust my calculation to have continuous increase energy value. It has some problems on the daily rollover. I just committed a change that disables the calculation.
- McMelloW
- Posts: 434
- Joined: Monday 20 November 2017 17:01
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V2024.1
- Location: Harderwijk, NL
- Contact:
Re: SolarEdge individual optimizer dzVents script
This makes even more complicated. An 4th number 10.92 kWh
Greetings McMelloW
-
- Posts: 27
- Joined: Friday 15 January 2016 14:22
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: SolarEdge individual optimizer dzVents script
Hmm, total energy of the optimizers can be found with next url. But it is an HTTP POST and needs an session ID.....McMelloW wrote: ↑Friday 22 May 2020 12:21 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
https://monitoring.solaredge.com/solare ... meUnit=ALL
timeUnit can be "DAY", "WEEK", "MONTH", "YEAR", "ALL". And with ALL i get the strange reading.
- McMelloW
- Posts: 434
- Joined: Monday 20 November 2017 17:01
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V2024.1
- Location: Harderwijk, NL
- Contact:
Re: SolarEdge individual optimizer dzVents script
In this api guide http://www.solaredge.com/files/pdfs/se_ ... ng_api.pdf They speak about "lifetime" But not all API's return with this value.Dols wrote: ↑Saturday 23 May 2020 0:42 Hmm, total energy of the optimizers can be found with next url. But it is an HTTP POST and needs an session ID.....
https://monitoring.solaredge.com/solare ... meUnit=ALL
timeUnit can be "DAY", "WEEK", "MONTH", "YEAR", "ALL". And with ALL i get the strange reading.
Do you use the same API guide?
Greetings McMelloW
-
- Posts: 536
- Joined: Friday 23 December 2016 16:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: Netherlands Purmerend
- Contact:
Re: SolarEdge individual optimizer dzVents script
- McMelloW
- Posts: 434
- Joined: Monday 20 November 2017 17:01
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V2024.1
- Location: Harderwijk, NL
- Contact:
Re: SolarEdge individual optimizer dzVents script
Quick question.
What is the difference in the device options Computed or From Device?
What is the difference in the device options Computed or From Device?
Greetings McMelloW
-
- Posts: 27
- Joined: Friday 15 January 2016 14:22
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: SolarEdge individual optimizer dzVents script
"computed" it does not use the energy (Kwh) information provided, but instead in calculates (integrates) the power (Watt) instead. This is typically used when there is no (reliable) energy information available.
"from device" stores the energy (Kwh) as provided. It expects this to be an ever growing number to work correctly. (total energy). Providing it with the day energy will break the day graph, maybe some other stuff too.
-
- Posts: 27
- Joined: Friday 15 January 2016 14:22
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: SolarEdge individual optimizer dzVents script
No i don't use the official API. I use the API the monitoring website is using. Found a hint somewhere on the internet, from there it's reverse engineering.McMelloW wrote: ↑Saturday 23 May 2020 1:32 In this api guide http://www.solaredge.com/files/pdfs/se_ ... ng_api.pdf They speak about "lifetime" But not all API's return with this value.
Do you use the same API guide?
Who is online
Users browsing this forum: No registered users and 1 guest