Auto-off feature
This commit is contained in:
parent
8f1415ec77
commit
6b8d149993
|
@ -36,10 +36,30 @@ def get_config():
|
||||||
'key_yellow': '[scene] schlafzimmer_ganz_hell',
|
'key_yellow': '[scene] schlafzimmer_ganz_hell',
|
||||||
'key_blue': '[scene] schlafzimmer_blau',
|
'key_blue': '[scene] schlafzimmer_blau',
|
||||||
|
|
||||||
'key_tv': '[timed_light_off] 30',
|
'key_tv': [service('script.turn_on', 'script.timed_sleep',
|
||||||
'key_video': '[timed_light_off] 15',
|
variables={'media_content_id': 'spotify:playlist:37i9dQZF1DXbcPC6Vvqudd', # Regen
|
||||||
'key_music': '[timed_light_off] 10',
|
'light_off_secs': 15 * 60,
|
||||||
'key_pictures': '[timed_light_off] 5',
|
'music_off_secs': 45 * 60,
|
||||||
|
'shuffle': 1,
|
||||||
|
})],
|
||||||
|
'key_video': [service('script.turn_on', 'script.timed_sleep',
|
||||||
|
variables={'media_content_id': 'Good Night',
|
||||||
|
'light_off_secs': 15 * 60,
|
||||||
|
'music_off_secs': 45 * 60,
|
||||||
|
'shuffle': 0,
|
||||||
|
})],
|
||||||
|
'key_music': [service('script.turn_on', 'script.timed_sleep',
|
||||||
|
variables={'media_content_id': 'spotify:playlist:37i9dQZF1DXbcPC6Vvqudd', # Regen
|
||||||
|
'light_off_secs': 5 * 60,
|
||||||
|
'music_off_secs': 20 * 60,
|
||||||
|
'shuffle': 1,
|
||||||
|
})],
|
||||||
|
'key_pictures': [service('script.turn_on', 'script.timed_sleep',
|
||||||
|
variables={'media_content_id': 'Good Night',
|
||||||
|
'light_off_secs': 5 * 60,
|
||||||
|
'music_off_secs': 20 * 60,
|
||||||
|
'shuffle': 0,
|
||||||
|
})],
|
||||||
|
|
||||||
'key_power': [ # Music & Lights off
|
'key_power': [ # Music & Lights off
|
||||||
service('media_player.media_pause', 'media_player.bedroompi'),
|
service('media_player.media_pause', 'media_player.bedroompi'),
|
||||||
|
|
21
scenes.yaml
21
scenes.yaml
|
@ -492,6 +492,27 @@
|
||||||
state: 'off'
|
state: 'off'
|
||||||
light.schlafzimmer_schrank:
|
light.schlafzimmer_schrank:
|
||||||
state: 'off'
|
state: 'off'
|
||||||
|
- name: Schlafzimmer Einschlaflicht
|
||||||
|
id: schlafzimmer_einschlaflicht
|
||||||
|
entities:
|
||||||
|
light.schlafzimmer_deckenlampe:
|
||||||
|
state: false
|
||||||
|
light.schlafzimmer_schrank:
|
||||||
|
state: false
|
||||||
|
light.bett_martin:
|
||||||
|
state: true
|
||||||
|
brightness: 70
|
||||||
|
xy_color:
|
||||||
|
- 0.502
|
||||||
|
- 0.414
|
||||||
|
light.bett_rebecca:
|
||||||
|
state: true
|
||||||
|
brightness: 70
|
||||||
|
xy_color:
|
||||||
|
- 0.502
|
||||||
|
- 0.414
|
||||||
|
light.schlafzimmer_fluter:
|
||||||
|
state: false
|
||||||
- name: Schlafzimmer Orange
|
- name: Schlafzimmer Orange
|
||||||
id: schlafzimmer_orange
|
id: schlafzimmer_orange
|
||||||
entities:
|
entities:
|
||||||
|
|
63
scripts.yaml
63
scripts.yaml
|
@ -0,0 +1,63 @@
|
||||||
|
#timed_sleep_rain:
|
||||||
|
# alias: "Einschlafen mit Regen"
|
||||||
|
# sequence:
|
||||||
|
# - service: media_player.play_media
|
||||||
|
# data:
|
||||||
|
# entity_id: media_player.bedroompi
|
||||||
|
# media_content_id: spotify:playlist:37i9dQZF1DXbcPC6Vvqudd
|
||||||
|
# media_content_type: music
|
||||||
|
# - service: scene.turn_on
|
||||||
|
# data:
|
||||||
|
# entity_id: scene.schlafzimmer_einschlaflicht
|
||||||
|
# - service: squeezebox_telnet.squeezebox_call_method
|
||||||
|
# data:
|
||||||
|
# command: sleep
|
||||||
|
# parameters:
|
||||||
|
# - 2700
|
||||||
|
# - service: light.turn_off
|
||||||
|
# data:
|
||||||
|
# transition: 900
|
||||||
|
# entity_id: group.bedroom
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#timed_sleep_music:
|
||||||
|
# alias: "Einschlafen mit Musik"
|
||||||
|
# sequence:
|
||||||
|
# - service: media_player.play_media
|
||||||
|
# data:
|
||||||
|
# entity_id: media_player.bedroompi
|
||||||
|
# media_content_id: "Good Night"
|
||||||
|
# media_content_type: music
|
||||||
|
# - service: scene.turn_on
|
||||||
|
# data:
|
||||||
|
# entity_id: scene.schlafzimmer_einschlaflicht
|
||||||
|
# - service: light.turn_off
|
||||||
|
# data:
|
||||||
|
# transition: 900
|
||||||
|
# entity_id: group.bedroom
|
||||||
|
|
||||||
|
timed_sleep:
|
||||||
|
alias: "Einschlafen mit Licht und Musik auto-aus"
|
||||||
|
sequence:
|
||||||
|
- service: media_player.shuffle_set
|
||||||
|
data_template:
|
||||||
|
entity_id: "media_player.bedroompi"
|
||||||
|
shuffle: >
|
||||||
|
{% if shuffle %}True{% else %}False{% endif %}
|
||||||
|
- service: media_player.play_media
|
||||||
|
data_template:
|
||||||
|
entity_id: "media_player.bedroompi"
|
||||||
|
media_content_id: "{{media_content_id}}"
|
||||||
|
media_content_type: "music"
|
||||||
|
- service: scene.turn_on
|
||||||
|
data:
|
||||||
|
entity_id: scene.schlafzimmer_einschlaflicht
|
||||||
|
- service: light.turn_off
|
||||||
|
data_template:
|
||||||
|
transition: "{{light_off_secs}}"
|
||||||
|
entity_id: group.bedroom
|
||||||
|
- service: media_player.squeezebox_call_method
|
||||||
|
data_template:
|
||||||
|
entity_id: "media_player.bedroompi"
|
||||||
|
command: "sleep {{music_off_secs}}"
|
||||||
|
|
Loading…
Reference in New Issue