UPDATED! SolarEdge Modbus full setup guide with Energy Dashboard integration for Installations with Battery connected

Hi

I also export from battery to the grid as I am on 30 minute market rates (soon to be 5 minutes) with my electricity supplier (Amber Australia) so when there are large fluctuations in the import/export prices my system can make quite a bit of money. :partying_face: The stats do go a bit haywire when charging/discharging from/to the grid.
The below is when the system is set to maximum self-consumption so is normal
image
image

And then when maximise export is set with no change to house load
image
image

The house is actually only consuming 2.5kw, not 5kw
Solar is actually producing 2.9kw, not 5kw so it looks like the battery adds to the solar output and the battery inverted to ac adds to the house consumption which is not correct.

Conversely when the battery charges from the grid
image
image
House Consumption Feeds to Solar Panels (via negative value on solar to house) which then feeds to battery

Is there a way to fix this so the stats read correctly or are there not enough clamps to differentiate the inputs and outputs when the battery is discharging/charging to/from the grid?

P.S I appreciate your effort in this dashboard setup as it looks fantastic and works very well! :slight_smile:

This is a complex issue trying to map the correct power flows into the Tesla card is non trivial when you include a battery, especially if the battery is able to export to the grid.

After going around in circles this has documented this for the 4x powerwall sensors (solar, load, site & battery), which should be able to be adapted for SolarEdge sensors.

Thanks Mark, I’ll give it a go - only thing is my battery is a solaredge DC battery so this might not work like yours…

EDIT: No seems to work well! Thanks again @markpurcell

Please don’t mind me asking

I’m a bit lost in the conversation

I have a SolarEdge SE6000HD with LG Chem Battery

Which code should I look at ?

You should be good with the config from the first post.

I will update it soon, as I have changed to the multi inverter integration, but that is a small change.

2 Likes

Hi All,
Using the configuration found at the top of this post (config matching as of today), great work. Love it!

Occasionally, i find that I’m generating via panels, battery is charging, but the house records zero W usage. I’ve only noticed this occur when consuming zero grid (being completely self sufficient). Just wondering if any of the house consumption formulas are zeroing out it’s output a bit too eagerly?

ignore the layout, it’s just up this way to demonstrate the current values, distribution card and tesla card experience.

Should

      - name: "Solar Panel To House W"
        unique_id: solar_panel_to_house_w
        unit_of_measurement: "W"
        icon: mdi:solar-power
        state: >
          {% if ((states('sensor.solaredge_battery1_power') | float(0)) >= 0) and ((states('sensor.solaredge_m1_ac_power') | float(0)) > 0) %}
            {{(states('sensor.solaredge_ac_power') | float(0) - states('sensor.solaredge_m1_ac_power') | float(0))}}
          {% elif ((states('sensor.solaredge_battery1_power') | float(0)) >= 0) and ((states('sensor.solaredge_m1_ac_power') | float(0)) < 0) %}
            {{states('sensor.solaredge_ac_power') | float(0)}}
          {% elif ((states('sensor.solaredge_battery1_power') | float(0)) < 0)%}
            {% if ((states('sensor.solaredge_dc_power') | float(0) + states('sensor.solaredge_battery1_power') | float(0)) < 0 ) %}
              0
            {% else %}
              {{((states('sensor.solaredge_dc_power') | float(0)) + (states('sensor.solaredge_battery1_power') | float(0))) * (states('sensor.solar_inverter_effectiveness') | float(0))}}
            {% endif %}   
          {% else %}
            0
          {% endif %}

be adjusted to

      - name: "Solar Panel To House W"
        unique_id: solar_panel_to_house_w
        unit_of_measurement: "W"
        icon: mdi:solar-power
        state: >
          {% if ((states('sensor.solaredge_battery1_power') | float(0)) >= 0) and ((states('sensor.solaredge_m1_ac_power') | float(0)) > 0) %}
            {{(states('sensor.solaredge_ac_power') | float(0) - states('sensor.solaredge_m1_ac_power') | float(0))}}
          {% elif ((states('sensor.solaredge_battery1_power') | float(0)) >= 0) and ((states('sensor.solaredge_m1_ac_power') | float(0)) <= 0) %}
            {{states('sensor.solaredge_ac_power') | float(0)}}
          {% elif ((states('sensor.solaredge_battery1_power') | float(0)) < 0)%}
            {% if ((states('sensor.solaredge_dc_power') | float(0) + states('sensor.solaredge_battery1_power') | float(0)) < 0 ) %}
              0
            {% else %}
              {{((states('sensor.solaredge_dc_power') | float(0)) + (states('sensor.solaredge_battery1_power') | float(0))) * (states('sensor.solar_inverter_effectiveness') | float(0))}}
            {% endif %}   
          {% else %}
            0
          {% endif %}

Spot the “>” being adjusted to “>=” on the first elif.

hmmm…good one. I haven’t tried that but that could help. Could you change it in your configuration and post back to see if that fixes the issue for you? I will modify the first post accordingly.

I’ve had the configuration in place since the above post and no longer get 0w house consumption whilst charging the battery and not importing from the grid. So for me I’m no longer occasionally missing a bunch of power being consumed by the house, meaning for me this is a closer match to the SolarEdge app.

This does not work for me. I had to change it to

homeassistant:
  packages:
    energy: !include packages/energy.yaml
2 Likes

My solution was and is:

/config/packages/energy.yaml

…didn’t remember I had to struggle with it :slight_smile:

1 Like

I am having one tiny issue… None of my M1 sensors show anything of value. When I installed the integration I checked the Meter 1 box so the sensors show up, just that the data is bad. I had the installer add ethernet and I enabled Modbus - I do not have extra cables or anything if it is a physical connection requirement of some type. Any ideas?

SolarEdge Inverter monitor wifi replacement. $40 IOGear GWU637 Easy to install. Works great!!

My inverter is the SolarEdge SE6000H-US. The IOGear device replaced the SolarEdge wifi and saved hundreds of dollars!! I looked into Powerline adapters, but the IOGear GWU637 is much much simpler and works without a hitch. Use the SolarEdge “SetApp” to make the connection inside the inverter to Ethernet. Hook ethernet cable to the inverter board at the ethernet jack and the other end of the cable to the GWU 637. For power, the 637 can be plugged into the USB port (next to the ethernet/LAN port) on the inverter board, or can be plugged in AC outlet with included ac adapter. You only need the SetApp application and then follow the simple IOGear instructions for setting up the GWU637 to communicate with your internet/wifi Network. Absolutely a life saver so can monitor solar energy system production. hope this is helpful to someone here.

Hey @spry-salt . I can confirm that (with a recently installed Australian SolarEdge SE8250H inverter) I have managed to get Modbus over TCP working on Wifi - it was running the latest firmware 4.16.19 which SolarEdge installed during some troubleshooting and it worked perfectly. However, that inverter had other issues and had to be swapped out under warranty. Now I have a replacement running on the older firmware 4.15.119 and it has stopped sending the Modbus data. I have a ticket in with SolarEdge to get the new August 2022 firmware installed and hopefully that will fix it once more. I’ll report back.

1 Like

ah dang sorry I just saw this. Do you have an installer account on solaredge or something? I don’t have that level of detail anywhere in the interface from what I can tell.

I’ve gone back and forth with solaredge support a couple times at this point, but they are very slow to respond. I sent them a wireshark pcap a couple weeks ago where I was just manually reading registers using this command-line tool. They sent me this link: https://solared.ge/modbus-tcp which includes a broken link to the “Power Control Protocol Application Note” that everyone has been using to implement the battery registers in their various libraries. The one everyone has been using is from 2017, so it’s possible there’s a new version that has the correct registers in it.

Honestly I might write a script that just loops through addresses and sees if there are some registers somewhere that aren’t documented.

If you have any luck with solaredge support or any of this, please let me know… I’ll try to keep a closer eye on this, I figured I’d get an email if someone replied but I guess not.

1 Like

try this repo in hacs:

2 Likes

I tried your fix, but I still get the 0 a lot.
I will look into it

Thanks. How did you convince them to update your firmware? I’ve asked my installer but I don’t know whether they’ll be willing to do it.

Let us know how you get on, I’ve not seen any zeros on house consumption since and am keen to make this family proof without them questioning the accuracy!

I haven’t yet :slight_smile: I have a ticket open with SolarEdge directly asking for it to be done. They haven’t said they won’t do it so I’m hopeful. They’re inundated with tickets though and it has to be escalated to a senior engineer. I’ll chase them tomorrow if I don’t hear anything today.

That looks interesting. I’d love to get panel-level data into HA. I tried it but had an “Invalid authentication” error. I wonder whether that’s because I have a regular genesis SE8250H and not the Energy Hub version (or the Genesis Enhancement Pack) which adds the panel level monitoring)?