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

Just submitted a PR for the changes I had made. Hopefully that’s ok. :slight_smile:

1 Like

Struggling to set a timer with this using my edited API. If anyone works out the correct syntax (and the same goes for an alarm) without require any additional chat/response please feed back here.

I think the issue is that the alarm or timer is being set on the “virtual” google home and there currently is not the capability to set a timer or alarm on another device.

That would explain it. Thanks.

Not seeing your pull request by the way. Interested to see it as I’d already submitted one myself but I’m no coder!

Hey andrewdolphin! I have a comment or two on your PR. I’d say once those two minor things are taken care of, I can trigger the Docker build from where I am and get the new version out there.

Just merged a PR from @kylerw that takes the add-on to version 0.0.3, adding a webhook for generic messages that aren’t for broadcasts.

http://[HASSIO LOCAL IP]:5000/command?message=[any Google command]

You can use this to send any generic message you want to Google that the Google Assistant app could normally handle.

“Turn on the hallway lights,” or “Set a reminder for [something]”, etc.

4 Likes

We should change to that (rather than have 2 types)?

@anon35356645

It’s just a version upgrade, and Hass.io would suggest it. Although, if it’s working for you, then there’s really no need to upgrade.

but if I use this, in order to broadcast a message I have to add BROADCAST in the text before the message, correct?
Basically I can:
turn on living room light
or
broadcast It’s time for dinner

if I use the command above if I write
turn on living room light … it will just shout “turn on living room light” but not actually executing the command

Correct?

I would use two boxes then: one for intercom, the other for giving commands

@AndBobsYourUncle
broadcast_message is working but google_command is not

AM I doing something wrong?

notify:
  - name: Google Assistant
    platform: rest
    resource: http://192.168.1.12:5000/broadcast_message  
  - name: Google Assistant Command
    platform: rest
    resource: http://192.168.1.12:5000/command?message=google_command
script:
  send_broadcast:
    sequence:
      - service: notify.google_assistant
        data_template:
          message: '{{ states.input_text.broadcast_message.state }}'
      - service: input_text.set_value
        data:
          entity_id: input_text.broadcast_message
          value: ''
  send_google_command:
    sequence:
      - service: notify.google_assistant_command
        data_template:
          message: '{{ states.input_text.google_command.state }}'
      - service: input_text.set_value
        data:
          entity_id: input_text.google_command
          value: ''
automation:
 - alias: Broadcast message
    trigger:
      platform: state
      entity_id: input_text.broadcast_message
    condition:
      condition: template
      value_template: '{{ (states.input_text.broadcast_message.state | length) > 0 }}'
    action:
      - service: script.send_broadcast
  - alias: Send Google command
    trigger:
      platform: state
      entity_id: input_text.google_command
    condition:
      condition: template
      value_template: '{{ (states.input_text.google_command.state | length) > 0 }}'
    action:
      - service: script.send_google_command

after update to 0.0.3 the service is not starting

Newbie question, can I use this without hass.io and docker ?
This is exactly what I’m looking for, trigger google assistant with text input. Actually, I’m already able to do that with an old Nexus 7 + Tasker and HTTP server but this is far from ideal.

I agree this could be expanded with more webhooks, I use this for example to trigger Netflix or Spotify on chromecast.

Tip for my french fellows: as you may know the broadcast functionality is not yet available in France. But if the text based google assistant is setup in english and the google home in french, you can still broadcast messages in french. I guess this should also work for the other languages where the broadcast is not yet available.

@anon35356645

What do you mean by the service is not starting after upgrade? I just tried updating my own copy to 0.0.3 and I can use both /broadcast_message and /command.

/command passes through the text as-is to the Google Assistant. So, if you are sending “this is a test” to /command it will not play anything. You need to send “broadcast this is a test” to /command to broadcast if you’d like, but it is not necessary if you’re using /broadcast_message for notifications.

The /command endpoint is for users that want to send other things to Google Assistant besides broadcast messages.

@chocomega

I’m assuming it is possible to get this installed on a computer without using Docker, but it’d be a bit difficult.

You’d have to essentially follow the commands in the Dockerfile to get it working, like installing the Python packages and so on.

now it starts, but the broadcast or command is not executed. I made some changes in my ssl, proxy, tls, certificate whatever shit, and now is not working.

i HOPE THEY COME WITH A UNIFIIED SOLUTION FOR THIS HTTP HTTPS BUZZ, EVERYTIME i TRY SOMETHING THERE IS A PROBLEM LIKE THIS

@anon35356645

Huh, then I’m assuming it is some sort of networking issue then. Have you tried to open http://[HASSIO LOCAL IP]:5000/broadcast_message?message=test in a browser?

yes tried, is not working.

BTW I have two HASSIO, one on pi3 and I updated your addon fine (but not working), and HASSIO on a Intel-NUC, and there it does not start

What is the Hass.io log look like for the add-on?