Playing a .wav in an action on a smart speaker

Hi,

I have a smart speaker, works fine, can use tts to announce something in an action.
Now I want to play a sound like a gong to gain attention.

It is very intresting, that there is no example, but lot of discussion about some complicated scenarious.

Is there really no simple way to play a .wav file ? It’s that basic, isn’t it?

Thanks for helping

With best regards

Gerhard

Hi Gerhard, it’s not that hard (afterwards)

This is an example automation to play a mp3 file (which is stored in the media folder of my HA):

  - service: media_player.play_media
    target:
      entity_id: media_player.kitchen
    data:
      media_content_id: media-source://media_source/local/alarm.mp3
      media_content_type: audio/mpeg
    metadata:
      title: alarm.mp3
      thumbnail:
      media_class: music
      children_media_class:
      navigateIds:
      - {}
      - media_content_type: app
        media_content_id: media-source://media_source

O had this same frustration as well, and so I created the Chime TTS integration to combine audio files with TTS audio.

Hi Nim,
tried your solution.
Really good idea, has the option to set the speed, thats fine.
The installation isn’t without problems.
The path settings for custom sounds were not well documented, can’t find a working setup.

Feature request: When using a template in the message definition box, we loose the visual editor. This is hard, cause all the dropdown boxes with the predefined values also get lost. Maybe there is a chance to do some better input box. Sometimes I found a box for entering ,yaml code especial on the definition pages of front end elements of lovelace.

With best regards

Gerhard
Will spent you coffee for the work (and even more if the problems were solved)

Hi Gerhard,

Thank you so much for your support, it is very appreciated!

Regarding the custom sounds, have you reviewed the documentation for using a local folder of your own chime audio files?

In terms of your feature request for retaining the dropdown lists when switching to YAML editing mode: unfortunately this is not currently possible due to how Home Assistant has implemented the actions UI.
You are correct that some custom lovelace cards support both at the same time, however this is not the case actions (like those added by Chime TTS). Home Assistant’s actions UI is not customizable, and therefore I cannot change any UI behaviour. I would also like to see this supported, as it would definitely improve the user experience…but unfortunately my hands are tied.

Hi @Gerhard56. Following up on your request for using templates in the message textfield while in the visual editor: I just released a new beta version, v1.2.2-beta1, which implements this.

Please upgrade to the beta and let me know if it’s working for you :+1: