Today I’m trying to learning the difference off “list” and “dictionary’s”.
But let me first limit myself to the “list”, and as usual I have some questions about this.
I have chosen one sensor that I can use in all directions, (sensor.weather_condition_code) that can take the state of any letter of the alphabet.
sensor.weather_condition_code can have status (a) but also status (f) or (s) but never status (a) and (f).
How can I use this in an automation???
if:
{% set list = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'] %}
{{ list[0] }} or
{{ list[1] }} or
{{ list[2] }}
then:
turn on the lamp
else:
do something else
Does anyone have an example of this?
Don’t start hitting right away because I want to learn something.
The next thing I would like to learn is the dictionary.