[Release] PurpleAir Local Driver

I've released a PurpleAir Local Driver that pulls Temperature, Humidity, Pressure, Dew Point, AQI, RSSI as well as PM1.0, PM2.5, PM10 an VOC particle reading directly from the device, no internet connection or cloud needed.
Devices with dual lasers both values will be averaged

The code has been tested on a BME280 (Classic)and should work for other single and dual laser models.

You can download it directly from Github:

If you are using Hubitat Package Manager you can add my package repository as a custom repository:
https://raw.githubusercontent.com/sidjohn1/hubitat/main/repository.json

6 Likes

This works, thank you! I made a small edit to adjust temp/humidity as outlined here: PurpleAir Sensors Functional Overview - Sensors - PurpleAir Community

Works very smooth and well! Thank you so much!

Here are some asks for addition/iteration:

  • aqiDisplay, is used in other drivers and a concatenation of the integer value then capital word of classification, ie "10 GOOD". It would be great to have that as a out put as well as it looks neater on the dashboards
  • VOC: yes!
  • pressure: I think the unit is mBar or hPa, but in line 93 it uses inHg - I can not figure out why
  • Correction of pressure and temp and humidity per PurpleAir guide or with a fixed offset would be great.
    But it works and cuts down on data transfer!! Thanks so much!

This is a bug, the unit reports pressure in mBar. i’ll get this fixed in the next release.

I saw the doc’s for the temp and humidity recommended offsets but not pressure. If you add the docs then i’ll include pressure offsets as well.

i can add this, no worries.

My bad. PurpleAir only corrects for humidity and temp, not pressure.

I tried installing via package manager. I added the custom URL https://raw.githubusercontent.com/sidjohn1/hubitat/main/repository.json

I then attempt to install the driver by searching for "PurpleAirLocal", and package manager tells me nothing matching was found -- screenshot below.

I've added custom URLs in the past without problem. Any suggests would be appreciated.

Update: I installed the drive via copy-and-paste and then ran a "matchup" in package manager. It matched the driver up, but it still will not find anything when I search for "PurpleAirLocal".

I am running now, but curious as to why it isn't found...

Marc

If you dont do this, there is no way for HPM to find it

Thank you for the quick reply. I did add your repository to the custom list:

Is PurpleAirLocal the correct package to search for on the install page?

Per my update, I was able to install the driver with copy-and-paste and then the "match up" option in package manager found it, but the search still fails. Very strange.

I have both the local and cloud driver installed -- could that be creating confusion?

Marc

Keyword search is not a valid for custom repos, you can browse by tags or url


can you share your small edits? Should we ask to publish in the main repo?

Hello @sidjohn1 , I'm looking into Purple Air touch. I just wanted to confirm I am not required to have any of Purple Air's subscriptions to make work with Hubitat.

My code is available for you to review so you can confirm how it pulls the data, but local drivers do indicate it will work w/o issue w/o an internet connection and only happen between hubitat and the device.

I wasn’t even aware Purple Air had a subscription.

I picked up a used Touch for $40. I used your code and got the readings last Tuesday evening. It read the device and l am liking all the different readings.

I haven't had the chance to check the readings until this morning. I noticed it hasn't updated on the Hubitat side since Tuesday evening, the day I set it up. When I press poll, it says null on all the boxes then comes back up with last Tuesday's reading. I wonder if I did not install it properly.

Here's my current reading from the web:

turn on logging and send me the output

1 Like

I think this is the one you are asking?

the data in the timestamp field in hubitat comes from the purple air device itself. it s a straight pass through . that is the data the device provided at that point in time and there are no errors. My only concern is the null in aqi display and i’ll look into that when i have time.

1 Like