Xiaomi Sensors and Google Assistant

Can we allow Google Assistant to get data from sensors via HomeAssistant?

I have Xiaomi Temp sensors that are working with HomeAssistant and I would like to get data from them through my Google Home.

I have the Google Assistant setup completed successfully and I have the following added to my customize.yaml for the sensor:

sensor.temperature_158d0001b952a3:
friendly_name: 1st Floor Temp
google_assistant: true
google_assistant_type: climate
aliases:
- living room temp
I have also added the sensor to the “Living Room” in the google home app.

When I ask my Google Home “What temperature is it in the living room?” she replies “Sorry, I am unable to reach living room temp right now”

Would it be possible to add this functionality until the “climate” type for Google Assistant

Thanks!

Same question from me, but for all sorts of temperature sensors (Xiaomi, Aeotec Multisensor, Philips Hue Motion Sensor’s temperature values).

And - related but not the same - I wonder if it would be possible to set the target temperature on a climate component like the Danfoss Z-Wave thermostats for radiators.

Did this work? I am in similar situation… 5 Xiaomi Temperature sensors around the house and would like to ask google home (already setup) about the temperature in each room

I’m interested too. Not for just my xiaomi sensors but but homemade ones also…

This is what I’m using on 0.61.1, a modified version of @rofrantz pull request. You’ll need to go to your components/google_assistant/smart_home.py file and replace the code with this:

–removed due to updated PR –

Make sure you relink/resync your assistant. I’m able to expose my Celsius temperature sensors using the following under the google_assistant entity_config:

sensor.entry_temp:
  type: climate
  expose: true
  name: entry

Its definitely rudimentary code compared to the original pull request but for my needs it works with 0.61.1, so apologies if you stumble into errors.

No @KKlitgaard it will not work to set values as described in my PR. Sensors will ONLY report (read) values without any possiblity to set them (write).

For read & write u should probably use the existing generic thermostat component which works so far with temperature only if I’m not mistaken from the docs https://home-assistant.io/components/climate.generic_thermostat/

The PR has been updated for those interested in setting this up before it is officially merged. As per my instructions earlier it needs to replace smart_home.py in the google assistant component.

https://github.com/home-assistant/home-assistant/pull/11095

1 Like

Or they can use the dev branch install according to https://home-assistant.io/docs/installation/updating/

pip3 install --upgrade git+git://github.com/home-assistant/home-assistant.git@dev

Hi all… I’ve just updated to the latest stable build - is this in that build our do I need to still upgrade to the dev build?

Nice work!
Brendan

0.62 is the build to expose temp/humidity sensors to google assistant

Working fine for me on latest 0.62.1 but wondering… If you say

“Ok Google What is my living room temperature”

Does it respond with its status like

“Its currently X degrees and Living Room is Off”

or

“Living room is Off and its currently X degrees”

Can we get rid of the “Off” Part??

Youll get a device error, the only way you can call it at this time is ‘ok google what is the temperature in the room name?’

The query response is what is given back from google about the devices state and value so at this time there is no way to have only the value returned.

sorry for asking, but i can’t expose my xiaomi temperature sensor.

  entity_config:
    sensor.temperature_xxxx002009bb1:
      type: climate
      expose: true
      name: name of the entities

the log says that “type” is an invalid option for google assistant.

As of 0.65 you can no longer expose sensors in this manner to google assistant. You will need to create a generic thermostat that links to the temperature sensor. Then expose the generic thermostat in the entity_config for google assistant as a climate device

2 Likes

i integrate the xiamo sensor in the generic thermostat. it works. many thanks

Can you tell me how you made xiaomi sensors working with google assistant? I am really going mad to have this…

i simply added them to the xiaomi gateway. hass.io recognise the sensor automatically.

Sorry, i mean i cannot have those sensors working with Google Assistant. My question is how to have them recognized by Google Assistant like switches and lights…

the answer to your question is 6 posts up, you need to trick it.

Ok thanks… too complicated for me now…