I’m running an infinity HVAC system, and want to display the damper position of my two zones.
When the content is 0, it doesn’t print the number, but if I put a character before or after it, it prints the character and the 0.
The damper reports a stepper motor position of 0-15, so I’m just mathing it to get the % open
- type: template
content: >-
{% set state = states('sensor.downstairs_damper') %}{{ (state
| float / 15 * 100 ) | round(0) if is_number(state)}}
entity: sensor.downstairs_damper
icon: mdi:speedometer
icon_color: orange
But with the % char after the numerical content
content: >-
{% set state = states('sensor.downstairs_damper') %}{{ (state
| float / 15 * 100 ) | round(0) if is_number(state)}} %
I get this;
I have similar problems when I’m adding up the total number of doors or windows open. If it’s zero it doesn’t print.