1
0
ansible-home-assistant/configuration/automations/bathroom-music-button.yaml
Przemek Grondek e30d4a8d2e Update bathroom automations
fix turning on lights
  change service to call to play music
2021-08-11 23:57:13 +02:00

60 lines
1.6 KiB
YAML

- id: bathroom-music-button-next
alias: '[Bathroom] Music button - next'
description: ''
mode: single
trigger:
- device_id: e233cdffb05076ad7bb049581ffa8c9c
domain: zha
platform: device
type: remote_button_double_press
subtype: remote_button_double_press
condition:
- condition: state
entity_id: media_player.bathroom
state: playing
action:
- service: media_player.media_next_track
target:
entity_id: media_player.bathroom
- id: bathroom-music-button-play
alias: '[Bathroom] Music button - play'
description: ''
mode: single
trigger:
- device_id: e233cdffb05076ad7bb049581ffa8c9c
domain: zha
platform: device
type: remote_button_double_press
subtype: remote_button_double_press
condition:
- condition: not
conditions:
- condition: state
entity_id: media_player.bathroom
state: playing
action:
- service: media_player.shuffle_set
entity_id: media_player.bathroom
data:
shuffle: true
- service: media_player.play_media
target:
entity_id: media_player.bathroom
data:
media_content_id: https://open.spotify.com/playlist/71mXIu6HcdVj3fAMduaHop
media_content_type: music
- id: bathroom-music-button-pause
alias: '[Bathroom] Music button - play/pause'
description: ''
mode: single
trigger:
- device_id: e233cdffb05076ad7bb049581ffa8c9c
domain: zha
platform: device
type: remote_button_short_press
subtype: remote_button_short_press
action:
- service: media_player.media_play_pause
entity_id: media_player.bathroom