michaelahern / homebridge-airthings Goto Github PK
View Code? Open in Web Editor NEWA Homebridge plugin for Airthings air quality monitors via the Airthings Consumer API.
License: ISC License
A Homebridge plugin for Airthings air quality monitors via the Airthings Consumer API.
License: ISC License
I too really appreciate the integration now possible with home bridge and your Airthings plug in!
I recently ignored low battery alerts on my Airthings Wave Plus. When the battery finally died, I got an "leak" alert from my apple home app.
That all cleared up when I replaced the battery but it led me to wonder.... The word "leak" implies a water leak to me, but perhaps you mean a radon leak? Still it's an odd word.
In any event, I found it odd that I would get a warning about a problem when I simply had a dead battery.
This plugin seems to be especially noisy, logging each read every couple minutes:
[5/7/2023, 3:30:44 PM] [Basement] {"battery":100,"co2":460,"humidity":49,"pm1":0,"pm25":0,"pressure":1014.1,"radonShortTermAvg":0,"temp":19.5,"time":1683498562,"voc":59,"relayDeviceType":"hub"}
[5/7/2023, 3:33:14 PM] [Basement] {"battery":100,"co2":464,"humidity":49,"pm1":1,"pm25":1,"pressure":1014.1,"radonShortTermAvg":0,"temp":19.5,"time":1683498709,"voc":59,"relayDeviceType":"hub"}
[5/7/2023, 3:35:44 PM] [Basement] {"battery":100,"co2":466,"humidity":47,"pm1":0,"pm25":0,"pressure":1014.1,"radonShortTermAvg":0,"temp":19.5,"time":1683498862,"voc":72,"relayDeviceType":"hub"}
[5/7/2023, 3:38:14 PM] [Basement] {"battery":100,"co2":462,"humidity":48,"pm1":0,"pm25":0,"pressure":1014.1,"radonShortTermAvg":0,"temp":19.5,"time":1683499009,"voc":72,"relayDeviceType":"hub"}
[5/7/2023, 3:40:44 PM] [Basement] {"battery":100,"co2":454,"humidity":49,"pm1":0,"pm25":0,"pressure":1014,"radonShortTermAvg":0,"temp":19.5,"time":1683499164,"voc":50,"relayDeviceType":"hub"}
Would you consider dialing it back and/or allowing configuring the log level?
First of all, thank you for creating the plug-in!
Have been using it for almost a month now and I love it!
I would like to make a suggestion for a new feature.
It will be great if we can customize the air quality standards. for example, exclude humidity and temperature from the air quality score and only use PM2.5 and VOC like the US EPA standards.
Lastly, it will be great if we can customize the threshold for the CO2 sensor.
Thank you!
Arithings Wave Plus (and other sensors) has ability to connect via bluetooth and pull all of the metrics from it without going into the cloud.
For example Airthings has repo that shows this ability.
I think this ability can be added to the package by reimplementaton of the package above into JS/TS.
Could you consider adding such functionality to the package? (I'm willing to help with it)
Looks like Airthings has removed the ability to generate API keys from the dashboard. They have updated their documentation on generating oath here: https://developer.airthings.com/docs/api-authorization. Are there any free and open web api's that you can use to generate these?
I read in other Airthings plugin descriptions, that they managed to show the radon values in EVE App.
Is there a chance to implement the radon values for the EVE App in this plugin?
There is only 3 levels of AQ (green yellow red) in Airthings, but there are 5 levels of AQ in HomeKit (Excellent, good, fair, inferior, poor), please correspond Airthings AQ level as numbers to each of the 5 level of HomeKit AQ.
Currently the best level in HomeKit is Fair when Airthings AQ is the best (good)
I noticed today that the AirThings app was showing my PM2.5 count as yellow, but Home was showing it as poor. I saw in the app that the PM2.5 poor threshold was changed from 25 ug/m3 to 35 ug/m3, so the plug-in no longer matches AirThings. Can this be changed or made customizable?
Note the AirThings support page still shows the old thresholds, but the iOS app shows the new ones. https://help.airthings.com/en/articles/5367327-view-understanding-the-sensor-thresholds
All other tiles show up in the accessories view on Homebridge.
I would like to see the Radon tile as well.
Is it possible to display the current C02 level in the homekit icon similar to how Temp and Humidity levels are shown?
First of all, thank you for this awesome plugin!
I have been trying to use e.g. 2.5 PPM sensor data in my automations. Unfortunately this only works as long as I do not restart Homebridge. After a restart, the 2.5 PPM condition is gone from my automation.
Complete noob here, but as the AirThings View do not appear in Homebridge cached accessories, maybe this is the cause for my automations to stop working after a restart?
If so, would it be possible to cache the devices?
Just trying to set this up and I'm getting 400 bad request
. All the config fields where cut and pasted from the dashboard and I've checked them three times now. So I'm at a bit of a loss as to what to do next to get this to work.
[23/12/2022, 13:36:04] [Airthings Device] Launched child bridge with PID 806974
[23/12/2022, 13:36:05] Registering accessory 'homebridge-airthings.Airthings'
[23/12/2022, 13:36:05] [Airthings Device] Loaded homebridge-airthings v0.8.0 child bridge successfully
[23/12/2022, 13:36:05] Loaded 0 cached accessories from cachedAccessories.0EA3EB7E922D.
[23/12/2022, 13:36:05] [Airthings View Plus] Device Model: View Plus
[23/12/2022, 13:36:05] [Airthings View Plus] Serial Number: 2960034246
[23/12/2022, 13:36:05] [Airthings View Plus] Radon Leak Sensor: Enabled
[23/12/2022, 13:36:05] [Airthings View Plus] Radon Leak Threshold: 150 Bq/m³
[23/12/2022, 13:36:05] [Airthings View Plus] Refresh Interval: 150s
[23/12/2022, 13:36:05] [Airthings View Plus] Token Scope: read:device:current_values
[23/12/2022, 13:36:05] Homebridge v1.6.0 (HAP v0.11.0) (Airthings Device) is running on port 50459.
[23/12/2022, 13:36:05] [Airthings View Plus] Response Error: 400 Bad Request
[23/12/2022, 13:36:05] [homebridge-airthings] This plugin generated a warning from the characteristic 'Current Temperature': characteristic was supplied illegal value: null! Home App will reject null for Apple defined characteristics. See https://homebridge.io/w/JtMGR for more info.
Hi there! Great plugin, thanks a lot. I am running a View Plus. The detailed sensor values are being read out correctly, as shown in the log:
{"battery":100,"co2":739,"humidity":57,"pm1":6,"pm25":6,"pressure":958.4,"radonShortTermAvg":15,"temp":22.8,"time":...,"voc":181,"relayDeviceType":"hub"}
I have understood, that HomeKit limits the type of values that can be displayed, so radon cannot be displayed, right?
But the values themselves are also displayed wrong, e. g. "VOC Density" is shown to be "550" (incorrect) though the read out value is "181" (correct) (see log above).
Do I have to do any corrections in the configuration or do you have an idea what's wrong.
Thanks in advance!
I have an Airthings View Plus. I added it to Homebridge and a water detector was incorrectly added to HomeKit and it is always showing as "leak detected". I can't find any way to remove the water detector accessory which shouldn't be there.
I set the radon detection to 4. The AirThings View Plus is currently showing 0.1, so it shouldn't be showing a "leak".
Edit:
Never mind it looks likes this plugin uses different units than AirThings does.
Updated Radon Threshold to 200 from 150 in Settings, Apple Home still sending notifications when level rises above 150.
"radonLeakThreshold": 200,
"refreshInterval": 300,
"tokenScope": "read:device:current_values",
"accessory": "Airthings"
Hello, I am using view plus connected to my wlan and pluged with usb power supply. also i do have a wave mini connected to the view plus. my smart home is running on homebridge. the data from the view plus can be seen in apple homekit. how can i also see the data from the wave mini in homekit?
Thanx for support
Long awaited, now it's here .. thanx to Michael for the plugin.
I can confirm that the following devices are recognized by the plugin and are shown in HomeKit (each defined as a single accessory and in my case configured as sub-bridges):
All three devices are connected to an Airthings Hub.
Radon is not known by Apple HomeKit, so there is no value for radon.
Hello!
I wonder if this is possible or is there some limitation that prevents this? I can see in other threads that its available in 3rd party HomeKit applications though. But it would be nice to have it in the Apple Home app aswell.
Right now the plugin only queries for updated API data when Homekit asks for an update (e.g. when you open the Home app, it tries to refresh the status of all your devices). This means that automations that you make that trigger when a sensor moves above or below a threshold will not fire until you open the Home app to check the status of your home.
Solution: The plugin should periodically request updated API data on its own and push that data to Homekit using the Characteristic.updateValue() function. Home hubs can then properly fire automations based on the sensor data.
I've made a fork that does this, it seems to work except for some weird warning I get:
This plugin generated a warning from the characteristic 'Status Active': Characteristic not in required or optional characteristic section for service Service. Adding anyway..
I'll try and figure out why its saying that before I make a PR.
The VOC µg/m³ value as reported by the AirThings dashboard does not match the µg/m³ value as reported in Home.
Looking at the code it looks like the calculation is completely wrong.
According to https://www.breeze-technologies.de/blog/air-pollution-how-to-convert-between-mgm3-µgm3-ppm-ppb/
Concentration (µg/m3) = molecular weight x concentration (ppb) ÷ 24.45
The code is doing some weird calculation involving temperate and pressure.
homebridge-airthings/src/plugin.ts
Line 257 in 5198e29
The molecular weight can be calculated by comparing values in the dashboard when set to ppb and µg/m3. By my calculation it is 55.653
As Apple HomeKit supports to show the battery status for HomeKit devices: is it possible to implement the battery status for the Airthings devices (does the Airthings API provide the value)?
Dear Michael,
thanks a lot for your plugin, it works like a charme (unless the values are not frequently updated, what makes automation problematic).
Do you think that it is possible, to implement the fakegato-history module to have graphs in Eve?
Best
jb
Dear Michael,
Very interesting solution you have come up with! I'm currently using a View Plus Business together with a Hub, despite your instructions I can't get any data from the api. I'm constantly getting
2-8-2022 17:15:04Airthings BridgeAirthingsERRORResponse Error: 400 Bad Request
errors. Do you know if the Business API is different from the consumer API?
Thanks,
Kishan
The weather plugin "naofireblade/homebridge-weather-plus" uses occupancy sensors to display values for example of cloud cover, Wind speed, Wind direction and others which are normally not supported by Apple HomeKit.
Might this be a way to show radon values or mold index (Wave Mini)?
I am not sure about air pressure, if this is a native HomeKit value or also just displayable as an occupancy sensor (?)
Issue with polling data from Airthings API - this progressively stops working after working 1st time only. I have deleted the API on Airthings Dashboard and recreated it. I then update the plugin JSON file with the config and it works briefly and then it stops again. Values in Homekit are all now zero, or the sensor is ignored/disabled. Please can you fix....
Here is the log:
[7/18/2022, 5:21:36 PM] [Kitchen-Airthings] Request failed with status code 429
[7/18/2022, 5:21:36 PM] [homebridge-airthings] This plugin generated a warning from the characteristic 'Current Temperature': characteristic was supplied illegal value: null! Home App will reject null for Apple defined characteristics. See https://homebridge.io/w/JtMGR for more info.
[7/18/2022, 5:21:36 PM] [Lounge-Airthings] Request failed with status code 429
[7/18/2022, 5:21:36 PM] [homebridge-airthings] This plugin generated a warning from the characteristic 'Current Temperature': characteristic was supplied illegal value: null! Home App will reject null for Apple defined characteristics. See https://homebridge.io/w/JtMGR for more info.
[7/18/2022, 5:21:36 PM] [Guest-Airthings] Request failed with status code 429
[7/18/2022, 5:21:36 PM] [homebridge-airthings] This plugin generated a warning from the characteristic 'Current Temperature': characteristic was supplied illegal value: null! Home App will reject null for Apple defined characteristics. See https://homebridge.io/w/JtMGR for more info.
[7/18/2022, 5:21:36 PM] [Hall-Airthings] Request failed with status code 429
[7/18/2022, 5:21:36 PM] [homebridge-airthings] This plugin generated a warning from the characteristic 'Current Temperature': characteristic was supplied illegal value: null! Home App will reject null for Apple defined characteristics. See https://homebridge.io/w/JtMGR for more info.
[7/18/2022, 5:21:36 PM] [Gym-Airthings] Request failed with status code 429
[7/18/2022, 5:21:36 PM] [homebridge-airthings] This plugin generated a warning from the characteristic 'Current Temperature': characteristic was supplied illegal value: null! Home App will reject null for Apple defined characteristics. See https://homebridge.io/w/JtMGR for more info.
[7/18/2022, 5:21:36 PM] [Office-Airthings] Request failed with status code 429
[7/18/2022, 5:21:36 PM] [homebridge-airthings] This plugin generated a warning from the characteristic 'Current Temperature': characteristic was supplied illegal value: null! Home App will reject null for Apple defined characteristics. See https://homebridge.io/w/JtMGR for more info.
[7/18/2022, 5:21:36 PM] [Master-Airthings] Request failed with status code 429
[7/18/2022, 5:21:36 PM] [homebridge-airthings] This plugin generated a warning from the characteristic 'Current Temperature': characteristic was supplied illegal value: null! Home App will reject null for Apple defined characteristics. See https://homebridge.io/w/JtMGR for more info.
[7/18/2022, 5:24:06 PM] [Office-Airthings] Request failed with status code 429
[7/18/2022, 5:24:06 PM] [homebridge-airthings] This plugin generated a warning from the characteristic 'Current Temperature': characteristic was supplied illegal value: null! Home App will reject null for Apple defined characteristics. See https://homebridge.io/w/JtMGR for more info.
[7/18/2022, 5:24:06 PM] [Hall-Airthings] Request failed with status code 429
[7/18/2022, 5:24:06 PM] [homebridge-airthings] This plugin generated a warning from the characteristic 'Current Temperature': characteristic was supplied illegal value: null! Home App will reject null for Apple defined characteristics. See https://homebridge.io/w/JtMGR for more info.
[7/18/2022, 5:24:06 PM] [Gym-Airthings] Request failed with status code 429
[7/18/2022, 5:24:06 PM] [homebridge-airthings] This plugin generated a warning from the characteristic 'Current Temperature': characteristic was supplied illegal value: null! Home App will reject null for Apple defined characteristics. See https://homebridge.io/w/JtMGR for more info.
[7/18/2022, 5:24:06 PM] [Guest-Airthings] Request failed with status code 429
[7/18/2022, 5:24:06 PM] [homebridge-airthings] This plugin generated a warning from the characteristic 'Current Temperature': characteristic was supplied illegal value: null! Home App will reject null for Apple defined characteristics. See https://homebridge.io/w/JtMGR for more info.
[7/18/2022, 5:24:06 PM] [Lounge-Airthings] Request failed with status code 429
[7/18/2022, 5:24:06 PM] [homebridge-airthings] This plugin generated a warning from the characteristic 'Current Temperature': characteristic was supplied illegal value: null! Home App will reject null for Apple defined characteristics. See https://homebridge.io/w/JtMGR for more info.
[7/18/2022, 5:24:06 PM] [Kitchen-Airthings] Request failed with status code 429
[7/18/2022, 5:24:06 PM] [homebridge-airthings] This plugin generated a warning from the characteristic 'Current Temperature': characteristic was supplied illegal value: null! Home App will reject null for Apple defined characteristics. See https://homebridge.io/w/JtMGR for more info.
[7/18/2022, 5:24:06 PM] [Master-Airthings] Request failed with status code 429
[7/18/2022, 5:24:06 PM] [homebridge-airthings] This plugin generated a warning from the characteristic 'Current Temperature': characteristic was supplied illegal value: null! Home App will reject null for Apple defined characteristics. See https://homebridge.io/w/JtMGR for more info.
on higher VOC levels i get a warning like the following:
[05/01/2022, 19:58:04] [homebridge-airthings] This plugin generated a warning from the characteristic 'VOC Density': characteristic was supplied illegal value: number 1705.4481447162475 exceeded maximum of 1000. See https://git.io/JtMGR for more info.
[05/01/2022, 19:58:03] [Wohnzimmer WavePlus] {"battery":100,"co2":642,"humidity":46,"pressure":952.9,"radonShortTermAvg":96,"rssi":-48,"temp":18.4,"time":1641409069,"voc":556,"relayDeviceType":"hub"}
by using this online converter on the given data with a molecular weight of 78, i would expect a value of about 1.8, not 1705 like in the error message.
could it be, that the units "ppm" (as used by airthings) and "ppb" (as used by many formulas) have been mixed?
To confirm, works with an Airthings Hub and two Wave Plus sensors. I mistakenly configured the Hub as an accessory alongside the two Wave Plus sensors - but quickly realized the Wave Plus sensors are the only accessories that need to be configured in Homebridge in my case. Samples are being successfully refreshed every 150 seconds (battery, co2, humidity, pressure, radonShortTermAvg, rssi, temp, time, voc, relayDeviceType). Haven't found a HomeKit app that displays pressure and radon levels, but not sure that's something that's supported or not. Keep up the great work!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.