WIP add home-music automation
This commit is contained in:
parent
12608cea51
commit
9857a90de1
76
configuration/automations/home-music.yaml
Normal file
76
configuration/automations/home-music.yaml
Normal file
@ -0,0 +1,76 @@
|
||||
- id: ra-music-bathroom-arrive
|
||||
alias: '[RA] Bathroom arrive'
|
||||
mode: single
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: sensor.przemyslaws_apple_watch_room_presence
|
||||
to: ra-bathroom
|
||||
condition:
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: media_player.bedroom
|
||||
state: playing
|
||||
action:
|
||||
- service: sonos.join
|
||||
data:
|
||||
master: media_player.bedroom
|
||||
entity_id: media_player.bathroom
|
||||
|
||||
- id: ra-music-bathroom-leave
|
||||
alias: '[RA] Bathroom leave'
|
||||
mode: single
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: sensor.przemyslaws_apple_watch_room_presence
|
||||
from: ra-bathroom
|
||||
for: '0:01:00'
|
||||
condition:
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: media_player.bathroom
|
||||
state: playing
|
||||
action:
|
||||
- service: sonos.unjoin
|
||||
data:
|
||||
entity_id: media_player.bathroom
|
||||
|
||||
- id: ra-music-bedroom-arrive
|
||||
alias: '[RA] Bedroom arrive'
|
||||
mode: single
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: sensor.przemyslaws_apple_watch_room_presence
|
||||
to: ra-bedroom
|
||||
condition:
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: media_player.bathroom
|
||||
state: playing
|
||||
action:
|
||||
- service: sonos.join
|
||||
data:
|
||||
master: media_player.bathroom
|
||||
entity_id: media_player.bedroom
|
||||
|
||||
- id: ra-music-bedroom-leave
|
||||
alias: '[RA] Bedroom leave'
|
||||
mode: single
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: sensor.przemyslaws_apple_watch_room_presence
|
||||
from: ra-bathroom
|
||||
for: '0:01:00'
|
||||
condition:
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: media_player.bedroom
|
||||
state: playing
|
||||
action:
|
||||
- service: sonos.unjoin
|
||||
data:
|
||||
entity_id: media_player.bedroom
|
||||
|
Loading…
Reference in New Issue
Block a user