diff --git a/configuration/configuration.yaml b/configuration/configuration.yaml index 68da00f..f93c75d 100644 --- a/configuration/configuration.yaml +++ b/configuration/configuration.yaml @@ -570,6 +570,19 @@ template: {% endif%} attributes: last_reset: '1970-01-01T00:00:00+00:00' + - name: "Printer kWh" + unit_of_measurement: "kWh" + state_class: measurement + device_class: energy + state: > + {% set power = states('sensor.printer_energy') | float %} + {% if (power > 0) %} + {{ power }} + {% else %} + {{ states('sensor.printer_kWh') }} + {% endif%} + attributes: + last_reset: '1970-01-01T00:00:00+00:00' - name: "washing_machine_kWh" unit_of_measurement: "kWh" state_class: measurement