SolarEdge and HA

Gey Guys, I just started to play with HA and my first project is to implement my SolarEdge PV system. So far I have installed the packege:

and have it now running. But what I’m not able to figure out the proper sensors for current running production, usage in home. The batterie part is pretty clear but all others are really hard to find. Can anyone help me to identify the sensors? Many thanks

Hi @homermg

I also use this integration and found some of your required sensors in this Post: UPDATED! SolarEdge Modbus full setup guide with Energy Dashboard integration for Installations with Battery connected - #306 by SgtBatten
I got also some inspiration for my own energy dashbaord.
Maybe it helps.

Thanks @tomra ,

as I’m a beginner, can you help me to identify the location of the confine file where all this entries from the energy board are? It least I can’t see the entries here: /homeassistant/configuration.yaml

No problem. I had to go through all of this as well :smiley:

Did you already add your solaredge equipment in the integration section?
I add at first the repo for solaredge inverter. Restarted my HA setup → went to the section “Devices & services” → Add integration → Select and Configure “SolarEdge Modbus Multi” integration.
After the connection to your inverter is established you will see some entities in the integration section.
Are you already at that point?

yes that part is already done :slight_smile: I have everything in my HA and I see also the entities but I can’t find the correct one and build the Energa dashboard correct. Please see the screenshots


Ah nice so you got already the metrics. In this post there are some template sensors which I use in my setup: UPDATED! SolarEdge Modbus full setup guide with Energy Dashboard integration for Installations with Battery connected - #306 by SgtBatten

    - name: "Solar Panel Production W"
      unique_id: solar_panel_production_w
      unit_of_measurement: "W"
      icon: mdi:solar-power
      state: >
        {% set i1_dc_power = states('sensor.solaredge_i1_dc_power') | float(0) %}
        {% set b1_dc_power = states('sensor.solaredge_b1_dc_power') | float(0) %}

        {% if (is_state('sensor.solaredge_i1_dc_power', 'unknown') or is_state('sensor.solaredge_b1_dc_power', 'unknown')) %}
          0
        {% elif (i1_dc_power + b1_dc_power <= 0) %}
          0
        {% else %}
          {{ (i1_dc_power + b1_dc_power) }}
        {% 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 }}

This is just a example for my solaredge production. There are also some other sensors which are built from the solaredge metrics from the integration like the ones: “solar_panel_to_house” or “solar_panel_to_battery”.

I hope this helps.

cool got it, but where to find the source file to edit that more in detail? Looks like this entries are not in the yaml .

Thanks

I use in my setup an other directory to put the config files in and load this config files over the configuration.yaml

My directory is packages where my electricity config files are in e.g. electricity.yaml
This config files are included by the entry in the configuration.yaml file. See below:

homeassistant:
  packages: !include_dir_named packages

My electricity.yaml include all entities belonging to the solaredge and electricity part.

template:
  - sensor:
    - name: "Solar Panel Production W"
      unique_id: solar_panel_production_w
      unit_of_measurement: "W"
      icon: mdi:solar-power
      state: >
        {% set i1_dc_power = states('sensor.solaredge_i1_dc_power') | float(0) %}
        {% set b1_dc_power = states('sensor.solaredge_b1_dc_power') | float(0) %}

        {% if (is_state('sensor.solaredge_i1_dc_power', 'unknown') or is_state('sensor.solaredge_b1_dc_power', 'unknown')) %}
          0
        {% elif (i1_dc_power + b1_dc_power <= 0) %}
          0
        {% else %}
          {{ (i1_dc_power + b1_dc_power) }}
        {% 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 }}

    - 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
      ...

So at the end I read the linked thread and picked all sensors I need in this file. That is how I got the sensors.

Maybe you can explain what do you want to achieve with your setup and I will see how I can help.

And you need some sensor and utility_meter to use in your energy dashboard.

Sensors:

sensor:
  # Panels
  - platform: integration
    source: sensor.solar_panel_production_w
    method: left
    unit_prefix: k
    name: solar_panel_production_kwh
  - platform: integration
    source: sensor.solar_panel_to_house_w
    method: left
    unit_prefix: k
    name: solar_panel_to_house_kwh
  - platform: integration
    source: sensor.solar_panel_to_battery_w
    method: left
    unit_prefix: k
    name: solar_panel_to_battery_kwh

Utility_meters

utility_meter:
# Electricity PV Panels
  solar_panel_to_house_daily:
    source: sensor.solar_panel_to_house_kwh
    name: Solar Panel To House Daily
    cycle: daily
  solar_panel_production_daily:
    source: sensor.solar_panel_production_kwh
    name: Solar Panel Production Daily
    cycle: daily

# Electricity Grid
  solar_imported_power_daily_solaredge:
    source: sensor.solaredge_m1_imported_kwh
    name: Solar Imported Power Daily Solar Edge
    cycle: daily

  solar_imported_power_daily:
    source: sensor.solar_imported_power_kwh
    name: Solar Imported Power Daily
    cycle: daily

# Electricity Battery
  solar_battery_from_grid_daily:
    source: sensor.solar_grid_to_battery_kwh
    name: Solar Battery Imported Daily
    cycle: daily

  solar_battery_from_panels_daily:
    source: sensor.solar_panel_to_battery_kwh
    name: Solar Battery Generated 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

# Electricity Export
  solar_exported_power_daily:
    source: sensor.solar_exported_power_kwh
    name: Solar Exported Power Daily
    cycle: daily

# Consumption
  solar_house_consumption_daily:
    source: sensor.solar_house_consumption_kwh
    name: Solar House Consumption Daily
    cycle: daily

So this are some of my electricity configs. Hope you get the idea behind.

ok got it :slight_smile:
but still have issues to identification where all the SolarEdge sensors are configured:
This is my yaml and I see no entry for any sensors config file:


but as I have the sensors in my HA, it must be a config file somewhere?
Thanks for you help

Ahh now I understand your problem with the SA sensors. you do not have any config file for the solaredge sensors so far. It is done by the integration you use in HA. It is all managed by this integration. To change something at the sensors you have to check out the source code of the project repository. For example this is the link to a sensors file: solaredge-modbus-multi/custom_components/solaredge_modbus_multi/sensor.py at 654ac789bc0953e31ae6070165b618b0cba0564a · WillCodeForCats/solaredge-modbus-multi · GitHub

found it :slight_smile:


will try now
thanks