Skip to content

Instantly share code, notes, and snippets.

@grEvenX
Created January 21, 2019 20:47
Show Gist options
  • Save grEvenX/b4985500e54af1d393846592e7597712 to your computer and use it in GitHub Desktop.
Save grEvenX/b4985500e54af1d393846592e7597712 to your computer and use it in GitHub Desktop.
Home-assistant, prompt to unlock door when arriving home
- 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
ios:
push:
categories:
- name: Unlock door
identifier: unlockdoor
actions:
- identifier: 'UNLOCK_DOOR'
title: 'Unlock Door'
activationMode: 'background'
authenticationRequired: true
destructive: no
behavior: 'default'
automation: !include automations.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment