I’m trying to set up one of my first automations to turn on the coffee machine when the smart front door lock is unlocked between certain hours. I’ve looked at quite a few examples but just need a point in the right direction.
As far as I can tell I need a trigger, a condition and then an action.
The trigger will be the unlocking of the front door. There appear to be two options here, either I use ‘state’ going from locked to unlock or presumably I can just respond to an ‘event’ as presumably the lock announces it has been unlocked. Is one better than the other?
Would this work for the first option?
trigger:
-platform: state
entity_id: lock.front_door
to: "unlocked"