[RELEASE] Air Things Wave Plus support + HM3301 laser PM2.5 (using Grove I2C)

The Air Things Wave Plus is an air quality sensor that measures temperate, humidity, pressure, TVOC, and Carbon Dioxide plus separate short term and long term Radon averages. It only broadcasts via bluetooth and their proprietary protocol. There is supposed to be a hub coming soon, but like many Hubitat users I don't want to let it go out to the web only to have to fetch it back.

Unfortunately this means we need a bluetooth capable device, an ESP32 or properly configured Arduino board would work fine, but to me a $10 Pi Zero W is the better option. I have created a script with a config file that is meant to be run as daemon on that device.

Add my Virtual Air Quality Monitor as a driver and create an instance. Make note of the device ID.

Create a MakerAPI app and share only this device. Make note of the AppID and Access Tokens

Install the script and config. Edit the config file to include your Hubitat ip address, the serial number of your wave plus and the other items noted above.

Run the script manually as Python version 2 (it seems like the bluetooth library Airthings used requires it) to test and if acceptable install it as a daemon. (There are TONS of walkthroughs on the web for this if you need help)

Note even though I have a lot of OO based language experience this is my first experience with Python. I did not have time to research how to create a file to auto load the python library dependencies, but you will see them as you run it manually until they are all resolved. (ex: sudo pip install bluepy OR sudo pip2 install bluepy)

3 Likes

Added support for the HM3301 laser PM2.5 sensor. I'm using the Seeed version with i2c via a Grove connector (too shaky to solder anymore).

I wrestled with this a ton and even tried the system commands and then found the seeed code that wasn't part of their main repository as far as I can tell. Anyway. These two pieces when installed together should be in the same directory to share the same config file. (All the Hubitat stuff is the same for both since it's the same virtual device).

Hi - Any idea why the script is failing for me? Getting the error below:

Traceback (most recent call last):
File "AQIToMakerAPI.py", line 162, in
requests.get("{}/apps/api/{}/devices/{}/errorNotFound/?access_token={}".format(makerAPIHostname, makerAPIAppID, makerAPIDeviceID, makerAPIToken))
File "/usr/lib/python2.7/dist-packages/requests/api.py", line 75, in get
return request('get', url, params=params, **kwargs)
File "/usr/lib/python2.7/dist-packages/requests/api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 519, in request
prep = self.prepare_request(req)
File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 462, in prepare_request
hooks=merge_hooks(request.hooks, self.hooks),
File "/usr/lib/python2.7/dist-packages/requests/models.py", line 313, in prepare
self.prepare_url(url, params)
File "/usr/lib/python2.7/dist-packages/requests/models.py", line 387, in prepare_url
raise MissingSchema(error)
requests.exceptions.MissingSchema: Invalid URL

Looking at the code, Im confused why it has the /error NotFound on line 162.

I was really lax with which side I edited and it’s possible there are issues. I’ve gotta pending check in I. The morning after I give it long enough to run,

However I think the problem you have is an older Hubitat virtual air quality monitor. I’m not used to a commit only updating my box and needing an
other push to update the server. If your driver doesn’t have that method check hit hub tomorrow. I’m getting that look so I’ll check back in the morning.

Thanks for the reply - I just added the virtual device today from the Git, so its new from that view - of course, not sure about the posted code though :slight_smile: No rush at all, my airthing just came in today and I just tried the integration quickly to see if it worked.

So couldn’t sleep yet again.... So the more streamlined code that won’t let connection issues take it down (as often) is both committed locally and pushed.

Ok, so there are tons of issues, but most are special case past there. If you got a call to not found it literally means that.

Have you tried the actual demo app from airthings that prints to the console?
Make sure Serial number is the actually serial number not the MAC. Their code and therefore this code do a scan find it, instead of a direct lookup. I tried to find a library that would let me a access direct, but they’d all return errors about I initialization.

I asked about the demo app because between the zero and the wave plus the Bluetooth strength is absolutely pathetic. I get failures with them directly opposite on either side of a 3’ hallway. If their app can’t print then either the range is too great or the serial number is wrong. If you poke around their github, there is a serial number finder if you don’t want to pull the unit from the wall to check.

The hub is now out. Any interest in making what you have done work for the hub too?

6 Likes

Any news? Is anyone using this setup ?

1 Like

Air Things have a WIFI connected hub now. Can it be used somehow to get the data from the sensors without the need for BT devices ?

2 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.