2021-01-08 21:51:30 +00:00
|
|
|
- id: bathroom-music-on
|
|
|
|
alias: '[Bathroom] Music On'
|
|
|
|
mode: restart
|
|
|
|
trigger:
|
|
|
|
- platform: state
|
|
|
|
entity_id: binary_sensor.shower_motion
|
|
|
|
from: 'off'
|
|
|
|
to: 'on'
|
2021-01-15 09:03:20 +00:00
|
|
|
condition:
|
|
|
|
- condition: state
|
|
|
|
entity_id: media_player.bathroom_speaker
|
|
|
|
state: 'off'
|
2021-01-08 21:51:30 +00:00
|
|
|
action:
|
|
|
|
- service: spotcast.start
|
|
|
|
data:
|
|
|
|
device_name: Bathroom speaker
|
|
|
|
uri: 'spotify:playlist:71mXIu6HcdVj3fAMduaHop'
|
|
|
|
random_song: true
|
|
|
|
- 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_sensor
|
|
|
|
for: '0:01:00'
|
|
|
|
from: 'on'
|
|
|
|
to: 'off'
|
|
|
|
condition:
|
|
|
|
- condition: state
|
|
|
|
entity_id: binary_sensor.shower_motion
|
2021-01-15 09:03:20 +00:00
|
|
|
state: 'off'
|
2021-01-08 21:51:30 +00:00
|
|
|
- condition: state
|
|
|
|
entity_id: binary_sensor.bathroom_motion_sensor
|
2021-01-15 09:03:20 +00:00
|
|
|
state: 'off'
|
2021-01-08 21:51:30 +00:00
|
|
|
action:
|
|
|
|
- service: media_player.turn_off
|
|
|
|
entity_id: media_player.bathroom_speaker
|