From a370b76fecf14663b6d132204d8b1228a15355a4 Mon Sep 17 00:00:00 2001 From: pgrondek Date: Mon, 12 Apr 2021 17:32:28 +0200 Subject: [PATCH] Update automations --- automations/files/automations/3d-printer.yaml | 2 +- .../files/automations/bathroom-motion.yaml | 2 +- .../files/automations/bedroom-motion.yaml | 2 +- .../files/automations/phone-automations.yaml | 77 ++++++++----------- 4 files changed, 36 insertions(+), 47 deletions(-) diff --git a/automations/files/automations/3d-printer.yaml b/automations/files/automations/3d-printer.yaml index f4935a1..c0f01e3 100644 --- a/automations/files/automations/3d-printer.yaml +++ b/automations/files/automations/3d-printer.yaml @@ -7,7 +7,7 @@ device_id: 58e9b8fc848631004a3c1e303ff25229 entity_id: sensor.3d_printer_power domain: sensor - below: 10 + below: 30 for: hours: 0 minutes: 30 diff --git a/automations/files/automations/bathroom-motion.yaml b/automations/files/automations/bathroom-motion.yaml index 01c43c0..dd6c49b 100644 --- a/automations/files/automations/bathroom-motion.yaml +++ b/automations/files/automations/bathroom-motion.yaml @@ -60,7 +60,7 @@ trigger: - platform: state entity_id: binary_sensor.bathroom_motion_sensor - for: '0:02:00' + for: '0:05:00' from: 'on' to: 'off' action: diff --git a/automations/files/automations/bedroom-motion.yaml b/automations/files/automations/bedroom-motion.yaml index eee9a87..23eb572 100644 --- a/automations/files/automations/bedroom-motion.yaml +++ b/automations/files/automations/bedroom-motion.yaml @@ -9,7 +9,7 @@ condition: - condition: numeric_state entity_id: sensor.bedroom_motion_illuminance - below: '50' + below: '25' - condition: state entity_id: input_select.home_mode state: Day diff --git a/automations/files/automations/phone-automations.yaml b/automations/files/automations/phone-automations.yaml index 509a302..369d849 100644 --- a/automations/files/automations/phone-automations.yaml +++ b/automations/files/automations/phone-automations.yaml @@ -1,50 +1,39 @@ -- id: phone-sleep-start - alias: '[Phone] Sleep start' +- id: phone-sleep-as-android + alias: '[Phone] Sleep as Android' mode: single trigger: - platform: webhook webhook_id: 56af98df-9477-431d-a38c-9cd42bc1c512 - condition: - - condition: template - value_template: '{{ trigger.event.data.event == ''SLEEP_TRACKING_STARTED'' }}' - - condition: device - device_id: c76e890aeaf8b90472ce178076298aad - domain: device_tracker - entity_id: device_tracker.sm_g965f - type: is_home action: - - service: notify.mobile_app_sm_g965f - data: - message: Sleep automation - - service: script.good_night + - choose: + - conditions: + - condition: device + device_id: c76e890aeaf8b90472ce178076298aad + domain: device_tracker + entity_id: device_tracker.sm_g965f + type: is_home + - condition: template + value_template: '{{ trigger.event.data.event == ''SLEEP_TRACKING_STARTED'' }}' + sequence: + - service: notify.mobile_app_sm_g965f + data: + message: Sleep automation + - service: script.good_night + - conditions: + - condition: device + device_id: c76e890aeaf8b90472ce178076298aad + domain: device_tracker + entity_id: device_tracker.sm_g965f + type: is_home + - condition: template + value_template: '{{ trigger.event.data.event == ''SLEEP_TRACKING_STOPPED'' }}' + sequence: + - service: notify.mobile_app_sm_g965f + data: + message: Sleep automation + - service: script.good_morning + default: + - service: notify.mobile_app_sm_g965f + data: + message: 'Unknown state ' -- id: phone-sleep-end - alias: '[Phone] Sleep end' - mode: single - trigger: - - platform: webhook - webhook_id: 56af98df-9477-431d-a38c-9cd42bc1c512 - condition: - - condition: template - value_template: '{{ trigger.event.data.event == ''SLEEP_TRACKING_STOPPED'' }}' - - condition: device - device_id: c76e890aeaf8b90472ce178076298aad - domain: device_tracker - entity_id: device_tracker.sm_g965f - type: is_home - action: - - service: notify.mobile_app_sm_g965f - data: - message: Sleep automation - - service: script.good_morning - -- id: phone-webhook - alias: '[Phone] Webhook' - mode: single - trigger: - - platform: webhook - webhook_id: 56af98df-9477-431d-a38c-9cd42bc1c512 - action: - - service: notify.mobile_app_sm_g965f - data: - message: 'Automation {{ trigger.event.data.event }}' \ No newline at end of file