@jim1977 wrote:
Hello!
I’ve got a sensor which I’d like to create a template sensor for.
When “sensor.battery_time_to_go” shows “0” I’d like to display the word “infinate” and any positive numerical value after that to display as normal. ie: 1.1, 10.2 etcTemplate sensor:
time_to_go: friendly_name: "Time to go" unit_of_measurement: 'Hrs' entity_id: - sensor.battery_time_to_go value_template: "{%if states.sensor.battery_time_to_go == '0' %}Infinate{% endif %}"
Is this possible?
Posts: 3
Participants: 2