Chips template not printing zero values

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

image

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;
image

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.

This is a known (but unsolved) problem. A workaround would be using {0}


    content: '{{ ''{0}'' if states(entity) == ''0'' else states(entity) }}'

1 Like

Thank you so much!