Levoit Air purifiers in google home

Hey everyone,
Just wanted to report my experience when adding an air purifier (Levoit 400s) to Google Home. My openHAB setup is running on a 3.3 version (can’t update yet, logistics reasons…).

Based on the documentation (Google Assistant | openHAB) this is the item you’d create:

Number { ga=“AirPurifier” } # Only percentage values for the speed

Now here’s the first issue i found, the only item types that when used would make the item appear in google home were:

  • The switch (this would make the air purifier appear as a switch type of device, only on/off behavior.)
  • A dimmer (this makes the air purifier proper appear in google home but I still would not have speed control.)

My experiments came back like this, for both the switch and the dimmer items of the Vesync binding. (Metadata added to the binding items created for the manual fan speed and on/off channels.)

Lots of “sorry I didn’t understand” when asking to adjust the fan speed.

Or my favorite:

Now, onto the fix. I read the docs but couldn’t find anything related or describing this.

The Levoit manualfanspeed item I created for the binding channel did not take kindly to receiving %s from google home.
So I created a new dimmer item and then added the google metadata air purifier for google home in that item. Immediately had the speed control working (after setting up the correct speed mappings.)

After creating a couple of rules to convert the dimmer to the Vesync binding fanspeed number item I got manual speed control working with the device.
But this situation isn’t described anywhere and i think the doc could do with a more in depth review, purely on the assumption that other vendors might be doing the same: google home only outputs percentages (25, 50 etc) but your device might have only a preset number of speeds which go by an ordered list of speeds - 1,2,3,4. Google home sends back 25, and everything is borked.

Additionally, the item “number” for the air purifier is not picked up by google home at all (which threw me for a loop for a couple of days.). Maybe the docs are wrong, or maybe I did something wrong, I would love to know how other users are handling their air purifiers in google home to learn more about this :slight_smile:

Unfortunately we are still lacking the possibility of exposing fan/air purifier speed modes from openHAB to google home, but maybe we will get that soon as I’ve seen work is ongoing there :slight_smile: looking forward to it :smiley:

And that’s it.
Hope this helps someone who might be hitting their head on the wall with one of these devices.

Any feedback is welcome!

Oh right forgot something. The google home metadata “speed mapping” doesn’t work as I assumed. The values that google home uses (percentages) are sent directly to openHAB. I assumed that if I mapped “25=low:two” that I was going to receive the mapped values “low” and “two” or “2”. Maybe a misunderstanding on my end but it does make this whole thing a little bit more involved, in having to setup rules to convert the google home values into whatever values the device understands.