I have no idea how to explain this weird behavior of the Google Home app. It looks like a bug with report_state, being too fast or too slow and making the app reporting laggy value of the device states.
When I turn on a light, it show: ON (yeah!), OFF (oh…), ON (yeah!)
When I turn off a light, it shows: OFF, ON, OFF.
Here is a video where I toggle on/off each device (and the group of devices), one after each other:
Setup:
HASSIO 9.0, latest updates installed
Installed on a Synology VM
Host network (the VM has its own IP)
Accessible from outside with Synology DDNS + Let’s encrypt certificate + Reverse proxy
No Nabu Casa
It’s working in the end, but it’s bothering me
Anyone experienced similar issue?
It’s not that unusual in my experience.
You are using google to send a command to HA this will by nature have a slight delay (normally Google’s fault) as the command needs to be sent then actioned, then the new state needs to be seen by google hence the chop and change.
I believe (but stand to be corrected) that if you don’t use nabu casa then this is all cloud based and not run locally.
I use nabu casa purely for google and don’t tend to see these delays anymore. However I only expose things to google so that they can be voice activated as that’s pretty much all google is useful for (google is not and never will be any good at smart home - it’s a voice assistant). I use the home assistant app to toggle things on and off because it’s instant and error free.
I have a similar issue with Google home. In my case turning on the light reports on then off. (But the light stays on) the when trying to switch it if I press the button end nothing happens (the light stays on but state is now reported as on) the when impress again the light turns off but then reports the wrong state again. (This is Google home app on iPhone)
For reference I also tried Google home app on an android one phone and guess what… there it works perfectly fine.
Thanks for the reply. This is not what I wanted but at least I can see I’m not alone in this boat.
I’ll need to run some other tests, but the delay seems to cause issue when 2 actions are asked to Google Home to fast one after another, which happens when my SO ask something, and I ask something to correct it super-fast after.
Any updates on this? I’m seeing this behavior too— when I turn on a light through Google Home, the status briefly flips to On before flipping back to off (although the light itself shows off).
This occurs both with manually-configured Google Home support as well as through Nabu Casa. I’m glad I’m not the only one with the problem, but it is disappointing that there might not be a fix.
Hello! I’ve managed to patch the issue described by OP by using an automation that manually triggers a Google sync request when an assistant query is fired. I’ve tried using the same method to fix the delay in the Google Home app but I haven’t been able to get that working (something with delays maybe?)
The feedback on my Google home hub now reflects the actual state of the lights I control with it at least, so that’s a start.
alias: Request Google Home sync when a Google Home request is made
description: ""
trigger:
- platform: event
event_type: google_assistant_query
- platform: event
event_type: google_assistant_command
action:
- service: google_assistant.request_sync
data:
agent_user_id: [YOUR_ACCOUNT_ID]
mode: single
It’s probably not the most efficient way of handling this but since I have a dedicated machine running various docker containers for my smart needs I’m not worried about that too much.
Update:
I managed to get the home app working too!
I did it by getting rid of the report_state: true in the google_assistant integration in the config.yml and adding a delay of 700ms between the event above firing and requesting the sync. I’m not sure if the delay matters because i messed around with that before removing the report_state from the integration but it works now so i’m not touching it!
This behaviour is still happening to me, using the Google Home app on iOS.
Even more frustrating, sometimes it does not pick up the state change at all and requires me to click on the light again in the GHome app (or exit the app) to update the state. (IE turning a light off, the button will go on->off->on and stay on until I press the button again). @Pixel-Null 's solution with the manual assistant sync automation did not work for me. The lights themself are responsive to commands via google home but it seems to be just a problem with updating the reported state.
Just throwing my hat into the ring… same issues. If i refresh the google home app it will pull the correct status. I assuming its a sync issue and the automation is going down the right track. I’ll give it a whirl
The automation definitely helps. The status flips back and fourth but it ends with the correct status within a second. Seems like its a little faster with the delay enabled.
I’m running into this same issue here. Freshly reconnected Google Assistant via Manual hosting with Local Fulfilment and report_state: true.
Tried the work arounds here but from what I could tell from the debug logs the SYNC operation does not actually push any state information. This is only communicated via the response to a QUERY or via reportStateAndNotification.
For me, the automation only triggered the SYNC and no state information was sent nor subsequently requested. The way I could get the correct state shown in the Google Home app is to flip away from the Devices tab and then back again. This triggers a QUERY and then with that response, the UI is updated to the correct states. Obviously this sucks.
I did try and look into the actual messages getting sent back and forward. It seems that after the EXECUTE intent to turn the light on, HA responds with a state update with the previous/current state of the switch - i.e. if you are turning it on, it will reply and say the state is off. According to the HomeGraph docs:
Your fulfillment should process each command, transmit it to the corresponding device, and return the new state in the EXECUTE response.
So it seems to me that the HA response here is incorrect.
I think HA queues the command in an async queue, then queries the state of the entities in question, perhaps before the queue has been processed. I feel that, according to the docs, we should wait until after fulfilment to respond with the new states.
HA does queue a subsequent call to reportStateAndNotification and supply the correct, new state, but this seems to be too late and/or the Google Home App doesn’t “see” or ignores this update (not sure if local fulfilment in some way gets in the way here or changes things?) and instead just relies on the EXECUTE response and any updates from a QUERY operation.
Anyway, I’ve opened the upstream issue so hopefully some developers can confirm or comment on my suspicions.