Hi!
I’ve been trying to work out how have multiple states from one sensor trigger an automation.
Can someone tell me the best way of doing it?
I tried using the documentation example of:
to:
- "A"
- "B"
which created
to: 'A,B,C,D,etc'
I wasn’t sure this was correct, as it looked like a string that contained those phrases and commas.
I also tried some other way: I’m not sure what it was, but it didn’t work
Can someone confirm to me the best way of doing this?
I have never been able to get this to work in the visual editor… I have tried a lot of different methods, but never get it to reflect correctly in the YAML…
I just copied the example from above assuming I was doing something… But it’s still interpreted as a string of characters…
I have tried every combination I could think of but they all resolve as a string in the YAML editor:
a, b, c, d
a,b,c,d
“a”,“b”,“c”,“d”
‘a’, ‘b’, ‘c’, ‘d’
‘a, b, c, d’
“A, b, c, d”
When I try to do it in the YAML editor and change it to the visual editor, it resolves correctly ( [“a”,“b”,“c”,“d” ] ) but throws an error… I would assume if the visual editor does it, the YAML editor would be able to convert it back, right?
I think your best bet is using the YAML editor as there you can create the list with proper YAML syntax for lists.
The visual editor seems to be better suited for less complex “to” configurations (eg, just one word/etc).