openhab / openhab-google-assistant

openHAB Google Assistant: Actions on Google for openHAB
Eclipse Public License 2.0
176 stars 86 forks source link

[Feature Request] air purifier sensor states missing #402

Open SeveranExp opened 1 year ago

SeveranExp commented 1 year ago

Hi! Hope I’m doing this right! I’m currently looking to build an air purifier management system, and while reading the google docs I found this: https://developers.google.com/assistant/smarthome/guides/airpurifier

But the documentation over on openHAB seems to indicate that Air Purifiers are basically treated as fans. I’d like to ask if the “read sensor state” is something that is possible to add, because most current air purifiers carry some form or another of sensors (air quality, air particles, filter cleanliness…) and if possible this would be very google to expose to google.

Thank you!

michikrug commented 1 year ago

Yes. In theory this is possible. BUT... querying sensor data does mostly not work as expected. At least I did not find a proper way to do so. The thing I got working is the automatic notification when a certain value is observed. BUT this will not work with the current public openHAB integration and was only implemented in a personal proof of concept.

My recent work will soon add support for sensor data, but again it's likely that this functionality is not well supported by Google home and assistant.

SeveranExp commented 1 year ago

Yes. In theory this is possible. BUT... querying sensor data does mostly not work as expected. At least I did not find a proper way to do so. The thing I got working is the automatic notification when a certain value is observed. BUT this will not work with the current public openHAB integration and was only implemented in a personal proof of concept.

My recent work will soon add support for sensor data, but again it's likely that this functionality is not well supported by Google home and assistant.

Humm is it an issue in googles side? I’m open to reaching out to them through their own forum an ask for assistance. or in other terms, I can annoy them for a statement and maybe a fix :D can you provide some additional information regarding the issues or would you prefer i link the post I create and you’ll add context later?

michikrug commented 1 year ago

Well if you look at https://developers.google.com/assistant/smarthome/traits/sensorstate there is no example stated on how to query such values. Google seems to for now only provide options to notify on state changes. And as already said, this functionality is unfortunately not possible with the current setup of openHAB and this integration.

So feel free to reach out to them and ask for assistance on how to query sensor state values.


Even my Air Purifier that also integrates temperature, humidity, filter lifetime and pm25 does only provide an on/off switch in Google Home 😢 and I did not find any way to ask for a value using the assistant either. Except for temperature and humidity - there it works like for thermostats, but without any user interface display.

SeveranExp commented 1 year ago

Well if you look at https://developers.google.com/assistant/smarthome/traits/sensorstate there is no example stated on how to query such values. Google seems to for now only provide options to notify on state changes. And as already said, this functionality is unfortunately not possible with the current setup of openHAB and this integration.

So feel free to reach out to them and ask for assistance on how to query sensor state values.

Even my Air Purifier that also integrates temperature, humidity, filter lifetime and pm25 does only provide an on/off switch in Google Home 😢 and I did not find any way to ask for a value using the assistant either. Except for temperature and humidity - there it works like for thermostats, but without any user interface display.

Sorry for the late reply, too much has happened since my last post :) Could I bother you to check the link you shared above and check if the examples listed there are new? (I honestly don’t remember) Because we have there AQI sensor examples now, for sensors that report in parts per million, text or even both.

Hoping that maybe this is something new and usable… cheers :)