#Redirect timer sound to external speaker.
1 messages · Page 1 of 1 (latest)
You can expose "timer_ringing" binary sensor in YAML, and then use it to trigger automation in HA.
Thank you for your reply. Can you direct me to some documentation or examples on how to correctly add this to the yaml?
If you changed YAML to redirect answers, then you have full YAML in ESPHome, right? I mean, taken control over device.
I'm unfamiliar with Atom YAML, but in PE there's https://github.com/esphome/home-assistant-voice-pe/blob/dev/home-assistant-voice.yaml#L195 this switch. Find same in your YAML, remove "internal: true", and re-flash.
I dont have that line in the switch area. Here i what I have:
switch:
- platform: template
name: Use listen light
id: use_listen_light
optimistic: true
restore_mode: RESTORE_DEFAULT_ON
entity_category: config
on_turn_on:
- script.execute: reset_led
on_turn_off:
- script.execute: reset_led
- platform: template
id: timer_ringing
optimistic: true
restore_mode: ALWAYS_OFF
on_turn_off:
# Turn off the repeat mode and disable the pause between playlist items
- lambda: |-
id(echo_media_player)
->make_call()
.set_command(media_player::MediaPlayerCommand::MEDIA_PLAYER_COMMAND_REPEAT_OFF)
.set_announcement(true)
.perform();
id(echo_media_player)->set_playlist_delay_ms(speaker::AudioPipelineType::ANNOUNCEMENT, 0);
# Stop playing the alarm
- media_player.stop:
announcement: true
on_turn_on:
# Turn on the repeat mode and pause for 1000 ms between playlist items/repeats
- lambda: |-
id(echo_media_player)
->make_call()
.set_command(media_player::MediaPlayerCommand::MEDIA_PLAYER_COMMAND_REPEAT_ONE)
.set_announcement(true)
.perform();
id(echo_media_player)->set_playlist_delay_ms(speaker::AudioPipelineType::ANNOUNCEMENT, 1000);
- media_player.speaker.play_on_device_media_file:
media_file: timer_finished_wave_file
announcement: true
- delay: 15min
- switch.turn_off: timer_ringing
To make the tts sound through the external speaker I added this after on_tts_start
on_tts_end:
- homeassistant.action:
action: media_player.play_media
data:
entity_id: media_player.vlc
media_content_id: !lambda 'return x;'
media_content_type: music
announce: "true"
Then you should already have timer_ringing switch in HA. If not, try adding name to that switch in YAML and re-flash.