Coder Social home page Coder Social logo

aanon4 / homebridge-purpleair Goto Github PK

View Code? Open in Web Editor NEW

This project forked from homebridge-plugins/homebridge-purpleair

6.0 6.0 3.0 95 KB

Fork of SANdood's Purple Air Homebridge package to fix the polling as well as support various sensor averages and adjustments.

License: GNU General Public License v3.0

JavaScript 100.00%
homebridge homebridge-plugin homekit minkebox purpleair

homebridge-purpleair's People

Contributors

aanon4 avatar beniaminrychter avatar dsully avatar mariusstrom avatar sandood avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

homebridge-purpleair's Issues

Add custom attribute for raw AQI

Feature Request: It would be great if there were a custom attribute for the raw AQI. This would make it visible in Eve, for instance, without the obfuscation of Excellent, Good, Poor, etc.

PurpleAir sensor replaced registered with new ID. Homebridge-purpleair no longer reads it out.

Because of a power connector failure, PurpleAir replaced my sensor. I registered the new hardware and it was given a new ID. I changed the ID in the homebridge config, changed nothing else. It is not reading data from the new ID. If I use the old ID I see the residual AQI for that ID in homebridge.

Can't imagine what could be wrong. json status reads to both the IDs at the PurpleAir server seem to work identically, but I may be missing something.

New: https://www.purpleair.com/json?show=97693
Old: https://www.purpleair.com/json?show=54167

This is not important in my life, but if you can identify the issue, it would assuage my curiosity.

Bridging granular AQI trigger to Homekit

With indoor air quality control becoming increasingly important with all the wild fires, many sensitive folks might appreciate the ability to switch on their purification devices at a lower level than the rough triggers Homekit allows (50, 100 etc.). As a feature request to the developers, I suggest to allow the user to set a trigger anywhere between 0 and 50 (or 0 and 100). Obviously, given the Apple restrictions, the Purpleair Bridge would then need to "fool" Homekit by passing on "fake" values: Say a user with asthma wants her/his purifier to kick in at an AQI of 25, Purpleair Bridge would need to tell Homekit that the values equivalent to an AQI of 50 have already been met though they are actually lower. Thank you for your consideration.

PurpleAir is discontinuing the API this plugin uses

PurpleAir has made the change and this plugin will no longer work. There is a workaround here.


As per their Using PurpleAir data document, PurpleAir is migrating all users to a new API at https://api.purpleair.com/, and will soon be blocking all access to purpleair.com/data.json and purpleair.com/json.

Users will also need to contact PurpleAir by email to get a key to access the new API, which would need this plugin to provide a place to provide that key.


Next day edit:
There may be a workaround; the sensor has a webserver open on port 80, and from that the user can find a string of data that gets reported out to PurpleAir (it can be found at http://192.xxx.xxx.xxx/json). I'm not sure how to go about doing this (my java-fu is very weak, and so far I've only got an error log a mile long to show for it), but if this string could be accessed and the readings extracted, then that would eliminate the problem of the API access altogether. There's also the option to expose the PM1.0 reading, dewpoint, and air pressure, and make these available to the user.

There'd be a bit of calculation involved though to make the values match what the PurpleAir map shows; there's the humidity and temperature divergence issues that have already been raised, but also there are two particulate sensors in the device, and this method exposes both of them as-is, so that would need to be taken care of as well (but I'm pretty sure they just average them, unless one of the sensors dies).

Incorrect plugin identifier?

HOOBS is throwing the following error upon loading the plugin:

12/8/2020, 4:54:48 PM [12/8/2020, 4:54:48 PM] Plugin 'timjwilkinson/homebridge-purpleair' tried to register with an incorrect plugin identifier: '@timjwilkinson/homebridge-purpleair'. Please report this to the developer!

Not sure if this problem also hits homebridge native, but figured I'd pass it along.

Options to disable the humidity and/or temperature sensors would be great.

I have a separate weather sensor in the same location as my PurpleAir, and the temperature and humidity sensors are much more accurate than what PurpleAir generates, so I'd like to only publish the AQI sensor to HomeKit. As it stands when I ask Siri for the temperature in the backyard it reports a range.

Ideally there could either be boolean flags in the config to show/hide the individual sensors, or perhaps some sort of option list. Just some way to only publish partial sets of the available sensors would be grand!

o find your specific "PURPLE_AIR_STATION_ID" (a string): "INSTRUCTIONS do you not work"

"To find your specific "PURPLE_AIR_STATION_ID" (a string):

Use the PurpleAir Map to locate a station (https://www.purpleair.com/map)
Open this URL in a new Window or Tab: (https://www.purpleair.com/json)
Search for the NAME of the station you found in step A (using JSONview in Google Chrome makes this a bit easier)
The Station ID is the first element in the results[:] map - you will enter this ID (1-5 digits) into the preferences for the Air Quality Station
If you have an outdoor sensor, there should be 2 entries in the big JSON file, one for each sensor. Please use only the FIRST entry - the code will find the second and average the values, as done for the PurpleAir map."

These instructions are frustrating and do not work.

Instead, you open the map, find your device, click on your device and look for the numbers after SELECT in the URL.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.