1
0
ansible-home-assistant/configuration/automations/bathroom-music.yaml
pgrondek 92bf8c23e2 Change bathroom automations
Merge with white temperature automations
2021-05-25 13:54:21 +02:00

48 lines
1.2 KiB
YAML

- id: bathroom-music-on
alias: '[Bathroom] Music On'
mode: restart
trigger:
- platform: state
entity_id: binary_sensor.shower_motion
from: 'off'
to: 'on'
- device_id: 4d5298037e93ba11438409bff01b5005
domain: zha
platform: device
type: remote_button_short_press
subtype: turn_on
condition:
- condition: state
entity_id: media_player.bathroom_speaker
state: 'off'
action:
- service: spotcast.start
data:
device_name: Bathroom speaker
uri: 'spotify:playlist:71mXIu6HcdVj3fAMduaHop'
- id: bathroom-music-off
alias: '[Bathroom] Music Off'
mode: restart
trigger:
- platform: state
entity_id: binary_sensor.shower_motion
for: '0:01:00'
from: 'on'
to: 'off'
- platform: state
entity_id: binary_sensor.bathroom_motion_occupancy
for: '0:01:00'
from: 'on'
to: 'off'
condition:
- condition: state
entity_id: binary_sensor.shower_motion
state: 'off'
- condition: state
entity_id: binary_sensor.bathroom_motion_occupancy
state: 'off'
action:
- service: media_player.turn_off
entity_id: media_player.bathroom_speaker