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.
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.
@MarkHofmann11 Thank you. I will try that.
Are you using the report state config ?
What does your configuration look like ?
Grm
I have redone the whole configuration with no luck. Still does not work ..
@grm - I had opened an issue on this, but closed it after I got things working again by re-creating everything. Here is the detail, along with the config on the HA side: https://github.com/home-assistant/home-assistant/issues/28523 I deleted my Google project and everything associated with it - then re-created everything on the both sides again.
Hey there @home-assistant/cloud, mind taking a look at this issue as its been labeled with a integration (google_assistant
) you are listed as a codeowner for? Thanks!
I have a similar issue but with service_account
Invalid config for [google_assistant]: [service_account] is an invalid option for [google_assistant]. Check: google_assistant->google_assistant->service_account. (See /config/configuration.yaml, line 93). Please check the docs at https://home-assistant.io/integrations/google_assistant/
I am running 0.101.3 and am also getting the 404 error. I (for another reason) deleted my Google project and recreated it not realizing it was a potential solution, but it did not help. I can see the devices and control them. If I can be of help with logs or configuration, please let me know.
@zenyagami I had the same issue. The service account was introduced in 0.101 version. Update home assistant and you should be able to use the service account.
I'm not using report_state at the moment, so that is probably the difference in my case. I can do a "sync all devices" without it - just using the API. Maybe that is something I should add to my configuration, but not sure exactly what extras it will provide. It seems to work fine for all my entities without it.
I have a similar issue but with service_account
Invalid config for [google_assistant]: [service_account] is an invalid option for [google_assistant]. Check: google_assistant->google_assistant->service_account. (See /config/configuration.yaml, line 93). Please check the docs at https://home-assistant.io/integrations/google_assistant/
@zenyagami I think your problem is that you're not on the latest version of home assistant, I also made this mistake. service_account
is only introduced some days ago with release 101.
I've the same issue though; also a 404 on HA 101.3 with service_account set and report_state set to true.
I think I've found the issue in my case; my service account json was not accessible for home assistant, since it was created by my own user. That the integration only gives the 404 warning is a bit weird, but for me chmod homeassistant:homeassistant google-assistant.json
fixed the problem.
Replace homeassistant:homeassisant
with the <user>:<group>
that home assistant is running with.
@grm Can you check if this also works for you?
@wvds Unfortunately, did not work for me.
I will try to update home assistant tomorrow to latest version and do a fresh install.
Maybe I will be luckier this time :)
I have done the whole configuration from scratch.
I have a litlle bit more info. When using a service account :
The API has been deployed on the new project.
Similar symptoms have been reported on the Community forums.
However, in my case, having both a service account AND Homegraph API set up & configured makes the 403 errors go away (I never received any 404 errors). And the Google Assistant integration is working. I'm on HA docker image v 0.102.2 on Ubuntu 18.04.3.
I can confirm that for me too it behaves the same as for the user grm:
with HomeGraph API enabled it gives 404 errors
without HomeGraph API enabled it gives 403 errors
I'm using Hass.io v0.102.2
The exact error is (without HomeGraph API enabled):
Request for https://homegraph.googleapis.com/v1/devices:reportStateAndNotification failed: 403
But the Google Assistant seems to be communicating with Hass.io just fine in spite of the errors.
Not sure if it's related to this, but I have the same 403 errors with otherwise seems to be working integration, except when I trigger a GA routine, I get "Sorry, it looks like Home Ass is unavailable right now" from GA. The routine seems to work fine though, i.e. all the expected actions are executed.
Similar symptoms have been reported on the Community forums.
However, in my case, having both a service account AND Homegraph API set up & configured makes the 403 errors go away (I never received any 404 errors). And the Google Assistant integration is working. I'm on HA docker image v 0.102.2 on Ubuntu 18.04.3.
I'm getting 404 errors now, having both a service account AND Homegraph API set up.
2019-12-01 11:14:36 ERROR (MainThread) [homeassistant.components.google_assistant.http] Request for https://homegraph.googleapis.com/v1/devices:reportStateAndNotification failed: 404
I'm on 0.103.0 and setup google home yesterday. Seeing the same errors in the log but as far as know everything works.
ERROR (MainThread) [homeassistant.components.google_assistant.http] Request for https://homegraph.googleapis.com/v1/devices:reportStateAndNotification failed: 403
+1 404 errors having both a service account AND Homegraph API set up, or service account with Homegraph API commented out.
project_id: !secret google_proj
#api_key: !secret google_homegraph_api
#secure_devices_pin: !secret google_pin
service_account:
private_key: !secret google_private_key
client_email: !secret google_client_email
report_state: true
#expose_by_default: false
exposed_domains:
- light
- switch
- script
- fan
[homeassistant.components.google_assistant.http] Request for https://homegraph.googleapis.com/v1/devices:reportStateAndNotification failed: 404
Maybe this will be solved in next version?
https://github.com/home-assistant/home-assistant/pull/30524
Maybe this will be solved in next version?
30524
Unfortunately this PR is for if you are using the HA Cloud integration, which was incorporated in 0.103.6 and the version I am currently running. I'm following the manual setup instructions at https://www.home-assistant.io/integrations/google_assistant/#manual-setup.
I have been using the api_key configuration with no issues but after updating to HA 104.0 I see that it is deprecated and being removed in 105.0.
I switched to the service account and am now getting the 404 errors. Hopefully this is fixed before 105.0
Is api_key really deprecated? I find nothing about this in the documentation (but receive a warning from HASS).
https://github.com/home-assistant/home-assistant/pull/30402
Was merged into 104.0. You are correct that the documentation doesn't reflect the change though.
It will be removed in 0.105, so the docs will probably be updated with the release of 0.105.
I also get the Error 403 after updating to 104.0 using service account before no problems.
Now the error and no state sync, what could i do?
Thanks for updating this as a breaking change in the release notes. I also see the pending changes in the documentation at https://www.home-assistant.io/integrations/google_assistant/ so I'll leave it alone.
I found what caused the error in my setup, you need to enable the home graph api. Previously in the documentation that was explained under the api_key instructions. Now it is described under the service account under point 9 and 10, this was changed 20 hours ago. This took me a few hours to understand, hopefully it will help someone else!
Direct link to activate the home graph api: https://console.cloud.google.com/apis/api/homegraph.googleapis.com/overview
Basically I have everything done according to the instruction + enabled homegraph api, but in logs still I can find a lot of :
Request for https://homegraph.googleapis.com/v1/devices:reportStateAndNotification failed: 400
Any ideas what to do with that?
I'm also running the latest version, and have homegraph enabled/activated. And I also see the 404s in the (developer tools) log.
Same issue here with HA 0.104.3
2020-01-22 15:12:52 ERROR (MainThread) [homeassistant.components.google_assistant.http] Request for https://homegraph.googleapis.com/v1/devices:reportStateAndNotification failed: 404
2020-01-22 15:12:52 ERROR (MainThread) [homeassistant.components.google_assistant.http] Request for https://homegraph.googleapis.com/v1/devices:reportStateAndNotification failed: 404
2020-01-22 15:12:53 ERROR (MainThread) [homeassistant.components.google_assistant.http] Request for https://homegraph.googleapis.com/v1/devices:reportStateAndNotification failed: 404
2020-01-22 15:12:53 ERROR (MainThread) [homeassistant.components.google_assistant.http] Request for https://homegraph.googleapis.com/v1/devices:reportStateAndNotification failed: 404
2020-01-22 15:12:57 ERROR (MainThread) [homeassistant.components.google_assistant.http] Request for https://homegraph.googleapis.com/v1/devices:reportStateAndNotification failed: 404
2020-01-22 15:13:02 ERROR (MainThread) [homeassistant.components.google_assistant.http] Request for https://homegraph.googleapis.com/v1/devices:reportStateAndNotification failed: 404
2020-01-22 15:13:02 ERROR (MainThread) [homeassistant.components.google_assistant.http] Request for https://homegraph.googleapis.com/v1/devices:reportStateAndNotification failed: 404
2020-01-22 15:13:02 ERROR (MainThread) [homeassistant.components.google_assistant.http] Request for https://homegraph.googleapis.com/v1/devices:reportStateAndNotification failed: 404
2020-01-22 15:13:02 ERROR (MainThread) [homeassistant.components.google_assistant.http] Request for https://homegraph.googleapis.com/v1/devices:reportStateAndNotification failed: 404
2020-01-22 15:13:33 ERROR (MainThread) [homeassistant.components.google_assistant.http] Request for https://homegraph.googleapis.com/v1/devices:reportStateAndNotification failed: 404
2020-01-22 15:13:33 ERROR (MainThread) [homeassistant.components.google_assistant.http] Request for https://homegraph.googleapis.com/v1/devices:requestSync failed: 404
2020-01-22 15:13:52 ERROR (MainThread) [homeassistant.components.google_assistant.http] Request for https://homegraph.googleapis.com/v1/devices:reportStateAndNotification failed: 404
2020-01-22 15:16:47 ERROR (MainThread) [homeassistant.components.google_assistant.http] Request for https://homegraph.googleapis.com/v1/devices:requestSync failed: 404
2020-01-22 15:16:48 ERROR (MainThread) [homeassistant.components.google_assistant.http] Request for https://homegraph.googleapis.com/v1/devices:requestSync failed: 404
I wouldn't say they're the same as my error code is 400.
Yep sorry, I found out today that Google disable the "Test" after 30 days.. it was just matter of restarting the test draft app...
I've been having the same problem, and I wish it was as simple as restarting the draft app. The Homegraph api is getting sync errors (75% of the time for me, according to the cloud console).
It all became worse when I added more temperature sensors, causing many more Homegraph api 403 errors. Some of the data homeassistant is passing through to homegraph is causing sync errors. I've disabled the service_account and report_state for the time being, and at least half my devices can still be controlled.
(another user pointed this out in another thread as well https://community.home-assistant.io/t/request-for-https-homegraph-googleapis-com-v1-devices-reportstateandnotification-failed-403/148289/19 )
Same issue here with HA 0.104.3
Request for https://homegraph.googleapis.com/v1/devices:reportStateAndNotification failed: 404
@witchcraftsman the 404 error is usually linked to an old device/entity that is no longer in use by HA and needs to be removed or if you no old entities you need to say "hey google sync my devices" to clear it up. 0.104 brought back all old entities that were registered and some of those don't appear on the integration screen. You may not be using them anymore so you should delete them. If you have too many entities turn on debug logging for google assistant and it should be apparent which entity it is.
See my issue here: https://github.com/home-assistant/home-assistant/issues/30928
@witchcraftsman the 404 error is usually linked to an old device/entity that is no longer in use by HA and needs to be removed or if you no old entities you need to say "hey google sync my devices" to clear it up. 0.104 brought back all old entities that were registered and some of those don't appear on the integration screen. You may not be using them anymore so you should delete them. If you have too many entities turn on debug logging for google assistant and it should be apparent which entity it is.
See my issue here: #30928
I guess it's not my case, had a fresh installation of 0.104.2 (google action brought up at that time) on pi3 then updated to 104.3 and of course I did sync my devices thing. I have only 10 devices exposed. Using expose_by_default: true, will look into debug logs.
UPD: Limited scope to 6 devices, did a sync and still got 404s right after restart
UPD2: Another reboot gave me no immediate errors, they came a couple of minutes after, so it looks like the issue is with certain % of the requests. Nothing interesting in debug messages, just a whole exposed set of devices with states
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.
I have had this problem for some weeks too. In my case i can "sync devices" and i can control my devices through the home app. But my logs are littered with the dreaded 404 errors. So I guess my device's state is not getting posted to HomeGraph. Today I upgraded to 0.105.0, started a new project, new action and service account. All using the same project id. Still no joy. I did recently move from using HA's add-on reverse proxy to a separate server running in front of HA. That is Caddy Web Server - but my setup matches the advised guidelines for deployment. Tomorrow I might roll back to my old setup using HA's Nginx reverse proxy add-on to see if it works under that environment. So frustrating!
I might roll back to my old setup using HA's Nginx reverse proxy add-on
This made no difference. Also, up to 0.105.2 now. Same dud 404 connections to HomeGraph. I've run out of things to try.
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.
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.
Hi @pinballnewf . Sound advice, but I have ensured my Project, Actions, and Service Account all share the same project_id. Still have the errors. I see when I inspect the metrics for HomeGraph that I am getting 50% errors. Does anyone know whether that would mean that I am therefore getting 50% success over that same period??
That said. I clear my log. Operate a device exposed to Home Assistant. Check the logs and the error appears again. This particular sequence for testing is 100% consistent.
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.
Adding the api_key
back in, which I previously used for my Google Assistant integration until HA .503, resolved this for me. I will keep it there until something makes me do a complete rebuild like @PictureMil did to resolve the issue.
@nmajin - you must be running a version, earlier that v0.105.0. api_key
has been deprecated. Removed completely in 105.
@nmajin - you must be running a version, earlier that v0.105.0.
api_key
has been deprecated. Removed completely in 105.
Developer Tools > Info > Home Assistant 0.105.3
Lucky you. Stick with what works.
On Thu, 13 Feb. 2020, 12:31 pm Mark Stalpinski, notifications@github.com
wrote:
@nmajin https://github.com/nmajin - you must be running a version,
earlier that v0.105.0. api_key has been deprecated. Removed completely in
105.Developer Tools > Info > Home Assistant 0.105.3
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/home-assistant/home-assistant/issues/28541?email_source=notifications&email_token=AMVFVAWBZRH3TXG6ZYF2AJDRCSPFNA5CNFSM4JI3FAHKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELTBMOI#issuecomment-585504313,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AMVFVAS2GGA7MS7E4P2PZH3RCSPFNANCNFSM4JI3FAHA
.
I experienced this issue a couple of days ago and found that the reason was that i had inadvertently deleted the Refresh Token for the HA login session in the Google Home app. I had to unlink the account ([test] my test app) from Google Home and re-link it again. Might be worthwhile checking for someone having this issue.
I experienced this issue a couple of days ago and found that the reason was that i had inadvertently deleted the Refresh Token for the HA login session in the Google Home app. I had to unlink the account ([test] my test app) from Google Home and re-link it again. Might be worthwhile checking for someone having this issue.
Thank you so much for this clue. I also forgot that I deleted the refresh token recently, but relinking the account made it work again.
Nothing above worked for me but eventually got it working again without the errors by removing the line report_state: true from my config file. What does this piece of code do?
I believe that the "report_state" setting keeps Google updated on the
status of your devices (lights, etc.) every time they change state.
Otherwise, Google has to ask HA which lights are on after receiving a voice
command, which causes a small delay in the response from Google. I believe
most devices will function regardless of this setting, but the Google Home
App may lose track of which devices are on.
-Nate
On Wed, Mar 18, 2020 at 6:48 PM bramschats notifications@github.com wrote:
Nothing above worked for me but eventually got it working again without
the errors by removing the line report_state: true from my config file.
What does this piece of code do?—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/home-assistant/core/issues/28541#issuecomment-600773150,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AF7XJUHMBRO6SA37M7P2PA3RIECNBANCNFSM4JI3FAHA
.
Ah, that sounds plausible. Nevertheless enabling it results in many 404 errors and not able to solve the problem!
Also followed this guide:
The request_sync service may fail with a 404 if the project_id of the HomeGraph API differs from the project_id of the Actions SDK found in the preferences of your project on Actions on Google console. Resolve this by: https://www.home-assistant.io/integrations/google_assistant
My logs are currently filling up with these errors:
ERROR (MainThread) [homeassistant.components.google_assistant.http] Request for https://homegraph.go
ogleapis.com/v1/devices:reportStateAndNotification failed: 400
I have configured this integration using a service account, have the HomeGraph API enabled and the RequestSync
requests are working great.
Small edit: I was just browsing the relevant code and I noticed this issue appears on reporting the state of my local devices. Since some of my devices are currently in the state unavailable
, I'm wondering if the above log has something to do with that.
Hi, I have a problem with the new sort of integration. My garage door will not open anymore. Google ask for the security code... I say 1234... Google answers with "sorry, I do not understand that". It was without issues before 0.105.
@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 👍
I'm also experiencing this issue (more specifically regular 400 errors from the Homegraph API) in Home Assistant 0.107.7.
Exact error message:
Request for https://homegraph.googleapis.com/v1/devices:reportStateAndNotification failed: 400
I'm using a service account and enabled the Homegraph API for the relevant project.
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.
Actually, turns out my service account was also generated for the wrong project (incorrect value in the project dropdown can be very easily missed during new account generation!). Once I updated the service account details, the 400 errors disappeared from the logs 🎉
I don't know how but after another couple of retries, starting from scratch, i fixed the problem. first generate the key, then link the account in to the project In actions console. Also do not use local login for home assistant when setting up the integration in the home assistant app.
I have also the problem in version 0.107.7
2020-03-30 18:41:43 ERROR (MainThread) [homeassistant.components.google_assistant.http] Request for https://homegraph.googleapis.com/v1/devices:reportStateAndNotification failed: 400
I never had an issue before.
same problem in 0.107.07
Request for https://homegraph.googleapis.com/v1/devices:reportStateAndNotification failed: 404
Although it doesnt seem to effect operation. According to google cloud console it obly fails < 2% of the time...
but still, it bugs me :) alwyas proud of a clean log without errors :)
Same here - I get an automated email on warning/error logs so false positives are annoying...
Would we consider a retry for the push state so we only log as errors if the second (or n) retry fail as well? If yes I could try a PR to add such a (configurable?) number of retries.
For those having these problems, my solution of removing my sensors (2 temperature and 2 humidity) worked. I was even able to keep report_state to true. I have kept all my switches and media players connected, and they have been working well for months, barring some very infrequent 500 errors.
I'm not sure if just fewer api calls to report states fixed 404/403 issues, or if the data being sent from those sensors (which have a couple decimal places) caused the issue.
Same error in HA 0.109 version
API enabled:
1 day:
30 days:
Same here...
Any DevGod here able to help us please?
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:
1) Modify your .storage/google_assistant
file, 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)
2) Just unlink you [test]app in google home app; delete .storage/google_assistant
, restart HA, and then re-link it again. New proper .storage/google_assistant
will be generated.
Good luck.
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:
- Modify your
.storage/google_assistant
file, 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)- Just unlink you [test]app in google home app; delete
.storage/google_assistant
, restart HA, and then re-link it again. New proper.storage/google_assistant
will be generated.
Good luck.
Thanks god!!! Thank you very much, really, now i have a clean error log :)
I added 2nd user (Viewer access) at
https://console.cloud.google.com/iam-admin/iam
Let's see it helped or not :)
- Modify your
.storage/google_assistant
file, 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)- Just unlink you [test]app in google home app; delete
.storage/google_assistant
, restart HA, and then re-link it again. New proper.storage/google_assistant
will be generated.
Good luck.
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_assistant
Thanks @sergiigladchuk
I configured the google_assistant for the first time under v110.4 and started getting the 404 errors:
[homeassistant.components.google_assistant.http] Request for https://homegraph.googleapis.com/v1/devices:reportStateAndNotification failed: 404
I did a logger.set_level service call with:
homeassistant.components.google_assistant: debug
and then in the log I started seeing the devices that were causing the issues:
xxxxxxxxxxxxxxxxxxxxxxxxx', 'agentUserId': 'xxxxxxxxxxxxxxxxxxxxxxxxx', 'payload': {'devices': {'states': {'light.dock_1': {'online': True, 'brightness': 0, 'on': False}}}}} was {
2020-05-30 18:14:34 ERROR (MainThread) [homeassistant.components.google_assistant.http] Request for https://homegraph.googleapis.com/v1/devices:reportStateAndNotification failed: 404
2020-05-30 18:15:00 DEBUG (MainThread) [homeassistant.components.google_assistant.report_state] Reporting state for sensor.testsolar_temp2: {'online': True, 'thermostatTemperatureAmbient': 23.9}
2020-05-30 18:15:00 DEBUG (MainThread) [homeassistant.components.google_assistant.http] Response on https://homegraph.googleapis.com/v1/devices:reportStateAndNotification with data {'requestId': 'f8913
I was then able to verify that those devices were indeed having some issues so now I have just excluded them and the errors have gone away.
I'm running into this problem. I have a z-wave switch I'm trying to control via Google Assistant and it kinda works. If I say "turn off window decorations" or "turn on window decorations" the switch works and flips nearly immediately.
If I go into the Google Home app and try to trigger the switch to flip by pressing the button, the switch doesn't flip and I'm getting the 404 in the logs occasionally:
2020-06-16 00:46:20 ERROR (MainThread) [homeassistant.components.google_assistant.http] Request for https://homegraph.googleapis.com/v1/devices:reportStateAndNotification failed: 404
I turned on debugging like @fcassirer before me and I see very similar output:
2020-06-16 00:46:20 DEBUG (MainThread) [homeassistant.components.google_assistant.report_state] Reporting state for switch.leviton_dzr15_1lz_receptacle_switch: {'online': True, 'on': True}
2020-06-16 00:46:20 DEBUG (MainThread) [homeassistant.components.google_assistant.http] Response on https://homegraph.googleapis.com/v1/devices:reportStateAndNotification with data {'requestId': 'CENSORED', 'agentUserId': 'CENSORED', 'payload': {'devices': {'states': {'switch.leviton_dzr15_1lz_receptacle_switch': {'online': True, 'on': True}}}}} was {
"error": {
"code": 404,
"message": "Requested entity was not found.",
"status": "NOT_FOUND"
}
}
Problem is, unlike him, that switch is correct and I also see it in the list of entities on the entities screen. The whole purpose of me setting up the integration is to be able to flip that switch (and a couple similar devices that I have not migrated over yet).
I'm not sure what to do next...
Another data point, the switch flips that should get triggered by pressing the button in the Google Home app often come in a couple minutes later. I'll be sitting here and I'll hear a couple rapid-fire clicks as the switch quickly turns itself off and back on. The voice commands happen immediately, the button clicks seem to get queued somewhere and applied much later.
Another data point, the switch flips that should get triggered by pressing the button in the Google Home app often come in a couple minutes later. I'll be sitting here and I'll hear a couple rapid-fire clicks as the switch quickly turns itself off and back on. The voice commands happen immediately, the button clicks seem to get queued somewhere and applied much later.
Have you tried “Hey Google, sync my devices” to ensure everything is synced up with Google Home?
Have you tried “Hey Google, sync my devices” to ensure everything is synced up with Google Home?
Yes, unfortunately many times.
I think I just solved my 404 issue actually. I unbound Home Assistant and then opened up Google Console and deleted everything so I could recreate my project from scratch and be sure I wasn't accidentally crossing wires. That seems to have worked. I'm theorizing that my previous attempt at setting up the integration may have accidentally pulled in some settings from two separate projects.
I'll keep an eye on it. If the 404s returned I'll report back here.
The long multi-minute delays when hitting the toggle buttons is still happening, but I don't want to derail this ticket. That seems to be a separate issue.
Can one add more information to error message log for Request for https://homegraph.googleapis.com/v1/devices:reportStateAndNotification failed: 404
like what entity has been requested?
And maybe it shouldn't be an error, but a warning?
Relevant issue #30928.
After debugging a little bit, after the suggestions in this thread, I found that issue #28834 are causing my errors:
2020-10-04 12:42:31 DEBUG (MainThread) [homeassistant.components.google_assistant.http] Response on https://homegraph.googleapis.com/v1/devices:reportStateAndNotification with data {'requestId': '[redacted]', 'agentUserId': '[redacted]', 'payload': {'devices': {'states': {'climate.office': {'online': True, 'thermostatMode': None, 'thermostatTemperatureAmbient': 20.1, 'thermostatTemperatureSetpoint': 20.5}}}}} was {
"error": {
"code": 400,
"message": "Request contains an invalid argument.",
"status": "INVALID_ARGUMENT"
}
}
Because the thermostatMode is set to None
, the sent JSON is actually invalid. I have removed the climate
devices from my Google Assistant configuration and will test this change.
I was also getting this error although control and sync was all working fine. I followed the advice of @fcassirer here https://github.com/home-assistant/core/issues/28541#issuecomment-636393112 and enabled debug logging. It then gave a message saying
HomeGraph API has not been used in project xxxxxxxxxxxx before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/homegraph.googleapis.com/overview?project=xxxxxxxxxxxx
which I was confused about because thought I had I followed the instructions to do that. I followed the link and realised that it is to enable it for the project, whereas I had enabled it for the service account. I enabled HomeGraph on the project and the errors have stopped!
It seems to me that it does not need to be enabled for the service account, only for the project. Sync my devices still works and I can still see changes straight away in the Google Home app if I make changes directly in Home Assistant.
Maybe others have the same problem.
Most helpful comment
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:
1) Modify your
.storage/google_assistant
file, 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)2) Just unlink you [test]app in google home app; delete
.storage/google_assistant
, restart HA, and then re-link it again. New proper.storage/google_assistant
will be generated.Good luck.