From 4c9fd5dea580a29aafc43feb9f2a5b67415bb92c Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Mon, 26 Jul 2021 18:45:55 +0200 Subject: [PATCH] Update alarm clock --- configuration/automations/alarm-clock.yaml | 43 ++----------------- .../automations/phone-automations.yaml | 40 ----------------- 2 files changed, 3 insertions(+), 80 deletions(-) delete mode 100644 configuration/automations/phone-automations.yaml diff --git a/configuration/automations/alarm-clock.yaml b/configuration/automations/alarm-clock.yaml index 5e51a38..4727e3c 100644 --- a/configuration/automations/alarm-clock.yaml +++ b/configuration/automations/alarm-clock.yaml @@ -1,9 +1,9 @@ - id: alarm-automation alias: '[Alarm] Wakeup automation' - description: '' trigger: - - platform: time - at: input_datetime.alarm + - platform: state + entity_id: calendar.automations_wakeup + to: 'on' action: - service: cover.open_cover target: @@ -15,11 +15,6 @@ - service: media_player.volume_set data: volume_level: 0.1 - entity_id: media_player.bedroom_speaker - - delay: 0:30:00 - - service: media_player.volume_set - data: - volume_level: 0.05 entity_id: media_player.bedroom - service: media_player.play_media data: @@ -32,36 +27,4 @@ entity_id: media_player.bedroom media_content_id: 'https://open.spotify.com/playlist/3Qu9kE0ivJIkn76pxTLMFe' media_content_type: music - - repeat: - while: - - condition: numeric_state - entity_id: media_player.bedroom - attribute: volume_level - below: 0.10 - sequence: - - delay: '30' - - service: media_player.volume_up - entity_id: media_player.bedroom - mode: single -- id: alarm-update-time - alias: '[Alarm] Update alarm time' - mode: single - trigger: - - platform: state - entity_id: sensor.sm_g965f_next_alarm - condition: - - condition: not - conditions: - - condition: state - entity_id: sensor.sm_g965f_next_alarm - state: unknown - - condition: state - entity_id: sensor.sm_g965f_next_alarm - state: 'com.urbandroid.sleep' - attribute: Package - action: - - service: input_datetime.set_datetime - entity_id: input_datetime.alarm - data: - datetime: "{{ (((state_attr('sensor.sm_g965f_next_alarm', 'Time in Milliseconds') | int / 1000) - 30*60 ) | timestamp_custom('%Y-%m-%d %H:%M:%S')) }}" diff --git a/configuration/automations/phone-automations.yaml b/configuration/automations/phone-automations.yaml deleted file mode 100644 index 7bd0cbb..0000000 --- a/configuration/automations/phone-automations.yaml +++ /dev/null @@ -1,40 +0,0 @@ -- id: phone-sleep-as-android - alias: '[Phone] Sleep as Android' - mode: single - trigger: - - platform: webhook - webhook_id: 56af98df-9477-431d-a38c-9cd42bc1c512 - action: - - choose: - - conditions: - - condition: device - device_id: c76e890aeaf8b90472ce178076298aad - domain: device_tracker - entity_id: device_tracker.sm_g965f - type: is_home - - condition: template - value_template: '{{ trigger.json.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.json.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: - title: 'Sleep As Android automation' - message: 'Unknown event: {{ trigger.json }} ' -