mikejac / node-red-contrib-google-smarthome

A collection of Node-RED nodes to control your smart home devices via Google Assistant.
GNU General Public License v3.0
116 stars 37 forks source link

How to debug Google Home bypassing my commands #407

Closed RichardUUU closed 11 months ago

RichardUUU commented 1 year ago

These nodes are an amazing addition to Google Home / Home Assistant!

I have about 30 virtual devices working, however there is one problem.

Usually I'll say something like: 'Office Lights on' and the google speaker plays a notification tone and the lights go on. Perfect.

However, if I say 'Kitchen Lights on' the google speaker plays a verbal response: 'Okay, turning on four lights.' and several other lights go on as well but I don't know why.

I've tried clearing out anything that could be a conflict inside Node Red and Google Home. I have removed 'Kitchen' as the room hint for the other three lights. I'm wondering if there is a significance to the verbal response vs. the notification tone. I'm wondering how google home is making a connection to my other lights when they are not attached to the Kitchen Lights device.

How do I debug this?

Caprico85 commented 1 year ago

Hi @RichardUUU,

unfortunately there is no tool to debug what's going on during a command.

So, these are just some ideas on what i would check:

Did you add debug nodes to the output of the devices in Node-RED to see if only the correct device nodes are triggered?

How many kitchen lights do you have? Respectively, when Google says "Turning on four lights", are these four lights the four kitchen lights you would expect? Or do you have maybe only two lights and Google somewhere sees two other lights.

What I'm trying to find out is where the problem happens exactly. It could be Google identifying too much lights as kitchen lights. Or it could be node-red-contrib-google-smarthome handling the message from Google wrong and giving output on too many device nodes. Or maybe the nodes connecting to the physical device are configured wrong (like setting a wrong topic in a MQTT node). Or maybe it's even the physical device configured wrong (like a Tasmota smart bulb having the wrong MQTT topic set in its admin UI).

RichardUUU commented 1 year ago

Thanks @Caprico85,

Putting debugs on every device is a great idea.

I think what I'm seeing is the fundamental flaw of "intent" based systems. When I say kitchen lights, google is guessing at what I mean even though I am perfectly happy to specifically limit defined terms. In Node Red, 'kitchen lights' actually triggers a script that activates up to six different lights.

I was hoping that when google only replies with a chime, it means it's only going to Node Red, but when google replies with a voice response it means it's guessing at what I want. At least that way it would be a clue.

Anyway, since 'lights' is such an integral term, I'll redo my commands to reflect scene names (e.g. 'Kitchen Work' for all the lights etc.) That means I'm training the people to say what the computers need rather than the other way around, but it won't be the last time that apps designed for 'convenience' end up doing the opposite.

None of this takes away from the miracle that is your add-on. Cheers and thanks.