diff --git a/configuration/automations/front-door.yaml b/configuration/automations/front-door.yaml index cacba2a..ce5726e 100644 --- a/configuration/automations/front-door.yaml +++ b/configuration/automations/front-door.yaml @@ -19,17 +19,3 @@ actions: - action: LOCK_DOOR title: Lock door - -- id: mobile_action-lock_door - alias: '[Mobile-action] Lock door' - description: '' - mode: single - trigger: - - platform: event - event_type: mobile_app_notification_action - event_data: - action: LOCK_DOOR - action: - - service: lock.lock - target: - entity_id: lock.front_door_25f246fe_door_lock \ No newline at end of file diff --git a/configuration/automations/mobile-actions.yaml b/configuration/automations/mobile-actions.yaml new file mode 100644 index 0000000..7003924 --- /dev/null +++ b/configuration/automations/mobile-actions.yaml @@ -0,0 +1,51 @@ +- id: mobile_action-lock_door + alias: '[Mobile-action] Lock door' + description: '' + mode: single + trigger: + - platform: event + event_type: mobile_app_notification_action + event_data: + action: LOCK_DOOR + action: + - service: lock.lock + target: + entity_id: lock.front_door_25f246fe_door_lock + +- id: mobile_action-unlock_door + alias: '[Mobile-action] Unlock door' + description: '' + mode: single + trigger: + - platform: event + event_type: mobile_app_notification_action + event_data: + action: UNLOCK_DOOR + action: + - service: lock.unlock + target: + entity_id: lock.front_door_25f246fe_door_lock + +- id: mobile_action-leave_home + alias: '[Mobile-action] Leave home automation' + description: '' + mode: single + trigger: + - platform: event + event_type: mobile_app_notification_action + event_data: + action: LEAVE_HOME + action: + - service: script.leave_home + +- id: mobile_action-arrive_home + alias: '[Mobile-action] Arrive home automation' + description: '' + mode: single + trigger: + - platform: event + event_type: mobile_app_notification_action + event_data: + action: ARRIVE_HOME + action: + - service: script.arrive_home \ No newline at end of file diff --git a/configuration/automations/presence.yaml b/configuration/automations/presence.yaml new file mode 100644 index 0000000..2cc7f4d --- /dev/null +++ b/configuration/automations/presence.yaml @@ -0,0 +1,33 @@ +- id: presence-arrive + alias: '[Presence] Arrive Home' + trigger: + - platform: state + entity_id: person.przemek + to: home + action: + - service: notify.mobile_app_iphone_pg + data: + message: Arrive home + data: + actions: + - action: ARRIVE_HOME + title: Run automation + - action: UNLOCK_DOOR + title: Unlock door + +- id: presence-leave + alias: '[Presence] Leave Home' + trigger: + - platform: state + entity_id: person.przemek + from: home + action: + - service: notify.mobile_app_iphone_pg + data: + message: You left home + data: + actions: + - action: LEAVE_HOME + title: Run automation + - action: LOCK_DOOR + title: Lock door