Hi All,
I’m trying to create a Multi-Line Template Sensor based on the value of the current power of a power monitoring socket.
I can get a Binary sensor to work like this:
- binary_sensor:
- name: "Hot Water Heating"
device_class: heat
state: >
{{ states('sensor.hotwater_energy_power')|float > 15 }}
Works fine. But next step is i want to get multiple strings for that value and eventually change the icon depending on the value. I just can’t seem to get it, and cant find the documentation to show how to do what i consider a simple task.
Here’s what i have:
- sensor:
- name: "How Water Status"
state: >
{% if is_state('switch.hot_water_load_sensor', 'off') %}
off
{% elif is_state('sensor.hotwater_energy_power')|float < 15) %}
standby
{% elif is_state('sensor.hotwater_energy_power')|float > 15) %}
heating
{% else %}
failed
{% endif %}
I’m sure its something simple.