Solaredge Modbus Configuration for Single Inverter and Battery

Or reserve an IP address in your router so it will always get the same through DHCP. (That’s what I did)

Thanks for the advice.
I’ve reinstalled and yes it was quick, easy and no data loss.
Just thought there might be a way to change the ip in the integration.
Unfortunately I can’t reserve ip’s as I’m using a starlink router. No functionality at all.

If possible to easy access the router, your method is even a better and more solid way to set the fixed IP-address.

Hi everyone. I was also able to connect HA to mysoladge inverter with Modbus. Now I see 3 Devices and 107 Entities. (Inverter + Battery + import export meter) but to have data such as today’s solar production, today’s consumption, etc., do they have to be calculated?Because I don’t see them

What values did you enter in when configuring the dashboard?
Did you create the energy. yaml file and include it in the configuration.yaml ?
This is where the sensor values come from for the Tesla style card.
If you are not using that card for display you can add the solaredge integration and use the sensors that derive their data from the solaredge api .
That’s how I understand it but I’ve only just started with this.

hello everyone, I managed to configure the integration and I see the dashboard correctly! I have only one doubt: why does the Solaredge site show me “today’s production” = 2.39 kW and instead on the dashboard “produced” = 5.024 kW?


Did you try to refresh the SolarEdge monitoring platform by F5 (windows) / cmd + R (mac)? I’ve set an auto refresh extension in Firefox web browser to refresh the page every 60 seconds, because I keep a few windows open all the time.

Also keep in mind that a time sync differences may be present between the HA dashboard and the SolarEdge monitoring platform.

yes the data is updated… it doesn’t go back to the home assistant


The reason is that solaredge monitoring doesn’t count charging of the battery as production. When the battery discharges it will increase production.
I found this illogical so I changed it in my configuration. That is why you see the difference.

ok I understand… but it seems absurd to me that this is the case! even if 6Kw products seem like a lot to me

So…

This difference is because of time. The “produced” entity is updated based on your refresh interval you defined when setting up the integration. The value Inn the graph is only updated every hour, so there may be a difference at certain times, at the end of the day they should be equal.


The difference between Solaredge produced value and mine is, as I explained, the charging is the battery. I do not know how big your battery is, but in the screenshot it is charged to 38%. If I assume that the battery started at 10%, you have charged 28%. The difference between Solaredge and my config is roughly 2kWh in the pictures, so that would mean you probably have a 10kWh battery.

In the evening you will see the solaredge production value increase when it is using power from your battery. In my config the production does not increase when using the battery. But… At the end of the day it equals out. I just like to see the reporting different a s how solaredge does it.

I hope this explains it. If not… Ask away…:stuck_out_tongue_winking_eye:

ok all clear thanks! Could you explain to me instead what is meant by Solar Battery Effectiveness Int and Solar Inverter Effectiveness Int ?

I noticed that the battery output is lower as the battery input because of how batteries work. I figured out a way to calculate these losses and use the effectiveness value in the reporting. The same is valid for the inverter, the AC output is lower as the DC side of things. So I calculate these values to get a more accurate reporting.

I was actually pretty surprised of how big the losses are in the battery. It also depends on the state of charge from the battery.

Again solaredge does not report this, I guess because most people do not want to see these effects, so that is why there are some differences between Solaredge and my configuration.

My bad, to refresh the HA dashboard to go to another tab [Overview] and then switch back to the energy dashboard. Refreshing the browser needs a new login. Apologies.

Hi Remko,

Thanks for your package!
I made some changes when charging the battery from solar and grid:

  • Solar Panel To House W: This change removes the - value on solar panel when charging from grid
  • Solar Panel To Battery W: Because we can charge from grid and solar the solar power needs to move here.
  • Solar Grid To House W: Charging the battery from the grid is not considered house consumption
  • Solar Grid To Battery W: Charging the battery can be a combination of grid and solar.

I’m still testing this, probably not all cases are covered.

Hope this helps,
Tim

      - name: "Solar Panel To House W"
        unique_id: solar_panel_to_house_w
        unit_of_measurement: "W"
        icon: mdi:solar-power
        state: >
          {% set i1_dc_power = states('sensor.solaredge_i1_dc_power') | float(0) %}
          {% set i1_ac_power = states('sensor.solaredge_i1_ac_power') | float(0) %}
          {% set b1_dc_power = states('sensor.solaredge_b1_dc_power') | float(0) %}
          {% set m1_ac_power = states('sensor.solaredge_m1_ac_power') | float(0) %}
          {% set inverter_effectiveness = states('sensor.solar_inverter_effectiveness') | float(0) %}

          {% if (b1_dc_power >= 0 and m1_ac_power > 0) %}
            {% if (i1_dc_power < 0 and i1_ac_power <= 0) %}
              {{ (i1_dc_power - m1_ac_power) }}
            {% else %}
              {{ (i1_ac_power - m1_ac_power) }}
            {% endif %}
          {% elif (b1_dc_power >= 0 and m1_ac_power <= 0) %}
            {% if (i1_dc_power < 0 and i1_ac_power <= 0) %}
              0{#{{ (i1_dc_power) }}#}{# Added 0 #}
            {% else %}
              {{ (i1_ac_power) }}
            {% endif %}
          {% elif (b1_dc_power < 0) %}
            {% if (i1_dc_power + b1_dc_power < 0) %}
              0
            {% else %}
              {{ ((i1_dc_power + b1_dc_power) * inverter_effectiveness) }}
            {% endif %}   
          {% else %}
            0
          {% endif %}
        availability: >
          {{ states('sensor.solaredge_i1_dc_power') | is_number and states('sensor.solaredge_i1_ac_power') | is_number and states('sensor.solaredge_b1_dc_power') | is_number and states('sensor.solaredge_m1_ac_power') | is_number }}

      - name: "Solar Panel To Battery W"
        unique_id: solar_panel_to_battery_w
        unit_of_measurement: "W"
        icon: mdi:solar-power
        state: >
          {% set i1_dc_power = states('sensor.solaredge_i1_dc_power') | float(0) %}
          {% set i1_ac_power = states('sensor.solaredge_i1_ac_power') | float(0) %}
          {% set b1_dc_power = states('sensor.solaredge_b1_dc_power') | float(0) %}
          {% set grid_to_battery_w = states('sensor.solar_grid_to_battery_w') | float(0) %}

          {% if (b1_dc_power > 0) %}
            {% if (grid_to_battery_w > 0) %} {# Added this snippet instead of 0 #}
              {% if (i1_dc_power < 0 and i1_ac_power <= 0) %}
                {{ (b1_dc_power+i1_dc_power) }}
              {% else %}
                0
              {% endif %}
            {% else %}
              {{ b1_dc_power }}
            {% endif %} 
          {% else %}
            0
          {% endif %}
        availability: >
          {{ states('sensor.solaredge_b1_dc_power') | is_number }}

      - name: "Solar Grid To House W"
        unique_id: solar_grid_to_house_w
        unit_of_measurement: "W"
        icon: mdi:transmission-tower-export
        state: >
          {% set m1_ac_power = states('sensor.solaredge_m1_ac_power') | float(0) %}
          {% set grid_to_battery_w = states('sensor.solar_grid_to_battery_w') | float(0) %}

          {% if (m1_ac_power <= 0) %}
            {{ (m1_ac_power * -1) - grid_to_battery_w }} {# Added grid_to_battery_w. #}
          {% else %}
            0
          {% endif %}
        availability: >
          {{ states('sensor.solaredge_m1_ac_power') | is_number }}

      - name: "Solar Grid To Battery W"
        unique_id: solar_grid_to_battery_w
        unit_of_measurement: "W"
        icon: mdi:battery-positive
        state: >
          {% set i1_ac_power = states('sensor.solaredge_i1_ac_power') | float(0) %}
          {% set b1_dc_power = states('sensor.solaredge_b1_dc_power') | float(0) %}
          {% set i1_dc_power = states('sensor.solaredge_i1_dc_power') | float(0) %}

          {% if (i1_ac_power <= -25 and b1_dc_power > 0) %} {#added -25 instead of 0#}
            {{ i1_dc_power|abs }} {# Changed to i1_dc_power #}
          {% else %}
            0
          {% endif %}
        availability: >
          {{ states('sensor.solaredge_i1_ac_power') | is_number and states('sensor.solaredge_b1_dc_power') | is_number}}

HA

2 Likes

Very cool, nice work!!! I will use this is a well and do some testing. If it all works fine for me too, I will update the first post with your modifications. Very nice to see you dug into this issue!

I think I’m having an issue with imported power and I can’t seem to figure it out. I can see right now that my total power in to the house is 1 kW, and the panels are providing only 0.2 kW and we’re using 0.8 from the grid.

I would assume the 0.8 kW would be classified as imported? However the solar_imported_power_kwh sensor is showing 0. Any thoughts?

You do need to delete and re-add the integration to change the IP address. Home Assistant (at this time) actually does not provide a way to edit or update configuration entries after the fact.

It’s a known limitation that is still open. Here’s the link to the issue in HA architecture: Ability to edit/update config entries · Issue #377 · home-assistant/architecture · GitHub

EDIT: If the IP address or other configuration settings change which causes communication to be lost, the integration will now raise a Repair Issue that lets you update them.

@Remko suddenly this card stopped working (I didn’t change anything) why?

Hi, new to HA and this mod, but been working my way through it, and thanks go to @WillCodeForCats and @Remko for all their hard work.

Got it nearly all working but hitting the following issues:

When loading for the first time it tries to show the following and then errors:

  • Import Costs
  • Export Compensation
  • Cost Saving

Showing this:

Could anyone advise?

PS I’m also tryig to change the currency from EURO to GBP