And I don’t understand why that is easier than going to the developer menu and calling the request sync service. Am I missing something?
I only want it to fire manually when I trigger it. Is there a better way?
Just go to the left hand menu, icon at the bottom that looks like the remote icon at the far left. Pick google_assistant from the Domain drop down and request_sync from the Service drop down. Leave Service Data empty. Hit “Call Service”. For as often as you’ll be doing it, it’s really not a lot of effort.
ah ok - Well that is what I did originally. I am just lazy and wanted to use an automation that’s right in front of me.
I put this in as the automation:
- id: '1509933513625' alias: Refresh Google Assistant trigger: - platform: time at: '00:00:00' action: - service: google_assistant.request_sync
at least it’s listing it now but if I edit it it won’t save for some reason in the GUI?
I am also getting an error in the frontend showing.
If you really wanted to, you could use a template switch?
You only need to run a request_sync if you have recently changed the setup of your Hass system to the point of adding or removing a device, group, scene etc. Why have a pointless automation to do this when in most cases, nothing will be updated / sync’d? If you do make a change to your config, you are going to want to do the request_sync straight away so that everything is… in-sync. After that, it wont be required until the next time you make changes (which once your system is set up, could be months). That’s why automating it on a schedule of some sort is pointless. This is what @marthocoo is getting at.
Thanks I understand what he is getting at. I’m just trying to create a shortcut to update it without me trying to remember how to manually call the service - then I can just trigger the automation with 1 or 2 clicks without thinking.
Disclaimer: I have no idea if this will work, it’s just off the top of my head. Add this to the switch part of your configuration.yaml:
switch:
- template:
switches:
google_assistant_sync:
turn_on:
- service: google_assistant.request_sync
turn_off:
- service: google_assistant.request_sync
That should make a switch that calls the request sync service whenever it is toggled on or off.
ok, so its not an ‘automation’ that you want but rather a shortcut. How about creating a scene that fires it? That way you will just have an ‘activate’ button next to the description.
I like the idea of using a scene.
How would I put that in scene.yaml? I use scenes for lights but not sure how to make it trigger a service.
on further investigation it looks like its not that simple,(I dont actually have any scenes created yet) because it seems that you cant fire services from a scene… which seems silly? I guess create a script that fires the service and then a scene that fires the script…
Comes up invalid
hey David did you have to do anything special to get google_assistant to show up in your domain list? I got the api key from step 9 finally to work found I had to click all project not just recent. I added the API key I got from Step 9 to my config and restarted but I don’t have a google_assistant domain.
thoughts?
No I didn’t. I added the extra bits to configuration.yaml and followed the changes you have to make in the dev console etc and it all just worked. Had to restart home assistant of course but then it just shows up in the list of domains.
you mean step 8? I missed that step, I read that as if I want other users to be able to. ARG
Nope, step 8 has nothing to do with the request_sync service. Can you post your google_assistant config?
Not step 8. Have to add 2 lines to configuration.yaml and also in Google, the homegraph API stuff.
You then have to unlink your app from assistant and then relink it.
Ok thanks about step 8, I added the API_Key which I got from the homegraph site and the second is agent user Id are the two fields we add right? Should we leave the agent User ID blank and let it generate? I used an email address.
I used an email address.
Did you unlink/re-link the app?
Hmm I tried adding an email, I did unlink and relink, I actually force stopped my home app as well just to make sure I had not issues around that, rebooted HA twice. I will revisit at a later date and double check everything. Thanks again for all your help.