Add Sonos night mode automation
This commit is contained in:
parent
efe0b8849e
commit
02aa9f1a31
|
@ -24,6 +24,7 @@ Entertainment:
|
|||
- group.sonos
|
||||
- group.chromecast
|
||||
- group.consoles
|
||||
- binary_sensor.den_night_mode
|
||||
|
||||
Automation:
|
||||
view: yes
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
automation:
|
||||
- alias: Toggle Sonos night mode
|
||||
action:
|
||||
- service: media_player.sonos_set_option
|
||||
entity_id: media_player.den
|
||||
data_template:
|
||||
night_sound: >-
|
||||
{{ now().hour > 22 }}
|
||||
trigger:
|
||||
- platform: time
|
||||
at: '22:30:00'
|
||||
- platform: time
|
||||
at: '08:00:00'
|
||||
binary_sensor:
|
||||
- platform: template
|
||||
sensors:
|
||||
den_night_mode:
|
||||
friendly_name: Sonos Den Night Mode
|
||||
value_template: >-
|
||||
{{ state_attr('media_player.den', 'night_sound') }}
|
||||
|
Loading…
Reference in New Issue