1
0

Add printer energy measurement

This commit is contained in:
Przemek Grondek 2021-08-24 02:24:16 +02:00
parent b4eafb9fbd
commit e9c9580027

View File

@ -570,6 +570,19 @@ template:
{% endif%} {% endif%}
attributes: attributes:
last_reset: '1970-01-01T00:00:00+00:00' 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" - name: "washing_machine_kWh"
unit_of_measurement: "kWh" unit_of_measurement: "kWh"
state_class: measurement state_class: measurement