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.

Yes, the current support for those kind of devices is very limited.
But as you already stated, extended support is already developed and “just” needs to be rolled out.

Regarding the speed mapping… The current docs state this explanation:

Dimmer { ga="Fan" [ speeds="0=away:zero,50=default:standard:one,100=high:two", lang="en", ordered=true ] }

speeds will be a comma-separated list of modes with a percentage number followed by an equal sign and different aliases for that mode after a colon. So here both “high” and “two” would set the speed to 100%.

Is this confusing and requires some rework?

1 Like

Hi! Thank you for the reply :slight_smile: looking forward to that rollout :slight_smile:

Yes I think that the documentation is misleading (in the sense that not all purifier brand bindings might work that way, or accept those commands.) because of this:

The google home metadata “speed mapping” doesn’t work as I assumed. The values that google home uses (percentages) are sent directly to openHAB.

So when I state a command to google “set the purifier to low”, openHAB receives “25%” instead of what the Levoit binding was expecting, which was 1,2,3 or 4. (which corresponds to each speed level at the binding level.)
I played with that same description from the docs you shared, and it didn’t work on my end, I still only receive the percentage.
The google assistant metadata I have is the following, do you happen to see any errors?

So the issue is, I believe, that when I say “switch to low” it sends “25” to the Levoit binding. And the binding is expecting “1”.
In the end, I created a rule to convert the % to a number, and push that to another item which then updates the channel with the correct value. It works, but it’s a roundabout way to about it.

Or maybe I misinterpreted something crucial and that’s why I’m sharing with the community:) happy to receive any feedback!

If you need it like this, why not trying a configuration like

Dimmer { ga="Fan" [ speeds="0=off:stop,1=low:one,4=high:four", lang="en", ordered=true ] }

1 Like

:no_mouth: ← my dumb face if that works….
That definitely should be detailed in the docs with a couple of clear examples :slight_smile: I went back and forth and did not understand that was a possibility at all. To make things worse I follow the example code - to a fault- as you can probably guess :slight_smile:

This weekend I’ll try it out and give feedback :slight_smile: cheers friend!

Edit: @michikrug thank you for the time you invested in this already. Smallish update, i did managed to advance a bit:
I created a new “fan speed” dimmer item in the fan speed channel:

The binding does not react to the dimmer item. Whatever value I put there it resets back to what the first item of the picture is set to.
But if I change the dimmer to Number:Dimensionless then it picks the value up.
If I switch from dimmer to a number:dimensionless, Google Home no longer picks up the device at all. No matter how many times I sync, it simply doesn’t pop up.
Switch from number to switch and it pops up as a relay, no speed control.
Switch to dimmer again, and it also pops up in google home, with speed control.
Switch to Number:dimensionless, nothing on openhab (commands don’t work) and on google home no dice.

Now, I thought about the rule I created (using the % values) and I edited it with your suggested command:
This works! This simple change simplified my conversion rule! - but I still need a dimmer item to receive the commands from google home, and then to forward it to the item of the binding channel because:
A number:dimensionless airpurifier metadata item is not picked up by google home at all.
A dimmer item in the channel does not work with the thing.
A switch does not offer the speed control function I want.

So, still kinda stuck, but at least things are working as I expect them to work.

Thanks for the update.

The current implementation indeed does limit the Fan device to either a Switch or a Dimmer item.
Number is not supported. (Should also be stated in the docs.)

All those things will change with the upcoming rework of the fan functionality, where you will be able to use a specific speed item (also as Number) next to other controls.

1 Like

Yep I’m aware, that’s really great and I’m looking forward to it. I recently learned that I can also apparently help with the docs so I’ll try to add some of my comments or hints to the air purifier section as well.
I just hope that google adds compatibility for the sensors that air purifiers may have once and for all.