53 lines
1.5 KiB
YAML
53 lines
1.5 KiB
YAML
input_boolean:
|
|
spotify_idle_or_paused:
|
|
name: Spotify Idle or Paused
|
|
icon: mdi:spotify
|
|
shuffle_spotify:
|
|
name: Spotify Shuffle
|
|
icon: mdi:spotify
|
|
|
|
intent_script:
|
|
SetVolume:
|
|
action:
|
|
service: "media_player.volume_set"
|
|
data:
|
|
entity_id: "{{ media_player }}"
|
|
volume_level: "{{ volume / 100.0 }}"
|
|
speech:
|
|
text: "Volume changed to {{ volume }}"
|
|
|
|
automation:
|
|
- id: beac4fed-5326-49ef-951e-6615d0cf1a7c
|
|
alias: 'Spotify Page - Everywhere Media Player idle or paused '
|
|
description: ''
|
|
trigger:
|
|
- platform: template
|
|
id: 'on'
|
|
value_template: '{{ is_state(''media_player.everywhere'', ''playing'') }}'
|
|
- platform: template
|
|
value_template: >-
|
|
{{ is_state('media_player.everywhere', 'idle') or
|
|
is_state('media_player.everywhere', 'paused') or
|
|
is_state('media_player.everywhere', 'standby') }}
|
|
id: 'off'
|
|
condition: []
|
|
action:
|
|
- choose:
|
|
- conditions:
|
|
- condition: trigger
|
|
id: 'on'
|
|
sequence:
|
|
- service: input_boolean.turn_on
|
|
data: {}
|
|
target:
|
|
entity_id: input_boolean.spotify_idle_or_paused
|
|
- conditions:
|
|
- condition: trigger
|
|
id: 'off'
|
|
sequence:
|
|
- service: input_boolean.turn_off
|
|
data: {}
|
|
target:
|
|
entity_id: input_boolean.spotify_idle_or_paused
|
|
default: []
|
|
mode: single |