2021-01-07 01:52:50 +00:00
|
|
|
- id: alarm-automation
|
2021-01-11 02:11:14 +00:00
|
|
|
alias: '[Alarm] Wakeup automation'
|
2020-11-03 23:55:41 +00:00
|
|
|
description: ''
|
|
|
|
trigger:
|
|
|
|
- platform: time
|
|
|
|
at: input_datetime.alarm
|
2021-01-11 03:49:59 +00:00
|
|
|
condition:
|
|
|
|
- condition: state
|
|
|
|
entity_id: sensor.sm_g965f_next_alarm
|
|
|
|
state: ' com.urbandroid.sleep '
|
|
|
|
attribute: Package
|
2020-11-03 23:55:41 +00:00
|
|
|
action:
|
|
|
|
- service: light.turn_on
|
|
|
|
data:
|
|
|
|
kelvin: 2000
|
|
|
|
brightness: 1
|
|
|
|
entity_id:
|
|
|
|
- light.bedroom_1
|
|
|
|
- light.bedroom_2
|
|
|
|
- service: light.turn_on
|
|
|
|
data:
|
|
|
|
kelvin: 5300
|
|
|
|
transition: 1800
|
|
|
|
brightness: 255
|
|
|
|
entity_id:
|
|
|
|
- light.bedroom_1
|
|
|
|
- light.bedroom_2
|
2021-01-07 01:52:50 +00:00
|
|
|
- delay: '15'
|
2020-11-03 23:55:41 +00:00
|
|
|
- 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.6
|
|
|
|
entity_id: media_player.bedroom_speaker
|
|
|
|
- service: media_player.play_media
|
|
|
|
data:
|
|
|
|
media_content_id: media-source://media_source/local/wake-the-f-up-samurai-we-have-a-city-to-burn.mp3
|
|
|
|
media_content_type: music
|
|
|
|
entity_id: media_player.bedroom_speaker
|
2021-01-07 01:52:50 +00:00
|
|
|
- delay: '15'
|
2020-12-06 18:11:06 +00:00
|
|
|
- service: spotcast.start
|
|
|
|
data:
|
|
|
|
device_name: Bedroom speaker
|
|
|
|
uri: 'spotify:playlist:71mXIu6HcdVj3fAMduaHop'
|
|
|
|
random_song: true
|
2021-01-07 01:52:50 +00:00
|
|
|
mode: single
|
|
|
|
- id: alarm-update-time
|
2021-01-11 02:11:14 +00:00
|
|
|
alias: '[Alarm] Update alarm time'
|
2021-01-07 01:52:50 +00:00
|
|
|
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
|
2021-01-11 02:11:14 +00:00
|
|
|
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')) }}"
|