Hi all,
I would like to ask you what is wrong with my template. It is actually working but I am having warnings in LOGs:
Template warning: 'int' got invalid input 'unknown' when rendering template ':host { color: {% if states(config.entity) | int <= 300 %} green {% elif states(config.entity) | int <= 1000 %} greenyellow {% elif states(config.entity) | int <= 3000 %} yellow {% elif states(config.entity) | int <= 10000 %} orange {% elif states(config.entity) | int <= 25000 %} red {% endif %} ; }' but no default was specified. Currently 'int' will return '0', however this template will fail to render in Home Assistant core 2022.1
type: entities
entities:
- entity: sensor.air_quality_sensor_voc
card_mod:
style: |
:host {
color:
{% if states(config.entity) | int <= 300 %}
green
{% elif states(config.entity) | int <= 1000 %}
greenyellow
{% elif states(config.entity) | int <= 3000 %}
yellow
{% elif states(config.entity) | int <= 10000 %}
orange
{% elif states(config.entity) | int <= 25000 %}
red
{% endif %}
;
}
- entity: sensor.air_quality_sensor_humidity
name: Humidity Living room
- entity: sensor.air_quality_sensor_temperature
name: Temperature Living room
- entity: sensor.air_quality_sensor_air_quality
name: Air quality
state_color: false
show_header_toggle: true
footer:
type: graph
entity: sensor.air_quality_sensor_voc
hours_to_show: 24
detail: 2
title: Senzor kvality ovzdušĂ
Thank you