This plugin reads air quality data from the French PrevAir air quality network of stations across the country and exposes the air quality data from the nearest station (based on the location data of domoticz) or a specific station (if its code is provided in the plugin setup).
The devices exposed by the plugin in domoticz are:
- overall air quality index for today
- overall air quality index for tomorrow
- Detailed level for up to 6 pollutants (SO2, NO2, CO, O3, PM 10 and PM 2.5), depending on the selected station.
You can select the polling cycles for the data on the hardware page (between 1 hour and 24 hours... I recommend 1 hour as it also helps preventing the sensor devices from turning red with the default domoticz setup).
In addition, the device icons will have a different color (green, orange, red) depending on the level of the index or pollutant level (the scale might need some tweaking, bear with me on this for now)
A sample screen capture to illustrate: The code is on GitHub at https://github.com/999LV/PrevAir. I have yet to write an installation/instructions document, but I am looking for testers feedback for possible bugs or improvement suggestions, so below some basic installation instructions (on a Raspberry... you need to tailor depending on your platform/setup):
PREREQUISITE: Domoticz beta version no less than 3.7418
1. in a shell terminal, navigate to the domoticz installation folder (e.g. ~/domoticz), and:
Code: Select all
cd plugins
mkdir PrevAir
sudo apt-get update
sudo apt-get install git
git clone https://github.com/999LV/PrevAir.git PrevAir
cd PrevAir
sudo chmod +x plugin.py
sudo /etc/init.d/domoticz.sh restart
3. Enter the polling interval (1 hour recommended) and if relevant to you (see below) a specific station code (if no code is entered, the plugin will calculate the nearest station based on the atitude/longitude entered in your domoticz location settings)
4. Add” the new hardware…
note that only three devices are automatically created in the utilities tab of your domoticz (Index for today and tomorrow, name of the selected air quality station). Others (if data exists for your station) will be created automatically but marked "unused" until you manually change that setting in the devices section of domoticz.
If the default air quality station calculated is not your preferred (check www2.prevair.org for station location and pollutants surveyed), you can use a small utility I wrote that is also in the plugin installation folder to display all available station and obtain the code for an alternate station of your choice (you then need to enter this code in the plugin hardware page and hit "update" to restart the plugin with the new parameters):
Code: Select all
cd ~/domoticz/plugins/PrevAir
sudo chmod +x ListeStations.py
python3 ListeStations.py