#Get "announcement" attribute in Universal Media Player's Play Media

1 messages · Page 1 of 1 (latest)

twin vigil
#

I am trying to "hijack" a media player so that when it receives an announcing request, something else is done before the announcement gets played. It seems like the Universal Media Player can be used to do this, so I tried a minimal configuration:

media_player:
  - platform: universal
    unique_id: testmediaplayer
    name: TestMediaPlayer
    device_class: speaker
    commands:
      play_media:
        action: system_log.write
        data:
          level: error
          message: "Announce={{announce}} URL={{media_content_id}}"

However it seems unable to get the attribute named announce like said in the media_player documentation (see the image). Is it possible to get that using UMP or I should do it some way else?

ivory schooner
twin vigil
ivory schooner
# twin vigil My current setup consists MPD addon playing audio to HA server's soundcard, goin...

okay, heres my sugguestion.
write a script that handles switches and sending the announcement.

then insteaad of calling announcement directly you call your script

so the script has a field for output and also a field for each speaker

so you call the script with
message = hello world
speaker A = yes
speaker B = no
speaker C = yes
etc...

then you handle the switching logic in the script.
then play the message

twin vigil
ivory schooner
#

you could write a script that just sets up the switches then call that before you call an announcement anywhere else

#

i don't think your able to stop an action to do something else first