alias: Dashboard Cast
sequence:
- if:
- condition: or
conditions:- condition: not
conditions:- condition: device
device_id: "{{ device }}"
domain: media_player
entity_id: "{{ entity }}"
type: is_playing
- condition: device
- condition: and
conditions:- condition: device
device_id: "{{ device }}"
domain: media_player
entity_id: "{{ entity }}"
type: is_playing - condition: state
entity_id: "{{ entity }}"
attribute: app_name
state: Home Assistant Lovelace
then:
- condition: device
- condition: not
- service: media_player.turn_off
data: {}
target:
entity_id: "{{ entity }}" - service: media_player.volume_mute
data:
is_volume_muted: true
target:
entity_id: "{{ entity }}" - service: media_player.volume_set
data:
volume_level: 0.99
target:
entity_id: "{{ entity }}" - service: cast.show_lovelace_view
data:
entity_id: "{{ entity }}"
dashboard_path: lovelace
view_path: "{{ view }}" - delay:
hours: 0
minutes: 0
seconds: 1
milliseconds: 500 - service: media_player.volume_mute
data:
is_volume_muted: false
target:
entity_id: "{{ entity }}"
mode: restart
- condition: or