Google assistant and door sensor

Hello all,

I just had my new xiaomi door sensors and i would kike to know if possible to expose these to google assistant. With zigbee2mqtt they are binary_sensors in hass and when exposing to google assistant i can see it on my home application (square icon with cog on it) but there’s no touch control and i couldn’t find the voice command to ask if my door is closed or not.
Maybe i did not exposed it correctly ?

I just added the binary_sensor to entities to expose to google assistant. When asking “is my front door opened ?” I get an answer like this device is not yet configured.

Found this :
https://github.com/home-assistant/home-assistant/pull/22674

But no doc…

Any help appreciated !

Haven’t tried that yet, but one thing I wanted you to check/confirm was that you had set your device class correctly for your binary_sensor. If not google would only know if it’s on or off, won’t know if it’s open or closed…

I already thought about device class and i think it’s already correct because in frontend the binary sensors are represented as “open”/“closed” with the correct door icon.
I tried to set device_class: door to the binary sensors too in my customize.yaml but no luck (restart of HA and google devices sync done !)

Add the device to a room in the home app and see if that helps

  binary_sensor.0x00158d0002703569_contact:
    expose: true
    name: Porte d'entrée
    room: Séjour

It’s already done :confused:

make sure you ask in the same room as google home is assigned to

Hmm, asked with room name, entity name, set a nickname in home app and ask on it if it’s open or close don’t gives any result…
Did you already achieve to make this work ?

In home app i see that device type is “door”. The room is correctly set.

yup all of my contact sensors work properly but i have to ask from the same room the home is in. So my Den home hub will only tell me about my den window or den sliding door…it wont tell me about the kitchen because teh speaker and devices are not assigned to the same room. I think its a google bug.

Ahhh… I’m not at home at the moment and was asking to my phone. So maybe that can be the trick !
Will try and report asap !

But, just to mention it, it looks like stupid :weary:, it means a google home per room where we have sensors…

Hmm its working on my phone as well when I ask about the device specifically so maybe its something else :confused:

edit: here is my config in case it helps https://github.com/dshokouhi/Home-AssistantConfig/blob/7d4bdca2ea827dabd0df36686d674efc350e7c4b/configuration.yaml#L684

Will do some more testing with moving the entity to another room. Thx for your help anyway.

I’ve the same issue. I use the Google home in French.
I tried many phrase without success to have the status of the door/window sensor.
@SNoof85 did you find a solution ?

Hey there,

Nope did not find any solution, and i have to admit that i’ve gave up. Probably related to french language.

You could use IFTT. So, create a phrase like “What’s the state of front door” or “Is the front door open” as an IFTT trigger, then get it to send off a webhook to Home Assistant. When you setup the JSON string to send, include the sensor name, and a request type like “check_door”. That way you can just setup one HA automation that can check for any sensor, and create a bunch of IFTT phrases for each sensor you might want to check on. The automation can then cast to your google home the state of the sensor

Thanks for sharing and digging across old topics to help others :wink:

I’ve been trying again an again a Google native solution but still no luck. Now i do not want to rely on IFTTT service that i find so slow times to times. I know this is like relying on Google because it is same kind of cloud service but Google is always fast and has enough power to handle everyone. It seems that IFTTT does not have this ability. I’ve always found that there was a big lag with everything dealing with IFTTT, but for sure that could be a solution. But i won’t go for it :slight_smile:

I absolutely understand IFTT can be pretty slow. Using some non-directly compatible sensors, i have to use IFTT to integrate with HA and they can be pretty slow to update.

Just a thought on your problem, have you tried typing a request into assistant to see if it knows what you mean? I was able to replicate this problem with my door sensor in english. If I speak to google home asking it about my back door, it doesn’t work, but if I type it on the phone, it works.

If that works for you too, then just create a new routine in google home, setting the trigger event as the phrase you want in any language, and then in add action, just type whatever text that worked on your test. like this below.

If you’re having trouble with french, maybe also try to type it into assistant in English and see if that works too? It maybe a translation issue on google side. Good luck!

Just a quick question, how is setup your binary sensor for this door ? Do you have any device_class on it ?
If you go to device settings of backdoor_sensor in home app, what do you have ? Mine is seen as a device type : door

For this particular sensor, in home assistant, it’s just a binary sensor updated by an IFTT webhook. I then use a value template to give it a ‘door open’ or ‘door closed’ icon for the lovelace UI, based on the binary sensor value.

In Google Home, it’s integrated through a connection to Wyze Home, the manufacturer. It shows up like you explained yours does, like a little grey box with a cog on it. If I tap on that entity it tells me that the device type is Door, and is connected through the Wyze home.

Are your sensors exposed to google by Home Assistant, or the “add device by manufacturer” mechanism. (for lack of a better term :slight_smile:)

My sensor is exposed by home assistant, this is Xiaomi sensors, with zigbee2mqtt.
I’m quite sure this is something with French language. Will try in English but this won’t be a solution. Wife acceptance factor would dramatically drop with Google Home in English :smile:

Please try this test: open your assistant app on the phone, switch to the keyboard and type the request in English. Be sure to explicitly address the door sensor exactly as it is named in Google Home. Like: “Is the backdoor_sensor closed?”
If Google assistant comes back with the correct status of the door, you’re in luck, and my suggestion above will work for you.
In the Google Home app, tap “routines”, slide down to the bottom of the routines menu and tap “manage routines”. In the next screen, tap “Add a routine”. In the blank new routine, tap “Add Commands”. The command you add will be what you say verbally to your Google Home/Nest speaker. So add it in French (something like “La porte arrière est-elle fermée?”). You can add as many ways that you might ask the question to google verbally here, so be sure to add a few. After you’ve done that, in the “Assistant will” section, tap add action. This is where you type in English, the command that worked in your test, like “Is the backdoor_sensor closed?” Once you are done, you can speak to your google home speaker in French, and it will send off the request to google assistant in English, and answer you back with the state of the door in the default language.

2 Likes