- alias: Notify iOS device about locked door when coming home
trigger:
platform: state
entity_id: device_tracker.user_a_iphone,device_tracker.user_b_iphone
to: home
condition:
- condition: state
entity_id: lock.ytterdor
state: 'locked'
action:
# TODO: Figure out how to use service_template to notify the device that triggered the state-change
service: notify.ios_user_b_iphone
data:
message: "Welcome home! The door is locked, want to unlock it?"
data:
push:
category: "unlockdoor"
- alias: Unlock the door from iOS response
trigger:
platform: event
event_type: ios.notification_action_fired
event_data:
actionName: UNLOCK_DOOR
action:
service: lock.unlock
data:
entity_id: lock.ytterdor
code: !secret verisure_lock_code