Hi. I’m new to HA and very new to automtation, but I’ve created this simple automation that I think should work, but somehow does not. Anyone that could have a quick look at it and see if there is something I’m missing?
alias: Freya Alarm på
trigger:
- platform: state
entity_id:
- sensor.freya_uke
attribute: day
to: '0'
action:
- service: sonos.update_alarm
data:
entity_id: media_player.freya
alarm_id: 18
Check to see if the output of the attribute is a string or number. While states are always strings, attributes can be other data types like integers, floats, lists, and dictionaries. State triggers are very literal. Because of this there is a difference between ‘0’ and 0, and strings will not cause a trigger when a number is what’s expected.
Hi Drew. Thanks for replying. It seems you might be correct. I removed the to: completely and it worked.
I’ve no changed the ‘0’ to a 0, and will find out on the next change if that works.
The ‘0’ was created by the visual editor, and if I change it to 0 in the ymal code the visual editor reports an error: