core: Error while connecting to google assistant
Home Assistant release with the issue: 0.101.2
Last working Home Assistant release (if known): N/A
Operating environment (Hass.io/Docker/Windows/etc.): Docker
Integration: https://www.home-assistant.io/integrations/google_assistant/
Description of problem:
I configured home assistant integration with google assistant. I can see the devices in google, but states reporting is not working.
I have this issue in the logs (mutliple times) :
2019-11-04 23:35:53 ERROR (MainThread) [homeassistant.components.google_assistant.http] Request for https://homegraph.googleapis.com/v1/devices:reportStateAndNotification failed: 404
I configured homegraph as shown in the documentation and I can see in the metrics that the api is being called (without success) :
Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):
google_assistant:
project_id: #########
service_account: !include google-assistant.json
# private_key: !secret google_assistant_private_key
# client_email: !secret google_assistant_email
report_state: true
# api_key: !secret google_api_key
expose_by_default: false
entity_config: !include_dir_merge_named google-assistant-entities
The json file is the one created by google when creating the account service.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 4
- Comments: 80 (12 by maintainers)
Hi @RenzoBeux and @allmoney . I was investigating this issue few weeks ago, since it bothered me too. I have already replied on some other thread my findings and solution: Most probably you have (or had) multiple accounts in you Home Assistant, and one of the accounts IDs is not linked to Google Assistant project on Action, that is why such close to 50% error rate (one of two accounts is not linked, so API throws error every second call). Two ways to fix it:
.storage/google_assistantfile, by removing all lines which are not your HA account ID (you can find it in UI, Configuration -> Users -> each user has its own ID of 33 characters length).storage/google_assistant, restart HA, and then re-link it again. New proper.storage/google_assistantwill be generated. Good luck.I was able to fix the 404 error by ensuring the service account project id was the same as the one configured for the google assistant integration and that the homegraph API was enabled for that project. Originally I generated the service account for a different project, when I changed it to one generated for project used by the google assistant integration the error when away.
Yep sorry, I found out today that Google disable the “Test” after 30 days… it was just matter of restarting the test draft app…
Thanks god!!! Thank you very much, really, now i have a clean error log 😃
I haven’t tested this but it seems to be the closest to a solution whilst avoiding the drastic action I took back in February. https://github.com/home-assistant/core/issues/28541#issuecomment-583267532
It talks to the idea of a gremlin lurking within our build…
.storage/google_assistantThanks @sergiigladchukSame error in HA 0.109 version
API enabled:
1 day:
30 days:
@0n3-70uch Your issue is not related to anything discussed here. Please keep things on topic.
If you need help, see: https://www.home-assistant.io/help/, or, in case you are sure it is a bug, raise a new issue.
Thanks 👍
With so many folk saying that they overcame the 404 error, it forced me to take drastic action. I did a complete re-build of HA from scratch. Not using a snapshot restore via Supervisor; but manually piecing everything back together from a snapshot extracted to a local drive. No more errors and I didn’t change anything on the Google side of things. Something in my build was hinky - but that’s history now.
This worked for me. When I clicked on the link to create service account from the google assistant integration page on home assistant it auto selected the wrong project for some reason [you can see the project in the upper left corner - there is a dropdown]. Ensuring the project was the correct one [by going to the actions on google console] and ensuring that project was the correct one and ensured it was the one with the homegraph API enabled fixed the 404 errors.
Not sure why - but after I upgraded to 101.2, my GA<->HA broke as well. The good news is I was able to fix it by deleting the configuration in both GA and HA, and re-creating everything from scratch. It is now working over here on 101.2.