Reporting device state back to Google

I finally got working my self-hosted gBridge on a RPi3. It works great on the way from Google Assistant to my MQQT server, but I’m having trouble updating the Assistant’s perception of the device’s state when its state changes by any other means than using Google Assistant or Google Home. For example, if I turn off the device using a different MQQT client, Google Assistant continues to think that the device is still on.

I know the state topic is the right one - It’s the same as the command topic but with a trailing “set” at the end. I can also see the MQTT message being posted on the state topic with the correct value. I’ve tried “on”/“off” and “1”/“0” for values, but it makes no difference.

Has anyone experienced something similar? If so, how did you go around troubleshooting it? I’m not sure of the best way to start. I’m fairly sure it’s something on my side, but I can’t see where in the docker-compose.yaml I may have missed an entry specific to posting state updates to Google…

Anyone?

-LuisB

I guess I can respond to myself and save people some grief.

I looked at the container code vs the “real” code, and guess what - the reporting code that posts state updates back to google was removed in the docker version. I’m guessing this was done to lower the requirements on the container, as quite a few less node.js packages are required. But man, it really had me banging my head.

I’m not a Node.js coder. I can spell it, but everything else I do with it falls into the “happy-hacking” category. I’m now trying to get all google state management code back in. Seems to be semi-happy, but now something’s not quite working with the redis. I’m guessing because I updated only the rs-worker, and some redis client out there needs to be updated too.

The saga continues…

The saga stopped and concluded that I’m an idiot.

It always worked. I concluded it wasn’t working because the Google Home app continued showing that the device was on once I had turned it off via MQQT. My silly explanation was that Google wasn’t getting state updates from gBridge, but in reality it’s just the UI in the Google Home app that does not update when the state of the device changes through a different channel. Closing the UI and forcing it to reconnect makes it show the correct state of the device.

So many hours lost… Goes to show you that you should always start with the simplest possible explanation…