Sum/Group of energy sensors

I have a lot of single sensors with energy and total increasing. However, it is too confusing to display each individual sensor in the Energy Dashboard. For this reason I would like to summarize all sensors in the Energy Dashboard and thought I would make a new sensor with type sum:

platform: group
type: sum
state_class: total_increasing
unit_of_measurement: kWh
device_class: energy
entities:

Is this correct or am I getting incorrect values?

this is how I did it.


  - platform: group
    name: vpwSuit1kw
    unique_id: sensor.vpwsuit1kw
    type: sum
    ignore_non_numeric: true
    unit_of_measurement: kWh
    device_class: energy
    state_class: total
    entities:
      - sensor.pwmoniterlightkw
      - sensor.pwsuit1dimmerkw
      - sensor.pwsuit1nightstandkw
      - sensor.pwsuit1bathdimmerkw
      - sensor.computersw_energy
1 Like

I use this to, but do not understand the ignore_non_numeric option.

---
#
# Group - Energy Meter Readings
# Group all Energy Meter Reading Sensors
# 
# https://www.home-assistant.io/integrations/group/
#

platform: group

name: "Group - Household Yearly Energy (kWh)"
unique_id: "group_household_yearly_energy_kwh"
type: sum
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
ignore_non_numeric: false
entities:
  - sensor.vaatwasser_yearly_energy_kwh
  - sensor.wasmachine_yearly_energy_kwh
  - sensor.wasdroger_yearly_energy_kwh

If I add a non existing sensor the group still shows a value instead of “unavailable”.
Is this correct?

Also is there any advantage of using a group:

platform: group

name: "Group - Household Yearly Energy (kWh)"
unique_id: "group_household_yearly_energy_kwh"
type: sum
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
ignore_non_numeric: false
entities:
  - sensor.vaatwasser_yearly_energy_kwh
  - sensor.wasmachine_yearly_energy_kwh
  - sensor.wasdroger_yearly_energy_kwh

instead of a template:

sensor:
  - name: "Combined Household - Yearly Energy (kWh)"
    unique_id: "combined_household_yearly_energy_kwh"
    unit_of_measurement: "kWh"
    device_class: energy
    state_class: total_increasing
    icon: mdi:lightning-bolt
    state: >
      {{ ( states("sensor.vaatwasser_yearly_energy_kwh")|float(0) + 
           states("sensor.wasmachine_yearly_energy_kwh")|float(0) +
           states("sensor.wasdroger_yearly_energy_kwh")|float(0) )|round(2) }}
    availability: >
      {{ states("sensor.vaatwasser_yearly_energy_kwh")|is_number or
         states("sensor.wasmachine_yearly_energy_kwh")|is_number or
         states("sensor.wasdroger_yearly_energy_kwh")|is_number }}

It seems to do the same thing, right?