Community Hass.io Add-on: Google Assistant Webserver (broadcast messages without interrupting music)

can this be done via a HA command?

Iā€™m not sure what you mean by a HA command, but all you need to do is a simple HTTP POST (documented here: https://rithvikvibhu.github.io/GHLocalApi/#assistant-assistant-notifications-post

Iā€™ve created a command line switch for all my assistant devices to control night mode and you should be able to do the same for DND.

Thanks for the link. Do you mind sharing your code for that? Command line switches are new to me.

- platform: command_line
  switches:
    dining_room_display_night_mode:
      command_off: >
        curl -H "Content-Type: application/json" -X POST -d '{"enabled":false}' http://<IP>:8008/setup/assistant/set_night_mode_params
      command_on: >
        curl -H "Content-Type: application/json" -X POST -d '{"do_not_disturb":false,"enabled":true,"led_brightness":0,"volume":0.5,"windows":[{"days":[0,1,2,3,4,5,6],"length_hours":24,"start_hour":0}]}' http://<IP>:8008/setup/assistant/set_night_mode_params
      command_state: >
        curl -X GET http://<IP>:8008/setup/eureka_info\?params\=night_mode_params
      friendly_name: "Dining Room Display - Night Mode"
      value_template: '{{ value_json.night_mode_params.enabled == true }}'

Thatā€™s what I use for my night mode switches, youā€™d have to adapt it for DND.

1 Like

thanks for that

Tip

If you are using a BT Smarthub (UK) and you get the message displaying in My Activity" but no actual sound broadcast from your Google Home then try going into BT Smarthub advanced settings and then in the IPV6 options set IPv6 Address Allocation to Allocation Mode = ā€œStatefulā€.

Then reboot BT Smarthub and Google Home

I was finally able to install the addon on HassOS, now that I have configured it as instructed but for some reason the message does not seems to

http://hassio.local:5000/broadcast_message?message=testmessage

I only get the below response on my browser, any suggestions?

{ā€œstatusā€: ā€œOKā€}

I too tried this. In Google Myactivity it says your assistant needs permissions for that, maybe thereā€™s a way to add those in Google console?

Supposedly Google Assistant SDK doesnā€™t allow playing/casting or even routines to kind of trigger those options.

Exactly wanted to do this. But seems like itā€™s unsupported. Were you able to find a workaround for this?

My broadcasts have suddenly started to be proceeded by ā€œbroadcast from name hereā€ then the intended message. Anyone know how to stop this as itā€™s spoiling the experience.

1 Like

You likely canā€™t. This is rolling out as part of the new intercom-ish broadcast features.

Came here to say this! This has ruined my broadcasting! It as if Google are trying to make thing difficult sometimes lol

1 Like

No I wasnā€™t
Sorry

having the same issue

1 Like

Bugger! This add on rules and this seriously compromises it. Someone do something smart! :slight_smile:

2 Likes

Broadcasting/announcing the usual way ā€œHey Google, Broadcast/announce messageā€ doesnā€™t append anything which is sort of promising that the prefix might be avoidable?

Since few days the broadcast is not working. :frowning:

This is a complete guess, but Iā€™m thinking the new behavior (ā€œIncoming broadcast fromā€¦ā€) is added any time the broadcast is using the assistant voice rather than a recording of the person sending the broadcast. My guess is that this is designed so that if multiple people use the broadcast feature you can tell who it was from.

If I open assistant on my phone and type ā€œbroadcast test messageā€ the broadcast comes out ā€œBroadcast from Clayton: test messageā€ with the assistant voice (because I typed the message) however if I actually speak to an assistant speaker and tell it ā€œbroadcast test messageā€ then the speakers broadcast only ā€œtest messageā€ but in my recorded voice, so it doesnā€™t need to prepend ā€œBroadcast from Claytonā€.

If my guess is correct then I would assume thereā€™s no way around it, unless Google adds an option in accessibility or something like that.

1 Like

Youā€™re right I tried the same thing earlier. Although I can see the requirement for ā€œnormalā€ use. For our use-case It really is a shame! Iā€™ve come to use broadcast messages in a huge amount of automations and notifications. I really donā€™t want to go back to TTS and the plague of problems that had for me.

Hopefully Google do add an option or an adaptation of broadcasts for the specific purpose.

1 Like