Setting up Google Actions for Assistant

I’m not following it too closely while it’s still at the high end nerdy level :slight_smile: but kind of what I’m hoping given it’s driven inhouse.

This is great, I got it working fine from the instructions off your PR. One thing that is unclear is how to add new devices: Refreshing the list in the Home app does not help, even if I restart HA. The only way I’ve found is to remove the app in Home and add it back again, forcing me to re-assign rooms to all devices (not only the new ones).

Is this the expected behaviour?

This is “as designed” because Google only allows for Switches and Lights so everything using this integration has to be mapped to one of those domains.

@PhilK Any chance we can get support for scripts? As they don’t have any states I guess we could expose them as switches and just activate the script on both “on” and “off” commands?

@anon35356645 unfortunately there’s no support in assistant for devices that open/close. You could probably set up an Assistant shortcut that maps an open/close command to a turn on/off command though.

@felixbouleau You should be able to to go to the devices page in the Assistant app, hit add, then tap your [test] app and hit check for new devices. They recently (like, this week) added a way in the API to trigger a SYNC command remotely but I haven’t started work on that yet.

@cnrd yup, the script support is in the WIP branch I linked above and seems to be working for me (“works on my machine!” :wink:). Welcome to try it out if you want. Probably take me a few days to tidy things up. I really want to make my tests less garbage before I get too much further into this.

@Filipe-Figueiredo yeah…I actually noticed that last night with my blinds and I don’t know a good way to fix it (aside from not putting your non-lights in the same room as lights or not saying “turn off all the lights”).

The only device type Assistant supports that maps well to devices with a 0-100% range is light which means saying something like “turn off all the lights” will turn off anything that is a light. The option I could think of is to allow users to remap things where they want to like map this media_player as a switch instead but then you lose the ability to say “set the tv to 60%”. I might be able to mix and match traits with types have a switch or outlet that has a brightness trait but the docs aren’t clear on those restrictions (and it’s still just a hack).

hmmm ok @PhilK, this is kind of annoying . I was not aware of this limitations. Hopefully Google will add support for this in a near future. Do you have the docs where google specifies what supports so I can also give them a look and try to arrange some kind of solution?

Also something I didn’t figured out yet: When I say “Turn my living room light blue” the bulb is turned off. I’m using Yeelight Color Bulbs, and I didn’t check the logs yet, so I don’t know if it’s a platform limitation or something wrong with the Google Assistant plugin.
If I reach to some conclusion, I will let you know.

Thanks!

@Filipe-Figueiredo yup, their docs are here https://developers.google.com/actions/smarthome/guides/ and I filed some product feedback asking for more devices types (cover, media, and fan or at least fan modes for a device). If you have any ideas for clever workarounds I’m open.

Color temperature and spectrum aren’t working yet. I set the traits in the SYNC request but I don’t handle the EXECUTE requests yet (weird that it ends up turning the light off…)

1 Like

I am sure they will add additional devices over time.

@PhilK the script part works great! “Hey Google, activate the bedroom tv” activate my IR blaster :slight_smile:
One thing: Are switches supposed to be part of lights? As they turn off when I say turn off all the lights. (It may be because the switches have light in their names?)

@cnrd that’s a good question. My assumption would be that “lights” would only turn off light devices and not include switch devices. Can anyone else confirm that? (I’ll also try to test it this weekend)

That’s a shame, guess IFTTT will still be the most versatile in that regard then.

Hi @PhilK, @cnrd,
all my “lights” are just dumb lights on Xiaomi plugs. Both HA and GH see them as switches.
But “Hey Google, switch on my lights” still works.
see this quick video:

“Bedroom Lights” are not exposed, but the 3 switches are in the Master Bedroom room in Google Assistant.
So this is where the smarts of Google could go either way…

@PhilK Thank you. Just set up your google assistant implementation with the release of 0.56. It’s really nice to be able to my voice to control many “dumb” devices in my house now!

I am attempting to create a project for this and when I click on Add / Import Project at https://console.actions.google.com/ , I get a popup with a circle just spinning in the middle. It never completes and just continues to spin endlessly. Any ideas?

@PhilK Thank you, no issues with setting up. Moving switches over from emulated hue to this was a breeze, makes it better that they are seen as switches. Waiting for the update to change colours on lights before I convert those over.

@atomicpapa , have you tried an alternate browser? Sounds like something isn’t right or a ad blocker. Definitely not related to the component though.

Bingo! Tried it with Edge and it works, but now I feel extremely dirty

Top tip for idiots like me: I didn’t realize that google assistant is a separate app from google search/google now! I could see my devices, but couldn’t control them until I installed google assistant.

Thank you @PhilK, fantastic work!

I suppose this won’t work with Hass in a docker because of the need to use gactions?

Or does the gactions portion not NEED to be run from the Hass installation?

I get all the way to the very last step of the docs and when I select the [test]name of my app I get a 404 error instead of rooms and nicknames