HA integration for Shelly em3

I also interested in the total power consumed/generated, because I want to switch appliances when I am generaring excess power. I am using Shelly EM3 which provides metering for each phase separately. Does anyone know how to make a custom sensor in HA for the total power?

Hi Rob,

You only need a template which summed totals from the three phases.

- platform: template
    sensors:
      consumption_total:
        friendly_name: 'consumption total'
        unit_of_measurement: "W"
        value_template: >-
          {{ (states('sensor.shellyem3_xyz_channel_a_power')|float + states('sensor.shellyem3_xyz_channel_b_power')|float + states('sensor.shellyem3_xyz_channel_c_power')|float)|round(0) }}

Thanks. I will dive into that.