I an trying to get my head around templates and have read a bunch of threads (and the docs) on it but have not figured out exactly how to achieve what I am planning.
I was hoping to expand on the below code to include more lights going ‘unavailable’ as triggers and then have the notification tell me which one or more lights have gone ‘unavailable’. I have 5 other lights I would like to include as triggers.
notify_light_unavailable.yaml
alias: Notify if light unavailable
initial_state: 'on'
trigger:
- platform: state
entity_id: light.front_door_light
to: 'unavailable'
for:
seconds: 5
action:
- service: notify.Pushbullet
data:
message: 'The front door light has gone unavailable'
thanks. I’ll give it a try. Since you have if / elif statements, would that still allow for the action to send multiple notifications if more than one light becomes unavailable? It seems that a few of my lights randomly do this throughout the day. Initially I created the automation so I could then provide a bit of an alarm if someone was to steal my front light globe (its a Yeelight screw globe so easy to take) but since I seem to be having a few random ‘unavailable’s’ throughout the day I figure I’ll use the notification to try and nut out the root cause first…