SolarEdge production throttling from Domoticz

Moderator: leecollings

User avatar
jvdz
Posts: 2328
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: SolarEdge production throttling from Domoticz

Post by jvdz »

Had a look this morning at the code changes in 2.0.4 and must say that Addie made a very nice update there incorporating the Meters and Battery fields already. He elected to make that selectable whether the plugin looks at them or not.
There is also a ACTIVE_POWER_LIMIT field in there but shown as a text device instead of making it a Dimmer with the update logic.
I will work in the coming days on an update of that code to incorporate the Dimmer and the Sync options.
In the meantime, there is an update pushed to github for the plugin in the active_power_limit branch which will support the On/Off function of the dimmer.
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
eddieb
Posts: 335
Joined: Wednesday 04 July 2018 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: SolarEdge production throttling from Domoticz

Post by eddieb »

I tested the power throttle on my SE3500H and it works nice !
RPI4 Beta / Tasmota / ZigBee2MQTT / P1meter / Haier AC with Node-Red and MQTT / SolarEdge SE3500H modbus_tcp / Opentherm gateway / Plugwise Anna/Smile / ObserverIP weatherstation thru WuDirect
Feeding ADSB https://adsb.im/home
User avatar
jvdz
Posts: 2328
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: SolarEdge production throttling from Domoticz

Post by jvdz »

eddieb wrote: Saturday 14 June 2025 16:09 I tested the power throttle on my SE3500H and it works nice !
Thanks for the feedback!

I've merged the change for the dynamic Power also into my Fork of the "meters" branch so people that currently use the 2.0.4 beta version of the plugin can also use it. The current TEXT device will be replaced by a Dimmer.
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
eddieb
Posts: 335
Joined: Wednesday 04 July 2018 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: SolarEdge production throttling from Domoticz

Post by eddieb »

should I something with this message ?

Code: Select all

/opt/domoticz/userdata/plugins/domoticz-solaredge-modbustcp-plugin/plugin.py:64: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
  import pkg_resources
2025-06-15 20:24:59.320  Status: Solaredge: Initialized version 1.2.3, author 'Addie Janssen Modified by:jvdzande'
2025-06-15 20:24:59.323  Status: Solaredge: solaredge_modbus version: 0.8.0
2025-06-15 20:24:59.323  Status: Solaredge: pymodbus         version: 3.6.9
2025-06-15 20:24:59.550  Status: Solaredge: Connection established with: 192.168.26.239:1502 Device Address: 1
2025-06-15 20:24:59.550  Status: Solaredge: Inverter type: sunspecDID.SINGLE_PHASE_INVERTER
RPI4 Beta / Tasmota / ZigBee2MQTT / P1meter / Haier AC with Node-Red and MQTT / SolarEdge SE3500H modbus_tcp / Opentherm gateway / Plugwise Anna/Smile / ObserverIP weatherstation thru WuDirect
Feeding ADSB https://adsb.im/home
eddieb
Posts: 335
Joined: Wednesday 04 July 2018 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: SolarEdge production throttling from Domoticz

Post by eddieb »

ok, running your "meters" branch now
power slider does not work correct ... on/of does not work

Code: Select all

2025-06-15 20:40:48.824  Status: User: admin (IP: 192.168.26.220) initiated a switch command (179/Solaredge - Inverter - Active Power Limit/Set Level)
2025-06-15 20:40:48.833  Error: Solaredge: Call to function 'onCommand' failed, exception details:
2025-06-15 20:40:48.835  Error: Solaredge: Traceback (most recent call last):
2025-06-15 20:40:48.835  Error: Solaredge:   File "/opt/domoticz/userdata/plugins/domoticz-solaredge-modbustcp-plugin/plugin.py", line 701, in onCommand
2025-06-15 20:40:48.835  Error: Solaredge:     _plugin.onCommand(Unit, Command, Level, Hue)
2025-06-15 20:40:48.835  Error: Solaredge:   File "/opt/domoticz/userdata/plugins/domoticz-solaredge-modbustcp-plugin/plugin.py", line 401, in onCommand
2025-06-15 20:40:48.835  Error: Solaredge:     DomoLog(LogLevels.DSTATUS, f"Send active_power_limit Level {Level} to SolarEdge")
2025-06-15 20:40:48.835  Error: Solaredge:             ^^^^^^^^^^^^^^^^^
2025-06-15 20:40:48.835  Error: Solaredge:   File "/usr/lib/python3.11/enum.py", line 789, in __getattr__
2025-06-15 20:40:48.835  Error: Solaredge:     raise AttributeError(name) from None
2025-06-15 20:40:48.835  Error: Solaredge: AttributeError: DSTATUS
RPI4 Beta / Tasmota / ZigBee2MQTT / P1meter / Haier AC with Node-Red and MQTT / SolarEdge SE3500H modbus_tcp / Opentherm gateway / Plugwise Anna/Smile / ObserverIP weatherstation thru WuDirect
Feeding ADSB https://adsb.im/home
User avatar
jvdz
Posts: 2328
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: SolarEdge production throttling from Domoticz

Post by jvdz »

Thanks, I will have a look at those 2 items tomorrow and let you know.

EDIT:
eddieb wrote: Sunday 15 June 2025 20:43 ok, running your "meters" branch now
power slider does not work correct ... on/of does not work

Code: Select all

2025-06-15 20:40:48.835  Error: Solaredge:     DomoLog(LogLevels.DSTATUS, f"Send active_power_limit Level {Level} to SolarEdge")
That should be fixed now. I haven't tested it, but it's a Cut&Paste from the other branch and that loglevel isn't available in this Branch, so pretty sure this should fix it. Will only be able to test it myself tomorrow.
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
eddieb
Posts: 335
Joined: Wednesday 04 July 2018 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: SolarEdge production throttling from Domoticz

Post by eddieb »

correct, just tested, looks OK. no error
RPI4 Beta / Tasmota / ZigBee2MQTT / P1meter / Haier AC with Node-Red and MQTT / SolarEdge SE3500H modbus_tcp / Opentherm gateway / Plugwise Anna/Smile / ObserverIP weatherstation thru WuDirect
Feeding ADSB https://adsb.im/home
eddieb
Posts: 335
Joined: Wednesday 04 July 2018 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: SolarEdge production throttling from Domoticz

Post by eddieb »

3 devices are created by the latest version ...
Screenshot 2025-06-16 at 07.31.38.png
Screenshot 2025-06-16 at 07.31.38.png (82.21 KiB) Viewed 342 times
RPI4 Beta / Tasmota / ZigBee2MQTT / P1meter / Haier AC with Node-Red and MQTT / SolarEdge SE3500H modbus_tcp / Opentherm gateway / Plugwise Anna/Smile / ObserverIP weatherstation thru WuDirect
Feeding ADSB https://adsb.im/home
User avatar
jvdz
Posts: 2328
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: SolarEdge production throttling from Domoticz

Post by jvdz »

Yes when you select in the hardware setting to only monitor the inverter, these 3 are added. They all 3 deal with production regulation and the mod i made changes the active power limit device from text to dimmer so you can dynamically change it. Details can be found in the pdf i linked in the initial post.

I assume that when you select another option for monitoring, more devices will be generated for Meter/Battery.
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
eddieb
Posts: 335
Joined: Wednesday 04 July 2018 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: SolarEdge production throttling from Domoticz

Post by eddieb »

I tried the "meters version" on the system with the battery and meters connected .
No luck yet because of an older version of "git" on that system where I was not able to switch branch ...
RPI4 Beta / Tasmota / ZigBee2MQTT / P1meter / Haier AC with Node-Red and MQTT / SolarEdge SE3500H modbus_tcp / Opentherm gateway / Plugwise Anna/Smile / ObserverIP weatherstation thru WuDirect
Feeding ADSB https://adsb.im/home
1kke
Posts: 7
Joined: Sunday 02 April 2017 10:11
Target OS: Linux
Domoticz version: Beta
Location: NL
Contact:

Re: SolarEdge production throttling from Domoticz

Post by 1kke »

I'm currently testing the "Meters2" branch from jvdz with just one inverter connected, and it's working flawlessly. In addition, I'm retrieving hourly electricity prices from Enever to support my dynamic energy contract.
Although the inverter is capable of automatically throttling the active power limit, I find its built-in logic not ideal for my needs.
To improve this, I combined the "meters" branch with the hourly Enever prices in a small DzVents script that automatically adjusts the inverter's active power limit based on the current price. The script runs every hour, exactly 10 seconds past the hour.
If the electricity price is €0.00 or lower and the active power limit is not already set to 0, the script sets it to 0.
If the price is above €0.00 and the limit is not already 100, the script sets the power output to 100.
This gives me more control and ensures the inverter responds more intelligently to real-time market prices.

Dzvents:

Code: Select all

return {
    active = true,
    on = {
        timer = { 'every hour' },
        customEvents = { 'delayed' },
    },
    execute = function(domoticz, item)
        if item.isTimer then
            domoticz.emitEvent('delayed', domoticz.time.rawTime).afterSec(10)
        else
            local prijs_device = domoticz.devices("Actual Electricity Price")
            local dimmer = domoticz.devices("Inverter - Active Power Limit")

            local prijs = tonumber(prijs_device.rawData[1]) or tonumber(prijs_device.value)
            local huidige_waarde = dimmer.level
            local gewenste_waarde = nil

            if prijs then
                if prijs <= 0 and huidige_waarde ~= 0 then
                    gewenste_waarde = 0
                elseif prijs > 0 and huidige_waarde ~= 100 then
                    gewenste_waarde = 100
                end

                if gewenste_waarde ~= nil then
                    dimmer.setLevel(gewenste_waarde)
                    domoticz.log(string.format("🔄 Prijs is %.3f EUR/kWh, ActivePowerLimit aangepast naar %d%%", prijs, gewenste_waarde), domoticz.LOG_STATUS)
                else
                    domoticz.log(string.format("✅ Prijs is %.3f EUR/kWh, ActivePowerLimit staat al correct (%d%%)", prijs, huidige_waarde), domoticz.LOG_STATUS)
                end
            else
                domoticz.log("❌ Kon prijs niet omzetten naar getal: " .. tostring(prijs_device.rawData[1] or prijs_device.value), domoticz.LOG_ERROR)
            end
        end
    end
}
Last edited by 1kke on Tuesday 17 June 2025 10:12, edited 1 time in total.
eddieb
Posts: 335
Joined: Wednesday 04 July 2018 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: SolarEdge production throttling from Domoticz

Post by eddieb »

I finally managed to get git on the older domoticz system to switch to the "meters" branch
It created the 3 devices BUT the switch is created as a text device ...
Screenshot 2025-06-16 at 15.58.58.png
Screenshot 2025-06-16 at 15.58.58.png (71.76 KiB) Viewed 229 times
RPI4 Beta / Tasmota / ZigBee2MQTT / P1meter / Haier AC with Node-Red and MQTT / SolarEdge SE3500H modbus_tcp / Opentherm gateway / Plugwise Anna/Smile / ObserverIP weatherstation thru WuDirect
Feeding ADSB https://adsb.im/home
User avatar
jvdz
Posts: 2328
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: SolarEdge production throttling from Domoticz

Post by jvdz »

Then you are pointing to the original git repo,not my version.
I am currently working on a bigger change to the meters branch which will always check the received info for Meters & Batteries and removed the option to select what to look for. This will free up the last config variable to available for the p1sync option.
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
eddieb
Posts: 335
Joined: Wednesday 04 July 2018 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: SolarEdge production throttling from Domoticz

Post by eddieb »

hmm, I don't think that I am in the wrong repo...

Code: Select all

$ git log
commit d1e41afca5cc0f0e262dddb375f6433cb243a54f (HEAD -> meters, origin/meters, origin/Meters2)
Author: jvanderzande <[email protected]>
Date:   Sun Jun 15 21:00:46 2025 +0200

    Fix error logmessages.

commit 471f26ea791dc67d0d4debece8e97b0ea8ac02f4
Author: jvanderzande <[email protected]>
Date:   Sun Jun 15 19:43:56 2025 +0200

    update requirements to 0.8.0

commit c2b8f6ae544857c33bc64f06f33605b930a29aea
Author: jvanderzande <[email protected]>
Date:   Sat Jun 14 19:04:52 2025 +0200

    make MaxPower dimmer device and added ability to Send the MaxPower to SolarEdge

commit af45958a07c96fcfaaaf25a6d78c7b527b4c3234
Author: Addie Janssen <[email protected]>
Date:   Sat Jul 22 16:21:45 2023 +0200

    Bumped version up to 2.0.4
RPI4 Beta / Tasmota / ZigBee2MQTT / P1meter / Haier AC with Node-Red and MQTT / SolarEdge SE3500H modbus_tcp / Opentherm gateway / Plugwise Anna/Smile / ObserverIP weatherstation thru WuDirect
Feeding ADSB https://adsb.im/home
User avatar
jvdz
Posts: 2328
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: SolarEdge production throttling from Domoticz

Post by jvdz »

eddieb wrote: Monday 16 June 2025 17:18 hmm, I don't think that I am in the wrong repo...
My Bad, you have a 3fase inverter and I only updated the device for a 1-fase SolarEdge which I test with.
Have pushed an update to fix that to meters.

Nearly ready to push an update to Meters2, which is the meters branch with updates to check for Batteries and Meters without having to set it.
It also fixes issues when there is no actual battery connected like in my case but still "thinks" they are there since my SE returns the batteries block data with some default values in it.

Soon I will make the decision on how to proceed with this and cleanup the extra branches and go forward with one updated master.
Iam leaning towards this last Meters2 version.

Does anybody see any reason why we should leave the Average/Max calculations in there as I would think that domoticz should simply receive the inverter raw/real data?
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
eddieb
Posts: 335
Joined: Wednesday 04 July 2018 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: SolarEdge production throttling from Domoticz

Post by eddieb »

Allready saw the commit and updated here, looking OK now
Screenshot 2025-06-16 at 19.07.26.png
Screenshot 2025-06-16 at 19.07.26.png (71.27 KiB) Viewed 191 times
next I am going to try the meters and battery part
RPI4 Beta / Tasmota / ZigBee2MQTT / P1meter / Haier AC with Node-Red and MQTT / SolarEdge SE3500H modbus_tcp / Opentherm gateway / Plugwise Anna/Smile / ObserverIP weatherstation thru WuDirect
Feeding ADSB https://adsb.im/home
User avatar
jvdz
Posts: 2328
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: SolarEdge production throttling from Domoticz

Post by jvdz »

eddieb wrote: Monday 16 June 2025 19:09 Allready saw the commit and updated here, looking OK now
Screenshot 2025-06-16 at 19.07.26.png
Nice
eddieb wrote: Monday 16 June 2025 19:09 next I am going to try the meters and battery part
Could you try that with Meters2 that I just pushed?
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
eddieb
Posts: 335
Joined: Wednesday 04 July 2018 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: SolarEdge production throttling from Domoticz

Post by eddieb »

I will try,
"meters" gave me 94 new devices and a lot of errors ...
All values are 0 (zero)
RPI4 Beta / Tasmota / ZigBee2MQTT / P1meter / Haier AC with Node-Red and MQTT / SolarEdge SE3500H modbus_tcp / Opentherm gateway / Plugwise Anna/Smile / ObserverIP weatherstation thru WuDirect
Feeding ADSB https://adsb.im/home
User avatar
jvdz
Posts: 2328
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: SolarEdge production throttling from Domoticz

Post by jvdz »

eddieb wrote: Monday 16 June 2025 19:20 "meters" gave me 94 new devices and a lot of errors ...
Currently, a device is created for nearly each value received from the SolarEdge device in the Meters and Battery data blocks, so maybe it is sensible to limit that to the essential devices?
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
eddieb
Posts: 335
Joined: Wednesday 04 July 2018 7:48
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: SolarEdge production throttling from Domoticz

Post by eddieb »

Ok, "Meters2" gives me also 94 new devices (all showing 0 (zero)
and a lot of the following errors

Code: Select all

2025-06-16 19:25:58.480  Solaredge direct: Inverter returned information for Inverter
2025-06-16 19:25:58.702  Solaredge direct: update device: Active Power Limit  nValue:2 sValue:100.00
2025-06-16 19:25:58.703  Solaredge direct: Updated 16 values out of 25
2025-06-16 19:25:59.568  Solaredge direct: Inverter returned information for Meter1
2025-06-16 19:25:59.571  Error: Solaredge direct: Call to function 'onHeartbeat' failed, exception details:
2025-06-16 19:25:59.573  Error: Solaredge direct: Traceback (most recent call last):
2025-06-16 19:25:59.573  Error: Solaredge direct:   File "/home/pi/domoticz/plugins/domoticz-solaredge-modbustcp-plugin/plugin.py", line 697, in onHeartbeat
2025-06-16 19:25:59.574  Error: Solaredge direct:     _plugin.onHeartbeat()
2025-06-16 19:25:59.574  Error: Solaredge direct:   File "/home/pi/domoticz/plugins/domoticz-solaredge-modbustcp-plugin/plugin.py", line 253, in onHeartbeat
2025-06-16 19:25:59.574  Error: Solaredge direct:     self.processValues(device_details, values)
2025-06-16 19:25:59.575  Error: Solaredge direct:   File "/home/pi/domoticz/plugins/domoticz-solaredge-modbustcp-plugin/plugin.py", line 326, in processValues
2025-06-16 19:25:59.575  Error: Solaredge direct:     if (unit[Column.ID + offset] == inverters.InverterUnit.ACTIVE_POWER_LIMIT ):
2025-06-16 19:25:59.576  Error: Solaredge direct: IndexError: list index out of range
RPI4 Beta / Tasmota / ZigBee2MQTT / P1meter / Haier AC with Node-Red and MQTT / SolarEdge SE3500H modbus_tcp / Opentherm gateway / Plugwise Anna/Smile / ObserverIP weatherstation thru WuDirect
Feeding ADSB https://adsb.im/home
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest