Trigger “hey google” command via HA

Hi all,

I’ve searched high and low but haven’t been able to find a definitive answer on this.
I basically want motion to initiate a “hey google show me front door camera on google home display” command.

I’ve achieved this using the camera stream automation in HA but found the stream which was much more delayed than speaking direct to google assistant.

It looks like there used to be an add on for this (assistant relay) but this in no longer maintained.

Many thanks :slightly_smiling_face:

Hi Rozza,

Maybe this is something what you can use?

If you have a Video Camera URL, then it should be possible to stream this to your Google device:

# Play a video file from the local network:
service: media_player.play_media
target:
  entity_id: media_player.**<your chromecast device>**
data:
  media_content_type: "video"
  media_content_id: "**<your camera video url>**"

If this works, you can trigger this with an automation policy whenever front-door motion is detected.

Hi CreatoX,

Thanks for the response.
I do have google cast enabled and this does indeed work but it still is a far more delayed way of showing the camera on screen.
Sorry I should of mentioned in the original post this is a Google Nest Camera so perhaps that’s why initiating the ‘hey google’ command is a faster way of viewing the video.

Assistant Relay still works, it just hasn’t been updated in a while.

Ah yes you are correct Dave.
I guess I shouldn’t of assumed it was not working. thank you.

For anyone having issues setting up I followed this great tutorial and all is working fine.

3 Likes

I used this detailed video, but at the late point of creating a test automation, I failed.

The service I could find is called “RESTful Command: assistant_relay” and I was not able to enter more data like message.

I check the config sign by sign but could not find any deviation (expect ip and user).
image

Any idea, what is wrong here?

No idea, what the issue on my side is? The sandbox-commands are running, but when using the call-service-action with the rest_command.assistant_relay there is no chance to enter more data as the service-data-field is just missing.

The thing that stands out to me is that your payload is the other way around to mine.

rest_command:
  assistant_relay:
      url: http://192.168.0.14:3000/assistant
      method: POST
      content_type: 'application/json'
      payload: '{"command":"{{ command }}", "user":"Home Assistant"}'

Thanks for your idea. But that did not solve my issue.
I also recognized, that you do not use quotation marks for url and method. But none of these ways lead to succes.

Have you tried clearer your browser cache in case the issue is simply with rendering the page?

I restarted several times and I tried it with different PCs and also via the android-app. It is still the same …

I am wondering, if this might help:
When searching for the service to be called, it shows this strange name “RESTful command…”.
image

Is that how it’s meant to be?

I also tried to execute the automation direct from the automations-page and found this error-log.

But I think this is due to the missing values that I cannot enter.

I also tried to call the service directly with the same problem:

I believe you need to click on “ZUM YAML MODUS” and add the message just as he does in the video

I also tried that. In the video he’s is not using the YAML-mode. This is a screenshot of his video:

Nevertheless I tried it with the YAML-mode and got this error when saving the automation:

Try

- service: rest_command.assistant_relay
  data:
    message: "message text"

Well, he using a different version of HA where it looks different.

I’m having a similar issue, UI for service data doesn’t display for my POST rest_command.