Play TTS from the device on which a button is pressed

,

Hello, I’m trying to make a button in the UI that can play a TTS from the device itself when it is pressed. For example, if the button is pressed on a phone, the audio comes out of the same phone, similarly to how the media dashboard behaves.
My use case is pretty peculiar, but I think it could also be useful to quickly retrieve informations which are commonly requested to the VA, without speaking.
Has anybody managed to achieve this? Is the UI action context accessible at all?

I do this using browser mod on many of my devices. I add an event when the button area of my dashboard is touched and it plays on the device were the touch took place.

    type: button
              name: Goal Scored
              icon: mdi:hockey-puck
              show_name: true
              show_icon: true
              show_state: false
              tap_action:
                action: fire-dom-event
                browser_mod:
                  service: script.nhl_auston_matthews_scored_goal
                  data:
                    browser_id: THIS
1 Like

thanks, I didn’t know about this interesting integration! I easily got it working on my PC browser, however it is not playing anything on my Android companion app… I have already tried clearing the cache. Is it working fine for you on mobile apps?

1 Like

I do have it working on the companion app on my android phone.
I enabled my phone in browser mod then in my script I ensure that my phone name is a part of the script.

condition: template
value_template: "{{ browser_id == \"xxx Phone\" }}"

I tried several times, what finally worked for me was:

  1. removing the custom integration from HACS
  2. deleting the Browser Mod js file from Dashboard Resources
  3. deleting the “browser_mod.storage” file in .storage folder
  4. clearing data and cache of the companion app
  5. reinstalling the custom integration as the repository instructions

Thanks!

1 Like