Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template:
- - sensor:
- - unique_id: air_purifier_power_watts
- name: Air Purifier Power Use
- unit_of_measurement: W
- icon: mdi:flash
- state: >
- {% set voltage = states('sensor.air_purifier_voltage')|float %}
- {% set current = states('sensor.air_purifier_current')|float %}
- {% set wattage = (voltage * current) %}
- {{ wattage }}
- # Alternatively, the entire state template can be condensed down to:
- # {{ ((states('sensor.air_purifier_voltage')|float) * (states('sensor.air_purifier_current')|float)) }}
- # But I think it looks nicer and more readable this way.
Add Comment
Please, Sign In to add comment