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

To elaborate the sensors come from the modbus integration
sensor.solaredge_b1_dc_power: this is the power (DC) being outputted by the battery
sensor.solaredge_i1_dc_power: this is the power (DC) being outputted by the inverter

So a simple calculation: 1 - (battery power - inverter power / battery power) gives me the percentage of the power being lost there. The same kind of thing is what I do with the inverter, the only difference is I compare DC power vs AC power, so…what is lost in conversion.

To your battery…yes, this is what I see as well. The sensor which I use (battery output) is not used directly by the solaredge portal. Solaredge wisely chooses to ignore this and only report what is actually consumed by the house so ignoring all the losses in between. So tha fact that you charge more as you use is made visible with my configuration, whereas Solaredge chooses to not show this to their customers. Which I fully understand because 95 % of them would never get it and would start asking difficult questions…:wink:

Did a bit of research,
I‘m not familiar with the effectiveness sensors yet, but found the reason why „Solar Battery Out“ is that low (too low) at the energy dashboard:

You multiplied sensor.solaredge_battery1_power with the i+b effectivenesses. Maybe for the tesla style card?

    - name: "Solar Battery To House W"
      unique_id: solar_battery_to_house_w
      unit_of_measurement: 'W'
      icon: mdi:battery-negative
      state: >   
        {% if ((states('sensor.solaredge_battery1_power') | float(0)) < 0) %}
          {{((states('sensor.solaredge_battery1_power') | float(0)) * -1) * (states('sensor.solar_battery_effectiveness')| float(0)) * (states('sensor.solar_inverter_effectiveness')| float(0))}}
        {% else %}
          0
        {% endif %} 

At the sensor section that sensor is used further:

  - platform: integration
    source: sensor.solar_battery_to_house_w
    method: left
    unit_prefix: k
    name: solar_battery_out_kwh 

and following on the ulility meter „Solar Battery Out“. That means, for my understanding, the utility meter has the doubled impact of the multiplied effectivenesses. sensor.solaredge_battery1_power should give the effectiveness of the metered readings between „Solar Battery In“ and „Solar Battery Out“ by itself.

Maybe you could read the battery effectiveness every midnight by 1-(„Solar Battery Out“/„Solar Battery In“…) after fixing it?

What do you think about?

The Inverter Consumption only shows up when there is no Solar Power. Then the Inverter DC Power drops below 0 and stays at about -70 Watts till Solar power kicks back in around sunrise. (Only if you draw power from the battery of course. Otherwise the Inverter shuts off.)

1 Like

For everyone who has a 2 Inverter 1 Battery setup: I modified the »energy.yaml« to fit those needs.

First of all you’ll need to use the SolarEdge Modbus Multi Device Integration: https://github.com/WillCodeForCats/solaredge-modbus-multi

Make sure it’s set up correctly. I had to fix the Modbus ID on the secondary inverter!

And that’s the corresponding »energy.yaml«

template:
  - sensor:
    - name: "Solar Selfconsumption Ratio"
      unique_id: solar_selfconsumption_ratio
      icon: mdi:percent-outline
      state: >
        {% if ((states('sensor.solar_panel_to_house_daily') | float(0) + states('sensor.solar_battery_in_daily') | float(0) + states('sensor.solar_exported_power_daiy') | float(0)) <= 0) %}
          0
        {% else %}
          {{ ((states('sensor.solar_panel_to_house_daily') | float(0) + states('sensor.solar_battery_in_daily') | float(0)) / (states('sensor.solar_panel_to_house_daily') | float(0) + states('sensor.solar_battery_in_daily') | float(0) + states('sensor.solar_exported_power_daily') | float(0)) * 100) | round (0) }}
        {% endif %}

    - name: "Solar Autarkie Ratio"
      unique_id: solar_autarkie_ratio
      icon: mdi:percent-outline
      state: >
        {% if ((states('sensor.solar_house_consumption_daily') | float(0)) <= 0) %}
          0
        {% else %}
          {{ (1 - ((states('sensor.solar_imported_power_daily') | float(0)) / (states('sensor.solar_house_consumption_daily') | float(0))) * 100) | round (0) }}
        {% endif %}  
    
    - name: "Solar Inverter Effectiveness"
      unique_id: solar_inverter_effectiveness
      icon: mdi:percent-outline
      unit_of_measurement: '%'
      state: >
        {% if ((states('sensor.solaredge_i1_dc_power') | float(0) + states('sensor.solaredge_i2_dc_power') | float(0)) < 100 or (states('sensor.solaredge_i1_ac_power') | float(0) + states('sensor.solaredge_i2_ac_power') | float(0)) < 100) %}
          {{ (states('sensor.solar_inverter_effectiveness')) }}
        {% else %}
          {% if (is_state('sensor.solar_inverter_effectiveness', 'unknown')) %}
            1
          {% elif (states('sensor.solaredge_i1_ac_power') | float(0) + states('sensor.solaredge_i2_ac_power') | float(0) <= 0) %}
            {{ (states('sensor.solar_inverter_effectiveness')) }}
          {% elif (states('sensor.solaredge_i1_dc_power') | float(0) + states('sensor.solaredge_i2_dc_power') | float(0) <= 0) %}
            {{ (states('sensor.solar_inverter_effectiveness')) }}
          {% else %}
            {{ (states('sensor.solaredge_i1_ac_power') | float(0) + states('sensor.solaredge_i2_ac_power') | float(0)) / (states('sensor.solaredge_i1_dc_power') | float(0) + states('sensor.solaredge_i2_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_i1_dc_power') | float(0) + states('sensor.solaredge_i2_dc_power') | float(0) + states('sensor.solaredge_b1_dc_power') | float(0) <= 0) %}
          {% if (states('sensor.solaredge_b1_dc_power') | float(0) >= 0) %}
            {{ (states('sensor.solar_battery_effectiveness')) }}
          {% elif (states('sensor.solaredge_i1_dc_power') | float(0) + states('sensor.solaredge_i2_dc_power') | float(0) <= 0) %}
            {{ (states('sensor.solar_battery_effectiveness')) }}
          {% else %}
            {{ (1 - (((states('sensor.solaredge_b1_dc_power') | float(0)) * -1 - (states('sensor.solaredge_i1_dc_power') | float(0) + states('sensor.solaredge_i2_dc_power') | float(0))) / (states('sensor.solaredge_b1_dc_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 %}

    - name: "Solar Panel Production W"
      unique_id: solar_panel_production_w
      unit_of_measurement: 'W'
      icon: mdi:solar-power
      state: >
        {% if (states('sensor.solaredge_i1_dc_power') | float(0) + states('sensor.solaredge_i2_dc_power') | float(0) + states('sensor.solaredge_b1_dc_power') | float(0) <= 0) %}
          0
        {% elif (is_state('sensor.solaredge_i1_dc_power', 'unknown') or is_state('sensor.solaredge_i2_dc_power', 'unknown') or is_state('sensor.solaredge_b1_dc_power', 'unknown')) %}
          0
        {% else %}
          {{ (states('sensor.solaredge_i1_dc_power') | float(0) + states('sensor.solaredge_i2_dc_power') | float(0) + states('sensor.solaredge_b1_dc_power') | float(0)) }}
        {% endif %}      

    - 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_b1_dc_power') | float(0) >= 0 and states('sensor.solaredge_m1_ac_power') | float(0) > 0) %}
          {% if (states('sensor.solaredge_i1_dc_power') | float(0) < 0 and states('sensor.solaredge_i1_ac_power') | float(0) <= 0) %}
            {{ (states('sensor.solaredge_i1_dc_power') | float(0) + states('sensor.solaredge_i2_ac_power') | float(0) - states('sensor.solaredge_m1_ac_power') | float(0)) }}
          {% else %}
            {{ (states('sensor.solaredge_i1_ac_power') | float(0) + states('sensor.solaredge_i2_ac_power') | float(0) - states('sensor.solaredge_m1_ac_power') | float(0)) }}
          {% endif %}
        {% elif (states('sensor.solaredge_b1_dc_power') | float(0) >= 0 and states('sensor.solaredge_m1_ac_power') | float(0) < 0) %}
          {{ (states('sensor.solaredge_i1_ac_power') | float(0) + states('sensor.solaredge_i2_ac_power') | float(0)) }}
        {% elif (states('sensor.solaredge_b1_dc_power') | float(0) < 0) %}
          {% if (states('sensor.solaredge_i1_dc_power') | float(0) + states('sensor.solaredge_i2_dc_power') | float(0) + states('sensor.solaredge_b1_dc_power') | float(0) < 0) %}
            0
          {% else %}
            {{ ((states('sensor.solaredge_i1_dc_power') | float(0) + states('sensor.solaredge_i2_dc_power') | float(0) + states('sensor.solaredge_b1_dc_power') | float(0)) * states('sensor.solar_inverter_effectiveness') | float(0)) }}
          {% endif %}   
        {% else %}
          0
        {% endif %}
 
    - name: "Solar Grid To House W"
      unique_id: solar_grid_to_house_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 %}

    - name: "Solar Panel To Grid W"
      unique_id: solar_panel_to_grid_w
      unit_of_measurement: 'W'
      icon: mdi:solar-power
      state: >
        {% if (states('sensor.solaredge_m1_ac_power') | float(0) > 0) %}
          {{ (states('sensor.solaredge_m1_ac_power') | float(0)) }}
        {% else %}
          0
        {% endif %}

    - name: "Solar Battery To House W"
      unique_id: solar_battery_to_house_w
      unit_of_measurement: 'W'
      icon: mdi:battery-negative
      state: >
        {% if (states('sensor.solaredge_b1_dc_power') | float(0) < 0) %}
          {{ (states('sensor.solaredge_b1_dc_power') | float(0) * -1 * states('sensor.solar_battery_effectiveness') | float(0) * states('sensor.solar_inverter_effectiveness') | float(0)) }}
        {% else %}
          0
        {% endif %}

    - name: "Solar Panel To Battery W"
      unique_id: solar_panel_to_battery_w
      unit_of_measurement: 'W'
      icon: mdi:solar-power
      state: >
        {% if (states('sensor.solaredge_b1_dc_power') | float(0) > 0) %}
          {% if (states('sensor.solar_grid_to_battery_w') | float(0) > 0) %}
            0
          {% else %}
            {{ (states('sensor.solaredge_b1_dc_power') | float(0)) }}
          {% endif %} 
        {% else %}
          0
        {% endif %}
 
    - name: "Solar Grid To Battery W"
      unique_id: solar_grid_to_battery_w
      unit_of_measurement: 'W'
      icon: mdi:battery-positive
      state: >
        {% if (is_state('sensor.solaredge_ac_power', '0') and states('sensor.solaredge_b1_dc_power') | float(0) > 0) %}
          {{ (states('sensor.solaredge_b1_dc_power') | float(0)) }}
        {% else %}
          0
        {% endif %}

    - name: "Solar Battery In W"
      unique_id: solar_battery_in_w
      unit_of_measurement: 'W'
      icon: mdi:battery-positive
      state: >
        {{ (states('sensor.solar_grid_to_battery_w') | float(0) + states('sensor.solar_panel_to_battery_w') | float(0)) }}  

    - name: "Solar House Consumption W"
      unique_id: solar_house_consumption_w
      unit_of_measurement: 'W'
      icon: mdi:home
      state: >
        {{ (states('sensor.solar_panel_to_house_w') | float(0) + states('sensor.solar_battery_to_house_w') | float(0) + states('sensor.solar_grid_to_house_w') | float(0)) }}  

    - 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 %}       

    - name: "Solar Exported Power W"
      unique_id: solar_exported_power_w
      unit_of_measurement: 'W'
      icon: mdi:transmission-tower-import
      state: >
        {% if (states('sensor.solaredge_m1_ac_power') | float(0) > 0) %}
          {{ (states('sensor.solaredge_m1_ac_power') | float(0)) }}
        {% else %}
          0
        {% endif %}        

    - name: "Solar Lifetime Production"
      unique_id: solar_lifetime_production
      unit_of_measurement: 'MWh'
      icon: mdi:solar-power
      state: >
        {{ ((states('sensor.solaredge_ac_energy_kwh') | float(0) / 1000) | round (2)) }}
                 
sensor:
  - platform: integration
    source: sensor.solar_panel_production_w
    method: left
    unit_prefix: k
    name: solar_panel_production_kwh 
  - platform: integration
    source: sensor.solar_battery_to_house_w
    method: left
    unit_prefix: k
    name: solar_battery_out_kwh 
  - platform: integration
    source: sensor.solar_battery_in_w
    method: left
    unit_prefix: k
    name: solar_battery_in_kwh 
  - platform: integration
    source: sensor.solar_house_consumption_w
    method: left
    unit_prefix: k
    name: solar_house_consumption_kwh 
  - platform: integration
    source: sensor.solar_imported_power_w
    method: left
    unit_prefix: k
    name: solar_imported_power_kwh 
  - platform: integration
    source: sensor.solar_exported_power_w
    method: left
    unit_prefix: k
    name: solar_exported_power_kwh 
  - platform: integration
    source: sensor.solar_panel_to_house_w
    method: left
    unit_prefix: k
    name: solar_panel_to_house_kwh

  - platform: statistics
    name: "Solar Battery Effectiveness Average"
    unique_id: solar_battery_effectiveness_average
    state_characteristic: mean
    sampling_size: 1200
    max_age:
      hours: 24
    entity_id: sensor.solar_battery_effectiveness

  - platform: statistics
    name: "Solar Inverter Effectiveness Average"
    unique_id: solar_inverter_effectiveness_average
    state_characteristic: mean
    sampling_size: 1200
    max_age:
      hours: 24
    entity_id: sensor.solar_inverter_effectiveness

    
utility_meter:
  solar_panel_production_daily:
    source: sensor.solar_panel_production_kwh
    name: Solar Panel Production Daily
    cycle: daily
  solar_battery_in_daily:
    source: sensor.solar_battery_in_kwh
    name: Solar Battery In Daily
    cycle: daily 
  solar_battery_out_daily:
    source: sensor.solar_battery_out_kwh
    name: Solar Battery Out Daily
    cycle: daily
  solar_house_consumption_daily:
    source: sensor.solar_house_consumption_kwh
    name: Solar House Consumption Daily
    cycle: daily 
  solar_imported_power_daily:
    source: sensor.solar_imported_power_kwh
    name: Solar Imported Power Daily
    cycle: daily 
  solar_imported_power_daily_solaredge:
    source: sensor.solaredge_m1_imported_kwh
    name: Solar Imported Power Daily Solar Edge
    cycle: daily 
  solar_exported_power_daily:
    source: sensor.solar_exported_power_kwh
    name: Solar Exported Power Daily
    cycle: daily
  solar_panel_to_house_daily:
    source: sensor.solar_panel_to_house_kwh
    name: Solar Panel To House Daily
    cycle: daily

  solar_panel_to_house_weekly:
    source: sensor.solar_panel_to_house_kwh
    name: Solar Panel To House Weekly
    cycle: weekly
  solar_imported_power_weekly:
    source: sensor.solar_imported_power_kwh
    name: Solar Imported Power Weekly
    cycle: weekly 
  solar_house_consumption_weekly:
    source: sensor.solar_house_consumption_kwh
    name: Solar House Consumption Weekly
    cycle: weekly 
  solar_panel_production_weekly:
    source: sensor.solar_panel_production_kwh
    name: Solar Panel Production Weekly
    cycle: weekly
  solar_battery_in_weekly:
    source: sensor.solar_battery_in_kwh
    name: Solar Battery In Weekly
    cycle: weekly 
  solar_battery_out_weekly:
    source: sensor.solar_battery_out_kwh
    name: Solar Battery Out Weekly
    cycle: weekly
  solar_exported_power_weekly:
    source: sensor.solar_exported_power_kwh
    name: Solar Exported Power Weekly
    cycle: weekly
    
  solar_panel_to_house_monthly:
    source: sensor.solar_panel_to_house_kwh
    name: Solar Panel To House Monthly
    cycle: monthly
  solar_imported_power_monthly:
    source: sensor.solar_imported_power_kwh
    name: Solar Imported Power Monthly
    cycle: monthly 
  solar_house_consumption_monthly:
    source: sensor.solar_house_consumption_kwh
    name: Solar House Consumption Monthly
    cycle: monthly 
  solar_panel_production_monthly:
    source: sensor.solar_panel_production_kwh
    name: Solar Panel Production Monthly
    cycle: monthly
  solar_battery_in_monthly:
    source: sensor.solar_battery_in_kwh
    name: Solar Battery In Monthly
    cycle: monthly 
  solar_battery_out_monthly:
    source: sensor.solar_battery_out_kwh
    name: Solar Battery Out Monthly
    cycle: monthly
  solar_exported_power_monthly:
    source: sensor.solar_exported_power_kwh
    name: Solar Exported Power Monthly
    cycle: monthly
    
  solar_panel_to_house_yearly:
    source: sensor.solar_panel_to_house_kwh
    name: Solar Panel To House Yearly
    cycle: yearly
  solar_imported_power_yearly:
    source: sensor.solar_imported_power_kwh
    name: Solar Imported Power Yearly
    cycle: yearly 
  solar_house_consumption_yearly:
    source: sensor.solar_house_consumption_kwh
    name: Solar House Consumption Yearly
    cycle: yearly 
  solar_panel_production_yearly:
    source: sensor.solar_panel_production_kwh
    name: Solar Panel Production Yearly
    cycle: yearly
  solar_battery_in_yearly:
    source: sensor.solar_battery_in_kwh
    name: Solar Battery In Yearly
    cycle: yearly 
  solar_battery_out_yearly:
    source: sensor.solar_battery_out_kwh
    name: Solar Battery Out Yearly
    cycle: yearly
  solar_exported_power_yearly:
    source: sensor.solar_exported_power_kwh
    name: Solar Exported Power Yearly
    cycle: yearly

In this setup you also have to change the configuration of the »Tesla style solar power card«

battery_extra_entity: sensor.solaredge_b1_state_of_energy

–––

UPDATE: I ran into an issue while the battery is charging! When battery charging power exceeds what the hybrid inverter delivers (which may occur since also the secondary inverter power is used for battery charging) i1_ac_power stays 0 while i1_dc_power may drop significantly below 0. Therefore I had to modify the solar_panel_to_house_w value while battery is charging and i1_dc_power is blow 0.

Here is the section I modified which I also integrated in the code you find above.

    - 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_b1_dc_power') | float(0) >= 0 and states('sensor.solaredge_m1_ac_power') | float(0) > 0) %}
          {% if (states('sensor.solaredge_i1_dc_power') | float(0) < 0 and states('sensor.solaredge_i1_ac_power') | float(0) <= 0) %}
            {{ (states('sensor.solaredge_i1_dc_power') | float(0) + states('sensor.solaredge_i2_ac_power') | float(0) - states('sensor.solaredge_m1_ac_power') | float(0)) }}
          {% else %}
            {{ (states('sensor.solaredge_i1_ac_power') | float(0) + states('sensor.solaredge_i2_ac_power') | float(0) - states('sensor.solaredge_m1_ac_power') | float(0)) }}
          {% endif %}
        {% elif (states('sensor.solaredge_b1_dc_power') | float(0) >= 0 and states('sensor.solaredge_m1_ac_power') | float(0) < 0) %}
          {{ (states('sensor.solaredge_i1_ac_power') | float(0) + states('sensor.solaredge_i2_ac_power') | float(0)) }}
        {% elif (states('sensor.solaredge_b1_dc_power') | float(0) < 0) %}
          {% if (states('sensor.solaredge_i1_dc_power') | float(0) + states('sensor.solaredge_i2_dc_power') | float(0) + states('sensor.solaredge_b1_dc_power') | float(0) < 0) %}
            0
          {% else %}
            {{ ((states('sensor.solaredge_i1_dc_power') | float(0) + states('sensor.solaredge_i2_dc_power') | float(0) + states('sensor.solaredge_b1_dc_power') | float(0)) * states('sensor.solar_inverter_effectiveness') | float(0)) }}
          {% endif %}   
        {% else %}
          0
        {% endif %}

This feels ‘a bit dirty’, so maybe someone of you has a better solution in this 2 inverter scenario?

1 Like

Hey @Remko,

I appreciate your great work and thanks for sharing!

Watching my new Solar-Card at night showed a little inconsistency: All exported energy is condensed to »Solar Panel To Grid W«, although Energy at night is exported by the battery. Slight energy imports and exports result from the inertia of the battery management system, that won’t adapt to quick changes in energy consumption fast enough.

Maybe this should be devided into »Solar Panel to Grid W« and »Solar Battery to Grid W«? What do you think?

Have a great day!
Björn

Exporting energy from your battery?? That is a use case I have not considered in my configuration. I never export any energy from my battery to my grid.

I would need to understand that better and it actually may be quite a puzzle of doing that. Maybe you can add some screenshots with what you are seeing and what you expect to see…

As you can See in the screenshot, Panel Production is 0, but due to your Panel to Grid calculation Panel to Grid shows 16W.
I agree that battery to grid is an »unwanted« state, but it occurs ever so slightly due to battery management inertia. So for example when you use your toaster or oven, there is an instant need for 1 or 2 kW or so. Battery management adapts to that need, but for a few seconds you will draw energy from the grid. The other way around: When your toast is done, the toaster shuts off and there is an instant excess of the no more needed energy. And until the battery management adopts to the changed need for energy, that excess-energy will be exported to the grid. So there is your battery to grid situation that occurs all the time – at least seen with short polling intervals.

What I would expect to see: an energy flow from the battery to the grid… or from the house to the grid, since it’s excess power not consumed by the household.

Your graph looks strange to me. Have you configured all the options for that? For me it always shows all the lines between the different entities, also a Grid to Batery (which can be negative of course).

But…to the actual problem. I understand what you are saying and I agree that it is not flawless. I do see these small effects too, but have chosen to ignore them. The reason is that these fluctuations are very small and in my mind do not have a big impact on the overall situation.
The other issue we are seeing I guess, is the delay in reporting through the modbus. I have my polling interval set to 3 seconds, but the fluctuations can occur in a much shorter timeframe of course. The only way to visualise it 100% correct is if we would have instant values. The question here…what is instant?
I also agree with the battery management inertia…I do see some of those effects too, but honestly do not know how to get it more accurate without using actual instant values, which I think are not available or…if they were available…they would probably overload HASS with data.

I am not saying my configuration is 100% correct, but I also do not know how to improve this further. I think the calculations which are done in the template sensors are correct, but due to the inertia and minor fluctuations I do not know what else I can do. If anyone else sees these effects and has ideas to optimise this further…please contribute here…

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.