1
0
ansible-home-assistant/configuration/automations/alarm-clock.yaml

68 lines
2.0 KiB
YAML
Raw Normal View History

- 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
action:
2021-04-29 21:26:10 +00:00
- service: cover.open_cover
target:
2021-05-31 21:34:16 +00:00
entity_id: cover.bedroom_blinds
- service: cover.open_cover
target:
entity_id: cover.computer_cave_blinds
- 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:
2021-03-21 22:40:28 +00:00
volume_level: 0.05
entity_id: media_player.bedroom
2020-11-03 23:55:41 +00:00
- 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
- delay: '15'
2021-03-21 22:40:28 +00:00
- service: media_player.play_media
2020-12-06 18:11:06 +00:00
data:
2021-03-21 22:40:28 +00:00
entity_id: media_player.bedroom
media_content_id: 'https://open.spotify.com/playlist/3Qu9kE0ivJIkn76pxTLMFe'
media_content_type: music
- repeat:
2021-02-26 19:29:20 +00:00
while:
- condition: numeric_state
2021-03-21 22:40:28 +00:00
entity_id: media_player.bedroom
attribute: volume_level
2021-04-29 15:03:53 +00:00
below: 0.10
sequence:
- delay: '30'
- service: media_player.volume_up
2021-03-21 22:40:28 +00:00
entity_id: media_player.bedroom
mode: single
- id: alarm-update-time
2021-01-11 02:11:14 +00:00
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
2021-01-14 01:18:07 +00:00
- condition: state
entity_id: sensor.sm_g965f_next_alarm
state: 'com.urbandroid.sleep'
2021-01-14 01:18:07 +00:00
attribute: Package
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')) }}"