Will711990
(Will711990)
October 25, 2020, 1:35pm
1
Hi everybody !
I try to combined template without success. The aim is to use a state of an input_select to search a sensor state…
I have no idea if it’s possible or not…
{{ states.sensor.{{states.input_select.town_notifications_william.state}}_rain_chance.state }}
Did you already try it ?
thank you !
123
(Taras)
October 25, 2020, 2:17pm
3
As mentioned, you cannot nest templates.
Try this:
{% set rc = 'sensor.' ~ states('input_select.town_notifications_william') ~ '_rain_chance' %}
{{ states(rc) }}
It can be reduced to a single line:
{{ states('sensor.' ~ states('input_select.town_notifications_william') ~ '_rain_chance') }}
1 Like
Will711990
(Will711990)
October 25, 2020, 4:18pm
4
Whoua, it works like a charm !
Thank you so for the answer really clear and fast !!
1 Like