Controlling switch from Google Assistant

Can you see the switch in the Google Assistant App? (once you sync your devices). Have you told Google to Sync Your Devices (not just running request_sync service)

I just remembered that I needed to add this to my customizew.yaml:

switch.subwoofer:
  google_assistant: true

…so I did, restarted HA, re-ran request_sync, but GA still “doesn’t know how to help with that yet”
???

Unfortunately my main phone is being repaired, and the GA app isn’t compatible with any of my other Android devices. Is there any other way of telling Google to sync my devices?

You running an old version of HA? This isn’t added in customize anymore it’s in configuration.yaml now and looks like this in my setup:

# Google Assistant
google_assistant:
  project_id: !secret ga_project
  client_id: !secret ga_client
  access_token: !secret ga_access
  agent_user_id: !secret agent
  api_key: !secret api-ga
  exposed_domains:
    - switch
    - light
    - group
    - scene
    - media_player
  entity_config:
    switch.coffeemaker:
      expose: false

etc…

I’m running 0.61.1 (am usually nervous about upgrading in case it breaks something!)

request_sync should work. The changes to configuring Google Assistant came in a few releases ago. That might be your problem if you updated but didn’t fix the new config for GA.

This changed in 0.61 Might be the issue…

I have this section at the end of configuration.yaml:

google_assistant:
  project_id: testha-12345c
  client_id: 216010837999-kjc1xxxxx9h3rgh7at3o.apps.googleusercontent.com
  access_token: xHe4xxxxxxxg
  agent_user_id: myid
  api_key: AIzaSyCF3xxxxxxx1AO9arT8
  exposed_domains:
    - switch
    - light
    - group
    - media_player
    - script
    - climate
    - cover
  entity_config:
    switch.subwoofer:
      expose: true

I added the entity_config entry from reading your example. Restarted HA, re-ran request_sync. Still no luck

Is request_sync showing any error? (I suspect it’s not syncing)

A few weeks ago I was having issues and I had to unlink my devices and relink them. I seem to remember something changed on the Google side and I had to enter something else… But you’ll need a phone to unlink I think. I just went through the setup docs again.

No the message just said “service google_assistant/request_sync called”.

So should my config entry be OK for HA 0.61.1?
I can’t for the life of me remember the process for linking devices to GA (it was one of those “do it once and forget it” jobs!)

You need to check in the developer tools under i icon (where it shows the logo and version) to see if it was successful.
Linking and unlinking is done in the Google Assistant App on your phone.

Ah OK there was an error:

request_sync request failed: 400 b'{\n "error": {\n "code": 400,\n "message": "Request contains an invalid argument.",\n "status": "INVALID_ARGUMENT"\n }\n}\n'
23:51 components/google_assistant/__init__.py (ERROR)

Maybe I need to go through the whole GA setup process again? A job for tomorrow…!

Yep. Like I said earlier, Google changed something. Just follow the Google setup through again. You then may or may not need your phone to link/unlink…

I confirm this. I had a similar issue a few days ago. You also need to make sure that the projects in the Google Cloud Console and in the Developer Console have the same ID, or else the Sync feature won’t work.
More information available here.

Thanks for the info. Now I’m wondering whether it’s worth going to all this trouble, if one change from Google can cause this sort of disruption. Maybe IFTTT would be a more maintainable way to control my HA switches from GA??

I’m just checking my project details on the Google Developer Console & Cloud Console. I don’t actually see a Project Id on the Developer Console - only a client id. Or is the Project Id the name that is displayed at the top of the Overview page in the Developer Console?

You can either continue use google_assistant from HA. Just go back to your google assistant app>setting>home control>+ (you will see whether your [test]app name. Click on your app name and Unlink account. Then click your [test]app name again to link account> new devices that you add to HA will be add in this time.

or
use Broadlink Smart Home from google assistant app the same way you add your [test]app name. I never try this but there is broadlink app support in google assistant ^^

I would continue using the GA component from Home Assistant. I like to not be dependent of any 3rd party cloud services which interact with my account.

In the Developer Console, you can see the project ID in the URL, it’s the ID behind the /project/ in the URL.

In the Cloud Console, you click on the Project Name right Next to “Google Cloud Console”, and the ID is displayed in the pop up box, prompting to select a Project.

sorry to barge in, but you could try Google Assistant App i am developing. It only interacts with your API.

-Dennis