Levoit Air Purifiers Drivers

There's on/off code in the purifier drivers, too. If the switches are using the V2 API, it may be as easy as using that same payload. Or not... :slight_smile:

Within the last few weeks, my Levoit purifiers have stopped updating in Hubitat. I am not sure how long it has been, because I only recently investigated when I noticed the attributes were not changing.

Removed all devices, including Vesyncs integration. Reinstalled all drivers to the newest version. Created the virtual integration device-- which pulled in all of the correctly installed purifiers from my phone's app. I can click them off and on in my hubitat, but I can't get updated attributes (AQI, Inf, etc) which are listed in the right-hands column. The state of the on/off DOES appear when I click on it for the first time and thereafter.

The logs for the Core 400S devices is a long series of "java.lang.NullPointerException: Cannot get property 'result' on null object on line 431 (method update)"

Any help would be appreciated.

1 Like

Thanks for reporting this. I'm also seeing the null exceptions in the logs, which is something new. I'm also able to control the devices, but there's something going on in the update() method. I wonder if there's been some slight change in the JSON code that comes back from vesync.

I'll take a look this weekend.

1 Like

If I understand you correctly, this started happening before you updated the drivers, right? It's not something that started with the update of drivers?

You are correct. I actually updated the drivers BECAUSE I saw that happening. So, it is NOT a result of the new drivers.

I took a quick look. Something that has changed in the expected format of a 'getPurifierStatus' request, so the payload that comes back is an error payload without any 'result' data, but with a message saying 'illegal argument'

It'll require some digging to figure out the new format. Not too much work, but not something I'll be able to take care of on a work day. Other commands seem to still be working.

I appreciate anything you can do, and at your own pace. Your driver for the Levoit purifiers is fantastic and much needed.

~Frank

Okay, I couldn't stay away from it. The code on GitHub has been updated. You will need to replace all the drivers, including the parent device driver.

The API for getting the purifier status had changes, to that instead of requiring no 'data' element in the request JSON body, it now required an empty data element, i.e. "data": { }

And, to be clear -- this problem is not isolated to @fdwilson's installation, or mine. Anyone using the Levoit drivers should update.

v1.3 is the one that addresses this problem.

Thank you for the update/fix. The new drivers are working as expected! I appreciate your quick response!

2 Likes

Thank you for reporting!

It would have taken me weeks to notice. The last info event before this happened was 7/24 on my system, just six days after I put the last version on GH.

1 Like

Hi just got the Core 600S, in part, because of this driver. Thank you!

I'm trying to create a rule that will turn the purifier on the highest setting, if the AQI goes above 50

HE currently shows it running on 'Max', but when I try to create a RM rule there is no 'Max'.

It's also reporting AQI (from the nested device) as null. Does this need to come from the purifier device that isn't nested? I'm a total noob and have no idea how a device within a device works

Thank you



One more thing I just noticed after turning the machine off. Now HE is showing an AQI of 82, which seemed really high. So, I checked in the VE Sync app and it shows 27?


@user1510 -- since 'max' isn't a standard fan speed, you actually have to use a custom action to set it. Treat the fan as an actuator in setting up the action, and call setSpeed('max') on it:

1 Like

On the other hand, if you set the 600S to auto-mode, it'll raise the span feed based on its built-in logic for doing so. It shouldn't be necessary to use HE to control it, unless you want to gather information from several air-quality sensors and aggregate.

The number shown by the VeSync app is the PM2.5 particle metric, not the AQI, which is computed from a number of metrics, including PM2.5. When only PM2.5 is available, it's a simple mapping, but AQI is still a different number than the raw PM2.5 metric.

1 Like

Thank you!

Thank you for asking. This was a good question to ask, and hopefully it can be useful to others, too.

2 Likes

By the way, I just realized that I neglected to mention that AQI is computed from PM2.5 (and other measurements, if available) using formulas that vary from region to region. My Levoit driver uses the formula that is used in the United States.

See: Air quality index - Wikipedia

2 Likes

Thanks for clarifying! This is by far my most useful driver