I may have missed it in the breaking changes but it seems they sneaked in another requirement to include deafault
for | int
.
(Full disclosure… I knew it was coming as I had heard about in the forum)
But anyway, I’m getting the warning:
Template warning: 'int' got invalid input 'unavailable' when rendering template '{% set sensor_used = states('sensor.light_level_sensor_being_used') %} {% set light_level_value = states('sensor.' + sensor_used) | int %} {% set sensor_threshold = states('input_number.hall_' + sensor_used +'_sensor_threshold') | int %} {{ light_level_value <= sensor_threshold }}' but no default was specified. Currently 'int' will return '0', however this template will fail to render in Home Assistant core 2022.1
But I would have thought that with my availability
it should bnever even evaluate the state
template?
What have I missed or done wrong?
- name: Dark In The Dining Room
state: >
{% set sensor_used = states('sensor.light_level_sensor_being_used') %}
{% set light_level_value = states('sensor.' + sensor_used) | int %}
{% set sensor_threshold = states('input_number.dining_room_' + sensor_used +'_sensor_threshold') | int %}
{{ light_level_value <= sensor_threshold }}
availability: >
{{ states('sensor.light_level_sensor_being_used') not in ['unknown','unavailable'] }}
icon: >
mdi:candle