I would like to combine the Active power readings from my 2 aqara power plugs so they can be implemented in the graph card in my dashboard.
The 2 entities are summed through a template in Automations and I was pointed in the direction of using a helper. As I haven’t used Yaml/helpers before I’m unsure on what my next step should be.
I would assume the helper will help me store legacy readings which in turn allows me to make the graph ?
I’m not sure if it’s correct, but saved it under config/Power_consumption. The two entities I’d like to sum are Äctive_power 1 & 2. I’m not fully sure what the "set study & "“set Livingroom” do as I took it from the example article you linked. I assumed those were the zones.
I would setup the last part slightly differently, but you should make sure to at least set defaults for your float() filters and set state_class: measurement so that your data is graph-able.
Also, you must have a : after “template”.
template:
- sensor:
- name: "Energy consumption"
state_class: measurement
unit_of_measurement: "W"
state: >
{% set study = states('sensor.lumi_lumi_plug_maeu01_active_power_2') | float(0) %}
{% set livingroom = states('sensor.lumi_lumi_plug_maeu01_active_power') | float(0) %}
{{ (study, livingroom) | average | round (1,0) }}