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

Hey @Remko
could you please look at the following Posts?

and

i’think that there is a small Bug in the Calculation in rare Situations. Perhaps you could fix it?

br
s_ash

Hi @s_ash ,

sorry for the late replies. Been pretty busy with work lately and just haven’t gotten round to actively answering here. So my try…I do see the “issues” people are reporting and may have 2 different explanations:

  1. Some people use an EV charger, which I do not have and do not know how I could integrate that, without having some setup myself. So, if that is the case I am afraid I cannot really help figuring that out.

  2. The other effect I keep seeing is the result of the effectiveness of both battery, as well as the inverter. In my previous version of this package I did not take that into account. In this setup I do and the effect is quite dramatic to be honest. The inverter itself is pretty good, the effectiveness is always around 98%. That means, if the panels would produce 100W and I would use all for my house consumption, 98 W would actually be used by my house.
    The other effectiveness value, the battery, is quite different. It really depends on the charge state of the battery and the load I am asking from it, how effective it is. The values range between 95% (very good) and about 40% (not so good). So this means…if the battery delivers 100W to the house, my house actually only gets 40W of real usage.

Here it is clearly visible in the graphs over the same time period.
image
image

The effect is actually more dramatic if you take the actual values and not my average calculation:
image

These effects are not taking into account when using the Solaredge Monitoring platform. I think it would scare most people how much power they actually loose.

For example, below a screenshot of my total values so far this year:
image

and the corresponding values from SolarEdge:

So what I see here:

  • Total production is roughly equal, so that is correct
  • Import and export are roughly equal
  • My House consumption is off by about 300 kWh.
  • Battery output is off by about 200 kWh

My conclusion: The battery output in my own calculation takes the effectiveness into account and you can see here that in average, my battery has an effectivity of (590/841) 70%

This also results in the difference in house consumption; Solaredge just takes the direct output value from the battery and ignores the losses there.

So summarised, if I look at my values over a couple of months now, it seems pretty accurate and the differences I see are explainable. Again, if people see bigger differences it may be due to EV Charger, not having a battery, or just simply a different setup which is hard for me to debug.

An option would be to basically edit the yaml in your configuration and take the effectiveness calculations out. So basically replace this section:

    - name: "Solar Inverter Effectiveness"
      unique_id: solar_inverter_effectiveness
      icon: mdi:percent-outline
      unit_of_measurement: '%'
      state: >
        {% if ((states('sensor.solaredge_dc_power') | float(0)) < 100) or ((states('sensor.solaredge_ac_power') | float(0)) < 100)%}
          {{(states('sensor.solar_inverter_effectiveness'))}}
        {% else %}
          {% if is_state('sensor.solar_inverter_effectiveness', 'unknown') %}
            1
          {% elif ((states('sensor.solaredge_ac_power') | float(0)) <= 0) %}
            {{(states('sensor.solar_inverter_effectiveness'))}}
          {% elif ((states('sensor.solaredge_dc_power') | float(0)) <= 0) %}
            {{(states('sensor.solar_inverter_effectiveness'))}}
          {% else %}
            {{(states('sensor.solaredge_ac_power') | float(0)) / (states('sensor.solaredge_dc_power') | float(0))}}
          {% endif %}
        {% endif %}
        
    - 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', 'unavailable') %}
          1
        {% elif is_state('sensor.solar_battery_effectiveness', 0) %}
          1
        {% else %}
          {{(states('sensor.solar_battery_effectiveness'))}}
        {% endif %}

with this:

    - name: "Solar Inverter Effectiveness"
      unique_id: solar_inverter_effectiveness
      icon: mdi:percent-outline
      unit_of_measurement: '%'
      state: '1'
        
    - name: "Solar Battery Effectiveness"
      unique_id: solar_battery_effectiveness
      icon: mdi:percent-outline
      unit_of_measurement: '%'
      state: '1'

I hope this answers some of the questions and helps others forward.

1 Like

Simply Magnificent! - Thanks so much for spending the time to get this working :slight_smile:
Much satisfaction now that everything is logging properly!

1 Like

Charging and discharging house batteries always comes with a high amount of lost energy.
The efficiency of a battery depends on the setup… but usually, your inverter converts DC into AC (with losses) - then, the battery inverter will again convert the AC into DC (with losses) and if your house consumes energy from the battery, it needs to be converted again from DC into AC (again with losses).

all of that needs to be taken to account…

Yes correct, I just find it interesting to see that this setup allows me to make these losses visible. Especially the relation between load on the battery and it’s charge state. really interesting to see how the battery operates in those areas and to see how much is actually lost (which is quite a bit I think).

Hey Remko,

thank you for your great support and your Answer!

I’ve thought a little Time about your answer, and i think most of your explaination is absolutely correct! But some (edge) Cases are in my opinion not 100% correct.

the Examples from the following Posts show exactly the same behavior.

and

i don’t think that your explanation is correct, because in my case the House consumption at the pic is at 222w - but my house always uses more than 400w (my little Server, POE Switches and mining rig alone are at about 300w - always)

today i hade again the same problem - the pv gives me some watts, the battery gives me some watts and the net also gives me some watts. Every time - In this case - the values are not correct.

I hope you understand what i mean - perhaps we could talk together also in German (PN?) - perhaps it helps to understand each other?

1 Like

Hi, I have problems with battery readout. It doesn’t read out battery? Sometime it does and than it stops.

Many thanks for your work!
I installed the suggested integration, configured configuration.yaml and energy.yaml as described.
I’d like use Energy Dashboard.
Are the data insert correct?


(I have doubt about GRID CONSUMPTION and RETURN TO GRID)
Thanks

Those should be ok, I personally have sensor.solaredge_m1_exported_kwh for export and sensor.solaredge_m1_imported_kwh for import, but that should not make a difference.

just now I see that all values are 0…

at first I installed the solaredge integration, after I Enabled Modbus TCP on SolarEdge Inverter, and installed home-assistant-solaredge-modbus by HACS.
At last I configured conf.yaml and energy.yaml…

It will take a few hours before data starts to show up in the energy dashboard. But I would start to make sure that the entities from the modbus integration actually gives you values.

You also only need the modbus integration, I do not use the cloud based solar edge integration at all.

So, Should I remove the integration? How can I check if the modbus integration works?

You can check the entities provided by the modbus integration, use the developer tools to see if they provide you values. I would also check that the entity names match the ones from my configuration etc.

forgive my ignorance, Is there a list of modbus integration entities?

If you go to settings - devices and services - integrations, you should be able to find the integration there and it should have a link to the corresponding entities.

Ok, there was some mistakes…
At first I removed SOLAREDGE intergation.

This is the conf page of the inverter:

After, I installed this:
image

But all the sensors re “unknown”

The ip address of the inverter is ok…

Solved… The modbus communication works only by cable…

sorry, but:
solar_imported_power_w is obtained from sensor.solaredge_m1_ac_power

    - name: "Solar Imported Power W"
      unique_id: solar_imported_power_w
      unit_of_measurement: 'W'
      icon: mdi:transmission-tower-export
      state: >          
        {% if ((states('sensor.solaredge_m1_ac_power') | float(0)) <= 0) %}
          {{((states('sensor.solaredge_m1_ac_power') | float(0)) *-1)}}
        {% else %}
          0
        {% endif %}     

is sensor.solaredge_m1_ac_power the same of sensor.solaredge_ac_power ?

Because I don’t have sensor.solaredge_m1_ac_power sensor…

And I have two batteries, so I suppose that I have to add everywhere the second battery like this:
if ((states('sensor.solaredge_battery1_power') | float(0) + states('sensor.solaredge_battery2_power') | float(0)) < 0)

No they are not the same: the m1 sensor comes from the modbus smart meter which I have attached and reads the import and export Baird work clamp sensors on the main power cables to the grid.

The solaredge_ac_power is basically the value from your inverter; so there about if power you’re inverter delivers to your house.

If you do not have a meter attached to your system, I am not sure how you get the values about import and export, to be honest.

To the batteries…I don’t know the answer, I guess yes, just adding the second battery to all formulas should work, but I have no way of verifying this or saying if it is correct or not, since I do not have this setup. It would therefore be a matter of adapting the formulas too your environment and testing and verifying of the values are correct and make sense.

Solved, I have to add “read meter 1 data”

It seems working…

1 Like