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

I’ve attached an excel sheet containing all my sensors from the developer tools. I dont think there are any differences but you might be able to figure that out better than me :slight_smile:

Seems to be the same as the ones I have. Therefore the calculations should work. Would be interesting to see history charts of following sensors over a day or so:

  • solar_battery_effectiveness sensor
  • solaredge_ac_power
  • solaredge_m1_ac_power
  • solaredge_dc_power
  • solaredge_battery1_power

Unfortunately I can only include one item in a post as i am a new user… So I have to post several posts with screenshots…

Meanwhile I’ve noticed something:


Both Sreenshots are made at the same time. Do you see the differences? It is consuming power from the battery and the grid and its not representing this with your setup. It looks like its not using the battery while it definitly is. And the home consumption is less at your setup than on the monitoring platform.

Here are the requested history graphs:

Dont know why these are so small. If you would like to have it at a higher resolution just let me know.

2 things here…there is a situation apparently where my “battery_effectivness” sensor jumps to 0. in that case there is no battery power running to the house in my calculations. (Value x 0 = 0). I don’t know why that happens, need to figure that out since I thought I made sure that cannot happen. It should be 1 if there is no input. Anyhow…as soon as I have a fix I will post it here.
The other thing why house consumption is lower, is exactly this effectiveness I take into my calculations. A few posts back I tried to give an extensive explanation for this.

I will look at the graphs and see how it works for your setup and see if I can spot any problems with my configuration.

Hi remko,
i am facing similar problems with my battery. In the SolarEdge Monitor it is displayed “correct”. I understand your explanation a few post ago about several loses but this seems to a bit to high. Do you have any idea what is wrong?
I really appreciate your work!

Is this effect constantly like this, or only occasionally? I did find that the effectiveness calculation can “jump to 0” which explains this displa. I have also seen that effect on my system and that is wrong. I have not understood yet, why this happens so I am currently waiting for it to happen on my end again, so I can analyse and fix it.
As a temporary measure you could try the following when the display is incorrect:

  • Go to the Developer Tools
  • Search the entity: sensor.solar_battery_effectivness
  • Set the state to 1

If the display is correct then, it is the same issue and I hope to have that fixed soon.

Ok, I think I have found the issue. It can apparently happen, that the modbus gives wrong values. I found this brief moment in my history, where M1_ac_power, dc_power, battery_power and ac_power are all 0. This is of course not correct but just the values given to us from the modbus. It is a very brief moment, but enough to mess up the battery effectiveness calculation, which is 0 at that point.
I tried to correct it, to make sure there are more situations where the effectviness defaults to 1 in these situations. Therefore I hope this problem should not occur anymore.

I have updated the first post with the modified configuration. It is this part of the “energy.yaml” file:

    - name: "Solar Battery Effectiveness"
      unique_id: solar_battery_effectiveness
      icon: mdi:percent-outline
      unit_of_measurement: '%'
      state: >       
        {% if (((states('sensor.solaredge_dc_power') | float(0)) + (states('sensor.solaredge_battery1_power') | float(0))) <= 0 ) %}
          {% if ((states('sensor.solaredge_battery1_power')| float(0)) >= 0) %}
            {{(states('sensor.solar_battery_effectiveness'))}}
          {% elif ((states('sensor.solaredge_dc_power') | float(0)) <= 0) %}
            {{(states('sensor.solar_battery_effectiveness'))}}  
          {% else %}
            {{1 - ((((states('sensor.solaredge_battery1_power') | float(0)) * -1) - (states('sensor.solaredge_dc_power') | float(0))) /  ((states('sensor.solaredge_battery1_power') | float(0)) * -1))}}
          {% endif %} 
        {% elif is_state('sensor.solar_battery_effectiveness', 'unknown') %}
          1
        {% elif is_state('sensor.solar_battery_effectiveness', 0) %}
          1
        {% else %}
          {{(states('sensor.solar_battery_effectiveness'))}}
        {% endif %}

Hope this now works for everyone now.

Thanks for the quick answer and the solution. I saw the effect only once. I will try your solution!

I did briefly see the effect again today, but it looks like it is corrected now…(I hope)

Looks good so far, battery effectiveness never dropped to zero again since your update.

Hi All
I am a newbie with Home Assistant,
I have been trying to get the Solaredge ModBus integration working with HA for over a week now with no luck.
I have a SE4000-16A. i can only get ModBus when I use the lan port to show on the inverter as connected but i am not able to get the integration to work. all the sensors just show up as unavailable. i have searched the web for a solution and am not able to find anything.
any help would be appreciated
I have the IP Address of the inverter it is using port 502 for the ModBus i have made sure that it is using the Lan for the server connection and not Wifi. but when ever i setup the integration all the sensors just show up as unavailable.

Hai @rackey12,

When I was playing with modbus, the port I had to use was 1502 instead of 502.

I’m having some issues trying to enable MODBUS TCP on the inverter.

It worked very easily at my last house as I was able to enable MODBUS TCP via the setup web interface (http://172.16.0.1) using the P switch and it started reporting to HA straight away.

My new house I have just had two inverters (leader /follower on RS485-2) and consumption meter installed (MODBUS multi device on RS485-1 - Export+Import)

I can ping the inverter over the wifi connection, but when I enable the MODBUS TCP port I am unable to open a socket to 1502 or 502 via telnet and thus HA cannot connect either.

I have tried a lot of combinations I have read about switching port numbers and switching to non Solaredge logging, but nothing will let me access the MODBUS port.

For a few days after install I did have access through port 80 and was able to setup the SolarEdge local integration, but that port is no longer available, which seems common.

I’m wondering if having both RS485 interfaces is an issue, or wifi? My last inverter did allow access over wifi.

Any ideas?

I am not sure, but reading the Sunspec Modbus document, I did find this passage:

The RS485 bus can be configured to support connection either to a non-SolarEdge monitoring device or Leader-Follower connection
between SolarEdge inverters. Therefore, a Follower inverter cannot communicate simultaneously with a Leader inverter and with a nonSolarEdge monitoring device on the same RS485 bus.
All SolarEdge inverters with SetApp configuration have two built-in RS485 ports. An inverter can act as Leader on both ports
simultaneously

To me this sounds like it wouldn’t work if you have 2 inverters and a modbus meter connected. I think it does not allow further connections to the modbus, but I am no expert on this. Maybe the author of the integration can help you further…

1 Like

I will try and change the port and see if this works.
i have today been able to switch my maintainer to a new company because the installer went out of business. this new maintainer has been able to give me an API key which has worked and i am seeing some info in my sensors.

when i have been able to change the port i will let you know if this helped.
the other thing that i have seen in a lot of the posts on here are people being able to access the web front end of the inverter. i have not been able to do this, are there any instructions on doing this?

I think the Web frontend is actually not available on many of the newer (latest firmware) inverters. I believe I have read some posts about that a while ago. I also have not been able to access the web frontend either.

1 Like

thats really bad why would they take this feature away.
i have finally been able to get admin access to my portal so that is something at least.
next is trying to sort out this modbus setup.

I think they basically want you to use the SetApp with the installer password to change settings. I do not know if the webinterface would give you much more.

And don’t forget…99,99% of the people who have such a system only care about the monitoring portal app (if at all). There are not too many crazy people like us, fiddling with the internals…:wink:

yeah i know thats true,
i will be playing with ModBus gonna change the ports has someone suggested see if that give me the sensors.
thank you for all the help i will put an update if the port change works