I have an automation to play a sound when a door sensor is opened (ALARM state on the MQTT sensor). The automation triggers fine, and the sound plays on the 3 media players I setup, but then it also plays on my brother's bedroom TV and the living room TV, which were not part of the script to play sounds on. I did it as a script to check if it was on, and if not to play a silent noise for .5 a second while muted, then unmute and play the sound (this is to eliminate the annoying google home wake sound). The TV media players are referenced NOWHERE in my script or automation... I cannot for the life of me figure out why they are playing on these devices.
#Notification Sounds playing on incorrect Media Players
10 messages · Page 1 of 1 (latest)
@soft spear Sadly we're not mind readers (any more anyway, not after the last time we tried). Please share the YAML and any errors so we can see what you've done.
Automation YAML
alias: Doors
description: Play sound when a door is opened
trigger:
- platform: mqtt
topic: /security/sensors345/362624/alarm
payload: ALARM
- platform: mqtt
topic: /security/sensors345/933953/alarm
payload: ALARM
- platform: mqtt
topic: /security/sensors345/269021/alarm
payload: ALARM
condition: []
action:
- service: script.play_on_all
data:
sound: LOZ_Secret.wav
mode: single
Play on all script
alias: Play on All
description: Play the door chime to all speakers
icon: mdi:music-note
mode: queued
fields:
sound:
default: voy_door_chime_2.mp3
description: Name of media file to play
required: true
sequence:
- parallel:
- service: script.play_sound
data:
sound: "{{ sound }}"
device: media_player.tom_s_google_mini
- service: script.play_sound
data:
sound: "{{ sound }}"
device: media_player.andy_clock
- service: script.play_sound
data:
sound: "{{ sound }}"
device: media_player.kitchen_speaker
play sound script
alias: Play Sound
description: Send a sound to all Speakers without the annoying streaming sound
icon: mdi:music-note
fields:
sound:
description: The filename to play (relative to the local /media folder)
example: voy_door_chime_2.mp3
required: true
device:
description: Entity Id of device
example: media_player.tom_s_google_mini
required: true
mode: queued
sequence:
- if:
- condition: template
value_template: "{{ (is_state(device, 'off')) }}"
then:
- alias: Mute Speaker to wake up silently
service: media_player.volume_mute
target:
entity_id: "{{ device }}"
data:
is_volume_muted: true
- alias: Send silence sound
service: media_player.play_media
target:
entity_id: "{{device}}"
data:
media_content_id: media-source://media_source/local/silence.mp3
media_content_type: audio/mpeg
- alias: Wait for annoying chime
delay:
milliseconds: 800
- alias: Unmute
service: media_player.volume_mute
target:
entity_id: "{{device}}"
data:
is_volume_muted: false
- alias: Play Sound
service: media_player.play_media
target:
entity_id: "{{device}}"
data:
media_content_id: media-source://media_source/local/{{ sound }}
media_content_type: music
I even disabled the media_player.master-bedroom-tv entity, but it still plays on that TV whenever a door opens
Heh. Trace scripts, what could i say... Looks like your "play sound" is still getting called with tv entity...
Except it's not