home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.59k stars 29.91k forks source link

Google Assistant Report State Start Up Error #30928

Closed dshokouhi closed 4 years ago

dshokouhi commented 4 years ago

Home Assistant release with the issue:

0.104.0 ( May have seen it earlier too?)

Last working Home Assistant release (if known):

Probably around 0.102, might be earlier since the error showed up when I enabled report state

Operating environment (Hass.io/Docker/Windows/etc.):

venv Integration:

google assistant https://www.home-assistant.io/integrations/google_assistant/

Description of problem:

After enabling report state by setting up a service account I started seeing the following error. I tend to see about 6-8 of them on every restart after updating to 0.104.x

Google assistant is still working as expected so not sure what this error is about.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

google_assistant:
  project_id: !secret google_project
  service_account: !include JSON
  report_state: true

Traceback (if applicable):

2020-01-17 16:50:28 ERROR (MainThread) [homeassistant.components.google_assistant.http] Request for https://homegraph.googleapis.com/v1/devices:reportStateAndNotification failed: 404
2020-01-17 16:50:28 ERROR (MainThread) [homeassistant.components.google_assistant.http] Request for https://homegraph.googleapis.com/v1/devices:reportStateAndNotification failed: 404
2020-01-17 16:50:28 ERROR (MainThread) [homeassistant.components.google_assistant.http] Request for https://homegraph.googleapis.com/v1/devices:reportStateAndNotification failed: 404
2020-01-17 16:50:28 ERROR (MainThread) [homeassistant.components.google_assistant.http] Request for https://homegraph.googleapis.com/v1/devices:reportStateAndNotification failed: 404
2020-01-17 16:50:28 ERROR (MainThread) [homeassistant.components.google_assistant.http] Request for https://homegraph.googleapis.com/v1/devices:reportStateAndNotification failed: 404

Additional information:

probot-home-assistant[bot] commented 4 years ago

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!

Eklacin commented 4 years ago

Had the same issue... Check If you really have actived "Homegraph API" for your current Google project... Maybe a reconnect in the Google Home App is necessary as well. After than the error was gone... At least for me

dshokouhi commented 4 years ago

I do have it activated because I was previously using the API key. Syncing my devices still works too.

Eklacin commented 4 years ago

That's the thing... I'd was using resync all the time with the API key, but my Homegraph API was disabled... I resetup Google Assistent so many times before, i might have missed it at some point. I switched to service account with 0.104 and got those errors...

dshokouhi commented 4 years ago

just double checked and mine is indeed still enabled and the errors still show up, so it must be different here.

elupus commented 4 years ago

You can turn on debug logging to Soo which entity triggers it.

It's usually an entity that is reported that for some reason was not part of the sync.

dshokouhi commented 4 years ago

@elupus ah ha! I suspect the recent change in 0.104 probably triggered more of these updates. I can see now its trying to sync an entity that I no longer have! I saw 4 instances of this so I have removed them :) Before HA 0.104 these entities were never added but since they existed in the registry they got re-added.

2020-01-18 09:49:05 DEBUG (MainThread) [homeassistant.components.google_assistant.http] Response on https://homegraph.googleapis.com/v1/devices:reportStateAndNotification with data {'requestId': 'REQUEST_ID', 'agentUserId': 'AGENT_ID', 'payload': {'devices': {'states': {'climate.thermostat_furnace': {'online': False}}}}} was {
  "error": {
    "code": 404,
    "message": "Requested entity was not found.",
    "status": "NOT_FOUND"
  }
}

After removing these entities, the start up error is gone! Just a thought but maybe we will want to make that error message a bit more verbose to help the user quickly identify the offending entities?

Now after those start up errors were resolved there is still one more larger debug statement that houses all the entities. I just checked each entity and they are all valid and available. This error still shows up.


2020-01-18 09:54:26 DEBUG (MainThread) [homeassistant.components.google_assistant.http] Response on https://homegraph.googleapis.com/v1/devices:reportStateAndNotification with data {'requestId': 'bf9c66533af142d292a82eea53c3333c', 'agentUserId': '8290db6a0fc449a491470c631e1e5d77', 'payload': {'devices': {'states': {'scene.goodnight': {'online': True}, 'scene.colorful': {'online': True}, 'scene.goodbye': {'online': True}, 'scene.cleaning_mode': {'online': True}, 'camera.frontyard_driveway': {'online': True}, 'camera.garage_side_gate': {'online': True}, 'camera.frontyard_side_gate': {'online': True}, 'camera.ferret_cage': {'online': True}, 'camera.kitchen_side_gate': {'online': True}, 'camera.patio': {'online': True}, 'binary_sensor.garage_frontyard': {'online': True, 'openPercent': 0}, 'camera.baby_monitor': {'online': True}, 'sensor.office_air_purifier_temp': {'online': True, 'thermostatTemperatureAmbient': 23.3}, 'sensor.living_room_air_purifier_temp': {'online': True, 'thermostatTemperatureAmbient': 18.9}, 'sensor.bedroom_air_purifier_temp': {'online': True, 'thermostatTemperatureAmbient': 18.9}, 'sensor.den_air_purifier_temp': {'online': True, 'thermostatTemperatureAmbient': 19.4}, 'input_boolean.vacation_mode': {'online': True, 'on': False}, 'input_boolean.guest_mode': {'online': True, 'on': False}, 'script.baby_monitor_snapshot': {'online': True}, 'script.pc': {'online': True}, 'script.cast_kitchen': {'online': True}, 'script.xbox': {'online': True}, 'script.netflix': {'online': True}, 'script.roku': {'online': True}, 'script.pseudo_tv': {'online': True}, 'camera.den_camera': {'online': True}, 'cover.bedroom_curtains': {'online': True, 'openPercent': 0}, 'cover.bay_window_curtains': {'online': True, 'openPercent': 100}, 'cover.nursery_curtains': {'online': True, 'openPercent': 0}, 'cover.den_curtains': {'online': True, 'openPercent': 100}, 'light.garden_lights': {'online': True, 'brightness': 0, 'on': False}, 'light.firepit_lights': {'online': False}, 'light.counter_lights': {'online': True, 'brightness': 0, 'on': False}, 'light.corner_lamp': {'online': True, 'brightness': 0, 'on': False}, 'light.biased_lights': {'online': True, 'brightness': 0, 'on': False}, 'light.toshs': {'online': True, 'brightness': 0, 'on': False}, 'light.bar_flex': {'online': True, 'brightness': 0, 'on': False}, 'light.dannys': {'online': True, 'brightness': 0, 'on': False}, 'light.cabinet_lights': {'online': True, 'brightness': 0, 'on': False}, 'light.tv_lights': {'online': True, 'brightness': 0, 'on': False}, 'light.fig_tree_lights': {'online': True, 'brightness': 0, 'on': False}, 'light.hallway_light': {'online': True, 'brightness': 0, 'on': False}, 'camera.living_room_camera': {'online': True}, 'light.office_lights': {'online': True, 'brightness': 0, 'on': False}, 'light.spot': {'online': True, 'brightness': 0, 'on': False}, 'switch.bedroom_fan': {'online': True, 'on': False}, 'switch.nursery_heater': {'online': True, 'on': False}, 'switch.den_fan': {'online': True, 'on': False}, 'switch.living_room_fan': {'online': True, 'on': False}, 'switch.kitchen_tv': {'online': True, 'on': False}, 'switch.fireplace': {'online': True, 'on': False}, 'switch.nursery_fan': {'online': True, 'on': True}, 'switch.nursery_tv': {'online': True, 'on': False}, 'switch.den_shield': {'online': True, 'on': True}, 'switch.bedroom_shield': {'online': True, 'on': False}, 'switch.house_fan': {'online': True, 'on': False}, 'binary_sensor.bedroom_door': {'online': True, 'openPercent': 0}, 'binary_sensor.mailbox': {'online': True, 'openPercent': 0}, 'binary_sensor.garage_backyard_door': {'online': True, 'openPercent': 0}, 'binary_sensor.catio_pool_door': {'online': True, 'openPercent': 0}, 'binary_sensor.catio_firepit_door': {'online': True, 'openPercent': 0}, 'binary_sensor.bathroom_door': {'online': True, 'openPercent': 0}, 'light.side_gate_light': {'online': True, 'on': False}, 'light.bathroom_night_light': {'online': True, 'brightness': 0, 'on': False}, 'input_boolean.night_mode': {'online': True, 'on': False}, 'input_boolean.movie_mode': {'online': True, 'on': False}, 'sensor.bathroom_temperature': {'online': True, 'thermostatTemperatureAmbient': 22.7}, 'light.front_door_lamp': {'online': True, 'brightness': 0, 'on': False}, 'light.bookshelf_left': {'online': True, 'brightness': 0, 'on': False}, 'light.nook_lamp': {'online': True, 'brightness': 0, 'on': False}, 'light.patio': {'online': True, 'brightness': 0, 'on': False}, 'input_boolean.shower_mode': {'online': True, 'on': False}, 'switch.catio_siren': {'online': True, 'on': False}, 'switch.side_gate_siren': {'online': True, 'on': False}, 'input_boolean.gardener': {'online': True, 'on': False}, 'input_boolean.cat_litter_cleaned': {'online': True, 'on': True}, 'input_boolean.guest_sleeping': {'online': True, 'on': False}, 'input_boolean.baby_sleeping': {'online': True, 'on': True}, 'vacuum.mr_neato': {'online': True, 'isDocked': True, 'isRunning': False, 'isPaused': False}, 'sensor.bbq1_temperature': {'online': True, 'thermostatTemperatureAmbient': 24.5}, 'vacuum.mrs_neato': {'online': True, 'isDocked': True, 'isRunning': False, 'isPaused': False}, 'camera.outdoor_camera': {'online': True}, 'binary_sensor.den_window': {'online': True, 'openPercent': 0}, 'binary_sensor.office_closet_door': {'online': True, 'openPercent': 0}, 'binary_sensor.bedroom_closet_door': {'online': True, 'openPercent': 0}, 'binary_sensor.front_door': {'online': True, 'openPercent': 0}, 'binary_sensor.den_sliding_door': {'online': True, 'openPercent': 0}, 'binary_sensor.bathroom_window': {'online': True, 'openPercent': 0}, 'binary_sensor.office_door': {'online': True, 'openPercent': 0}, 'binary_sensor.kitchen_window': {'online': True, 'openPercent': 0}, 'binary_sensor.living_room_right_bay_window': {'online': True, 'openPercent': 0}, 'binary_sensor.office_window': {'online': True, 'openPercent': 0}, 'binary_sensor.living_room_side_window': {'online': True, 'openPercent': 0}, 'binary_sensor.living_room_left_bay_window': {'online': True, 'openPercent': 0}, 'binary_sensor.bedroom_window': {'online': True, 'openPercent': 0}, 'sensor.kitchen_window': {'online': True, 'thermostatTemperatureAmbient': 20.1}, 'camera.kitchen': {'online': True}, 'light.bedroom_lights_level': {'online': True, 'brightness': 0, 'on': False}, 'light.living_room_lights_level': {'online': True, 'brightness': 100, 'on': True}, 'switch.island_lights_switch': {'online': True, 'on': False}, 'light.kitchen_lights_level': {'online': True, 'brightness': 98, 'on': True}, 'light.den_lights_level': {'online': True, 'brightness': 29, 'on': True}, 'switch.garage_lights_switch': {'online': True, 'on': False}, 'switch.backyard_lights_switch': {'online': True, 'on': False}, 'switch.little_christmas_trees_switch': {'online': True, 'on': True}, 'switch.christmas_tree_switch': {'online': True, 'on': False}, 'switch.siren_switch': {'online': True, 'on': False}, 'light.bathroom_lights': {'online': True, 'brightness': 0, 'on': False}, 'climate.thermostat': {'online': True, 'thermostatMode': 'off', 'thermostatTemperatureAmbient': 20.0}}}}} was {
  "error": {
    "code": 404,
    "message": "Requested entity was not found.",
    "status": "NOT_FOUND"
  }
}

2020-01-18 09:54:26 ERROR (MainThread) [homeassistant.components.google_assistant.http] Request for https://homegraph.googleapis.com/v1/devices:reportStateAndNotification failed: 404

Any thoughts on how to resolve this one? A bit harder to pin down :)

elupus commented 4 years ago

Yes that is a bit harder to find. And you issued a sync recently? One of the entities in that list have never been synced to Google.

If you issued a sync, and the issue remain we have a bug where we sync and report different, which we should solve.

dshokouhi commented 4 years ago

Last time I issued a sync was a week or so ago, I did not issue a sync after removing the unused entities. I went ahead and issued one and did a restart. The errors that showed up immediately are now gone. I will open up a docs PR once: https://github.com/home-assistant/home-assistant.io/pull/11778 is merged to avoid a potential conflict :) Thanks again for your help!

greberg commented 4 years ago

Have two similar issues that reports in the log. One is due to zwave which happens at start up. I believe it is as with Homekit that I want to be able to start Google Assistant service after zwave is finished loading.

Second, Im not sure about. I get this error: 2020-03-05 13:39:01 DEBUG (MainThread) [homeassistant.components.google_assistant.http] Response on https://homegraph.googleapis.com/v1/devices:requestSync with data {'agentUserId': 'b7c4499d130e44d39c74a9c00b89a605'} was {}

I have issued a sync but still get both issues.

balloob commented 4 years ago

Your second one is not an error, it's a debug logging. Please open a new issue if you experience once.