Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95358

Is there a better way to do this?

$
0
0

@maurizio53 wrote:

I have an automation to stop the radio playing in one of my media players that says:

- alias: Nessuno a Casa Spengo Radio
  initial_state: on
  trigger:
    - platform: template
      value_template: "{{ not is_state('device_tracker.life360_maurizio_fabiani', 'home') }}"
  condition:
    condition: or
    conditions:
      - condition: state
        entity_id: media_player.salotto_audio
        state: 'playing'
      - condition: state
        entity_id: media_player.home
        state: 'playing'
      - condition: state
        entity_id: media_player.googlehome5670
        state: 'playing'
      - condition: state
        entity_id: media_player.googlehome0461
        state: 'playing'
      - condition: state
        entity_id: media_player.sonos_stereo
        state: 'playing'
      - condition: state
        entity_id: media_player.studio
        state: 'playing'
      - condition: state
        entity_id: media_player.echo_show
        state: 'playing'
      - condition: state
        entity_id: media_player.echo_spot
        state: 'playing'
      - condition: state
        entity_id: media_player.echo_plus
        state: 'playing' 
 action:
    - service: media_player.turn_off
      entity_id: media_player.salotto_audio, media_player.googlehome5670, media_player.googlehome0461, media_player.home, media_player.sonos_stereo, media_player.studio, media_player.echo_show, media_player.echo_spot, media_player.echo_plus
    - service: input_boolean.turn_off
      entity_id: input_boolean.radio_play
    - service: notify.telegram
      data:
        message: Spengo la Radio.

Is there a better way to decide which player is playing and turn it off?

Posts: 6

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 95358

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>