1
0

Update alarm clock

This commit is contained in:
Przemek Grondek 2021-07-26 18:45:55 +02:00
parent b6bc5bcdf5
commit 4c9fd5dea5
2 changed files with 3 additions and 80 deletions

View File

@ -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')) }}"

View File

@ -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 }} '