Aggregated sensor for Energy Dashboard

I have Shelly 3EM monitoring my EV charging. That exposes three separate energy sensors. For the Energy Dashboard, I would prefer an aggregated value for all three phases.

I have tried the following, but it never displays any value in the Energy Dashboard:

      - name: "EV Total Energy"
        unique_id: "ev_total_energy_consumed"
        state_class: total_increasing
        device_class: energy
        state: "{{ states('sensor.l1_energy') | float + states('sensor.l2_energy') | float + states('sensor.l3_energy') | float }}"
        unit_of_measurement: "kWh"

Any suggestions?

1 Like

I have the exact same question, but to do with individual sensors on an Enporia Vue Gen 2.

Anyone ??

A bit more digging found this : Aggregate devices for easier energy display

In that one, the person creates a template to merge/sum multiple sensors.

I’ve come up with a slightly better approach using the group sensor. Under sensor: in my configuration I have:

- platform: group
  name: Outside Lights Power
  unique_id: outside_lights_power
  ignore_non_numeric: true
  unit_of_measurement: W
  state_class: measurement
  device_class: power
  type: sum
  entities:
    - sensor.allrum_balcony_switch_power_w
    - sensor.laundry_facade_switch_power_w
    - sensor.entrance_veranda_switch_power_w
    - sensor.dining_room_flood_switch_power_w
    - sensor.deck_flood_switch_power_w
    - sensor.covered_deck_light_switch_power_w
    - sensor.laundry_driveway_switch_power_w
    - sensor.outdoor_plug_balcony_power_w
    - sensor.forest_lights_w
    - sensor.deck_lights_w
    - sensor.outdoor_plug_front_power_w
1 Like

There does appear to be a way to do it just with the UI and no yaml at all

  • Use Helpers to do the Sum of multiple entities
  • Settings => Devices & Services => Helpers
  • then “+ Create Helper” and choose “Combine the state of several sensors”
  • Select the entities and the choose SUM and then add them to the Area e.g. Coolers

Worked a charm, I did the same and it created the sensor. Thanks !

sensor:
  - platform: group
    name: "Cooler_W_perMin"
    unique_id: Cooler_W_perMin
    ignore_non_numeric: true
    unit_of_measurement: W
    state_class: measurement
    device_class: power
    type: sum
    entities:
      - sensor.cooler_1_4_1min
      - sensor.cooler_2_5_1min
      - sensor.cooler_3_6_1min