1
0

Add synchronization alarm clock from phone

This commit is contained in:
Przemek Grondek 2021-01-07 02:52:50 +01:00
parent a22e8f677d
commit c36b494d77

View File

@ -1,17 +1,9 @@
- id: wakeup - id: alarm-automation
alias: Wakeup automation alias: [Alarm] Wakeup automation
description: '' description: ''
trigger: trigger:
- platform: time - platform: time
at: input_datetime.alarm at: input_datetime.alarm
condition:
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
action: action:
- service: light.turn_on - service: light.turn_on
data: data:
@ -28,7 +20,7 @@
entity_id: entity_id:
- light.bedroom_1 - light.bedroom_1
- light.bedroom_2 - light.bedroom_2
- delay: '10' - delay: '15'
- service: media_player.volume_set - service: media_player.volume_set
data: data:
volume_level: 0.1 volume_level: 0.1
@ -43,10 +35,27 @@
media_content_id: media-source://media_source/local/wake-the-f-up-samurai-we-have-a-city-to-burn.mp3 media_content_id: media-source://media_source/local/wake-the-f-up-samurai-we-have-a-city-to-burn.mp3
media_content_type: music media_content_type: music
entity_id: media_player.bedroom_speaker entity_id: media_player.bedroom_speaker
- delay: '10' - delay: '15'
- service: spotcast.start - service: spotcast.start
data: data:
device_name: Bedroom speaker device_name: Bedroom speaker
uri: 'spotify:playlist:71mXIu6HcdVj3fAMduaHop' uri: 'spotify:playlist:71mXIu6HcdVj3fAMduaHop'
random_song: true random_song: true
mode: single 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
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')) }}"