homebridge-airnow icon indicating copy to clipboard operation
homebridge-airnow copied to clipboard

Binary sensors for separate pollutants

Open nielsth opened this issue 5 years ago • 2 comments

Would it be possible to add binary sensors to this plug-in? In HomeKit, binary sensors for Air Quality show the current value of a single pollutant under its details and sensors change to a triggered state when a critical value is exceeded.

Binary sensors offer more options to set up notifications and can be used to trigger automations. Such notifications can be useful as a reminder to close the window.

For reference: The Netatmo plugin for weather stations offers something similar. The indoor module of this station adds an Air Quality sensor based on CO2 levels, as well as a binary CO2 sensor. (I can add a screenshot later if you'd like)

Since this Air Quality plug-in checks the API's for quite a few different pollutants, which can result in quite a few extra tiles for binary sensors, perhaps the best way to implement binary sensors would be by adding config options to enable or disable them per pollutant. For instance, a user would be able to set up the configuration in a way that binary sensors are only added for PM2.5 and PM10 pollutants, and then not get tiles for binary sensors for NO2, O3 and other measured pollutants.

nielsth avatar Jan 08 '19 13:01 nielsth

Feel free to do a PR. I don't have the time to actively maintain, so if you would like and are comfortable I can add you as a collaborator.

ToddGreenfield avatar Jan 08 '19 13:01 ToddGreenfield

Thanks. I'll look into that when I have more time in a couple weeks :)

nielsth avatar Jan 11 '19 17:01 nielsth