I don’t have a whole house monitoring system, but I do have a stack of Kasa individual wifi plugs. Instead of adding each device individually into the energy ‘electricity grid’ section using its total kWh consumption, I have created a sum of all of the devices in a group I wish to mostly monitor. I wanted to have 3 or 4 different groups and then add them into the ‘electricity grid’ section.
I can get the total of devices added up fine with a template but I am missing the one critical element… “state_class: total_increasing”. How do I add this to the sensor.yaml file?
nats_total_current_consumption:
friendly_name: "Nats Consumption Total"
unit_of_measurement: 'kWh'
icon_template: 'mdi:flash'
device_class: 'energy'
value_template: >-
{% if not is_state('sensor.nats_subwoofer_current_consumption', 'unknown') %}
{{
((states('sensor.nats_room_air_conditioning_total_consumption')|float) +
(states('sensor.nat_s_laptops_total_consumption')|float) +
(states('sensor.nat_s_bedroom_dyson_total_consumption')|float) +
(states('sensor.nat_s_audio_equip_total_consumption')|float) +
(states('sensor.nat_s_tv_unit_total_consumption')|float) +
(states('sensor.nats_subwoofer_total_consumption')|float) +
(states('sensor.nat_s_fridge_total_consumption')|float) +
(states('sensor.nat_s_bedroom_side_table_total_consumption')|float) +
(states('sensor.nat_s_bedroom_tv_total_consumption')|float))
}}
{%endif %}