SolarEdge individual optimizer dzVents script

In this subforum you can show projects you have made, or you are busy with. Please create your own topic.

Moderator: leecollings

freijn
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

Post by freijn »

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 ?
User avatar
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

Post by McMelloW »

freijn wrote: Friday 22 May 2020 20:00 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 ?
Just in the gui. save it. switch it on and saved it again. Then it is active in generated scripts
Greetings McMelloW
freijn
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

Post by freijn »

What type of script ? timer I assume ?
User avatar
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

Post by McMelloW »

Copy - Paste from dzRequestSolarInfo.lua at github in the event gui.
Then saved it.
Greetings McMelloW
freijn
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

Post by freijn »

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?

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 ]=====================================================
User avatar
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

Post by McMelloW »

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.
Greetings McMelloW
freijn
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

Post by freijn »

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
User avatar
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

Post by McMelloW »

Today, I discover a difference in values of my Daily Energy Production. See picture below.
SE-DailyProduction.png
SE-DailyProduction.png (23.69 KiB) Viewed 2554 times
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
Dols
Posts: 27
Joined: Friday 15 January 2016 14:22
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: SolarEdge individual optimizer dzVents script

Post by Dols »

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 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.
User avatar
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

Post by McMelloW »

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.
Thanks for your answer.
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
Dols
Posts: 27
Joined: Friday 15 January 2016 14:22
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: SolarEdge individual optimizer dzVents script

Post by Dols »

freijn wrote: Friday 22 May 2020 21:04 [..]
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. :D
Last edited by Dols on Friday 22 May 2020 22:38, edited 1 time in total.
Dols
Posts: 27
Joined: Friday 15 January 2016 14:22
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: SolarEdge individual optimizer dzVents script

Post by Dols »

freijn wrote: Friday 22 May 2020 21:31 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!
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.
Dols
Posts: 27
Joined: Friday 15 January 2016 14:22
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: SolarEdge individual optimizer dzVents script

Post by Dols »

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.
What does the solaredge website say?

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.
User avatar
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

Post by McMelloW »

Dols wrote: Friday 22 May 2020 22:55 What does the solaredge website say?

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.
This makes even more complicated. An 4th number 10.92 kWh
Greetings McMelloW
Dols
Posts: 27
Joined: Friday 15 January 2016 14:22
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: SolarEdge individual optimizer dzVents script

Post by Dols »

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
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.
User avatar
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

Post by McMelloW »

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.
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?
Greetings McMelloW
freijn
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

Post by freijn »

Dols wrote: Friday 22 May 2020 22:36
freijn wrote: Friday 22 May 2020 21:31 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!
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.
in your inbox
User avatar
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

Post by McMelloW »

Quick question.
What is the difference in the device options Computed or From Device?
Greetings McMelloW
Dols
Posts: 27
Joined: Friday 15 January 2016 14:22
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: SolarEdge individual optimizer dzVents script

Post by Dols »

McMelloW wrote: Saturday 23 May 2020 12:04 Quick question.
What is the difference in the device options Computed or From Device?
"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.
Dols
Posts: 27
Joined: Friday 15 January 2016 14:22
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: SolarEdge individual optimizer dzVents script

Post by Dols »

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?
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.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest