Coder Social home page Coder Social logo

roscoe81 / enviro-monitor Goto Github PK

View Code? Open in Web Editor NEW
80.0 11.0 26.0 3.12 MB

An environment monitor based on a Raspberry Pi Zero W, a Pimoroni Enviro+ and a Plantower air quality sensor to monitor, display and report on air particles, gases, temperature, humidity, noise and air pressure.

License: MIT License

Python 100.00%
airquality-sensor pimoroni plantower-sensor air-quality-sensor luftdaten luftdaten-sensor environmental-monitoring pimoroni-enviroplus air-quality environmental-sensors

enviro-monitor's Introduction

enviro-monitor

Version 8.2 Gen now includes dew point measurements but the User Guide has not yet been updated to include the new displays

This project uses a Raspberry Pi Zero W, a Pimoroni Enviro+ and a Plantower air quality sensor to monitor, display and report on air particles, gases, temperature, humidity, air pressure, light levels and noise levels. There is also the option to monitor eCO2 and TVOC levels by adding an SGP30 sensor. The code is based on many of the Python examples and libraries published by Pimoroni, with a range of modifications and enhancements.

A basic weather forecast function has been added, based on air pressure levels and changes.

The light level display in the superb Weather and Light has been changed to display air quality levels. The background hue now represents the air quality level and the sun’s position is now displayed via a visible sun icon. It also provides weather forecast information, noise levels (if enabled) and has some minor changes to the humidity indicator.

The Combined function has been modified to provide improved visibility of each graph. The graph colours are based on level thresholds for each parameter and it only displays parameters that have been measured. The ‘display_everything’ method has also been modified to only show air quality parameters, in order to improve readability of the display.

The All in One function has been modified to allow cycling through the all of the Enviro Monitor’s functions.

The accuracy of the temperature and humidity measurements has been improved by undertaking extensive testing and regression analysis (between 0 and 40 degrees Celsius) to develop more effective compensation algorithms. However on their own, even these improved algorithms did not provide sufficient accuracy and it was necessary to use a 3D-printed case to separate the Enviro+ from the Raspberry Pi Zero W and connect them via a ribbon cable.

In addition to improving temperature and humidity measurements, testing and regression analysis was undertaken to provide time-based drift, temperature, humidity and air pressure compensation for the Enviro+ gas sensors. Algorithms and clean-air calibration are also used to provide gas sensor readings in ppm. A data logging function is provided to support the regression analysis. The log file for that analysis needs to be enabled and converted to a valid json format before undertaking further regression analysis.

Accuracy of the air pressure readings is delivered through altitude compensation. The altitude is set by the ‘altitude’ parameter in the config.json file.

Note: Even though the accuracy of the Enviro Monitor has been improved, the readings are still not thoroughly and accurately calibrated. The calibration exercise has been undertaken for temperatures between 0 and 40 degrees Celsius, so it's unlikely to provide effective readings outside of that range. They readings should therefore not be relied upon for critical applications.

The case is not water resistant and needs to be sheltered from the elements. The base is only required if the unit is not mounted on a vertical surface. There is a variant of the case and cover for the Indoor Plus model that monitors eCO2 and TVOC levels. This variant of the case provides additional space and airflow for the SGP30 sensor.

The case also has the option of adding a weather cover to provide additional protection from the elements. When using this cover, it is necessary to set "enable_display" in the config.json file to "false". That limits the display functionality to just air quality-based hue and serial number, as well as changing the temperature and humidity compensation variables to mitigate the effect of the cover on the temperature and humidity sensor.

Approximate noise levels measurements have been added to Version 6, based on this repository. This feature has not been calibrated and is not to be used for accurate sound level measurements. Version 6.7 has improved frequency compensation of the noise level measurement function, using this, but still further work and calibration is required. This noise level measurement function requires additional setup (described below) and after setup, needs to be enabled in the configuration file.

mqtt support is provided to enable the use of external temperature and humidity sensors (for data logging and regression analysis), interworking between the Enviro Monitor and a home automation system and to support interworking between outdoor and indoor Enviro Monitors. That interworking allows the display of an indoor Enviro Monitor to cycle between indoor and outdoor readings.

An alternative to using mqtt-linked indoor and outdoor Enviro Monitors to get outdoor readings on an indoor Enviro Monitor, is to configure the indoor Enviro Monitor to capture Luftdaten readings or Adafruit IO feeds from another Enviro Monitor.

Luftdaten interworking has been modified to support the addition of minimum, maximum and mean noise level readings. Noise level readings can be sent to Luftdaten by setting "enable_luftdaten_noise" to true in the config.json file. Note that Luftdaten can't currently be configured with three sensors per node, so noise level readings can therefore only be sent to Luftdaten if either PM or climate readings are disabled. That can be done by setting "disable_luftdaten_sensor_upload" in the config.json file to either "Climate" or "PM".

The same Enviro+ setup is used to set up the Enviro Monitor and the config.json file parameters are used to customise its functionality. A description of the config.json file's parameters is here.

Setting up of the noise level measurements requires the following additional steps:

Additional Noise Measurement Setup

Successful execution of this setup is necessary before enabling noise measurement in the config file.

sudo apt-get update

sudo apt-get upgrade

curl -sSL https://get.pimoroni.com/enviroplus | bash

sudo python -m pip uninstall sounddevice

sudo pip3 install sounddevice==0.3.15


For Versions 6.7 and later, also do:

sudo apt-get install python3-scipy

sudo pip3 install git+https://github.com/endolith/waveform_analysis.git@master


Then follow the instructions at: https://learn.adafruit.com/adafruit-i2s-mems-microphone-breakout/raspberry-pi-wiring-test including “Adding Volume Control”

Use the following instead of the documented text for ~/.asoundrc:

  1. #This section makes a reference to your I2S hardware, adjust the card name
  2. #to what is shown in arecord -l after card x: before the name in []
  3. #You may have to adjust channel count also but stick with default first
  4. pcm.dmic_hw {
  5. type hw
  6. card adau7002
  7. channels 2
  8. format S32_LE
  9. }
  10. #This is the software volume control, it links to the hardware above and after
  11. #saving the .asoundrc file you can type alsamixer, press F6 to select
  12. #your I2S mic then F4 to set the recording volume and arrow up and down
  13. #to adjust the volume
  14. #After adjusting the volume - go for 50 percent at first, you can do
  15. #something like
  16. #arecord -D dmic_sv -c2 -r 48000 -f S32_LE -t wav -V mono -v myfile.wav
  17. pcm.dmic_sv {
  18. type softvol
  19. slave.pcm dmic_hw
  20. control {
  21. name "Master Capture Volume"
  22. card adau7002
  23. }
  24. min_dB -3.0
  25. max_dB 30.0
  26. }

For versions prior to Version 6.7:

Use alsamixer to set adau7002 capture level to 50


For Version 6.7 and later:

Use alsamixer to set adau7002 capture level to 10


A User Guide provides guidance on the use of the Enviro Monitor.

Adafruit IO Support

Support is provided for streaming weather forecast, air quality, temperature, humidity, dew point, air pressure, PM concentration, gas concentration, light levels, noise levels and, with the optional SGP30 sensor, eCO2 and TVOC data to Adafruit IO. This can be enabled and set up as follows:

Config File Settings to Support Adafruit IO

The following fields in the Enviro Monitor’s config.json file need to be populated to supply data to the Adafruit IO feeds.

"enable_adafruit_io": Set to true to enable and false to disable Adafruit IO feeds,

"aio_user_name": "Your Adafruit IO User Name",

"aio_key": "Your Adafruit IO Key",

"aio_feed_window": Value between 0 and 9. Sets the start time for the one minute feed window (see Adafruit Throttling Control). Set to 0 if you only have one Enviro Monitor,

"aio_feed_sequence": Value between 0 and 3. Sets the feed update start time within the one minute feed update window (see Adafruit Throttling Control). Set to 0 if you only have one Enviro Monitor,

"aio_household_prefix": "The Adafruit IO Key Prefix for the household you’re monitoring (see Adafruit IO Naming Convention)",

"aio_location_prefix": "The Adafruit IO Key Prefix for the location of this particular Enviro Monitor. Use ‘indoor’ for an indoor monitor or ‘outdoor’ for an outdoor monitor. (see Adafruit IO Naming Convention)",

"aio_package": Set to "Premium Plus" or "Premium Plus Noise" or "Premium" or "Premium Noise" or "Basic Air" or "Basic Combo"

You will need an Adafruit IO+ account in order to use ‘Premium Plus’, 'Premium Plus Noise', ‘Premium’ or 'Premium Noise' packages and an Enviro Monitor Indoor Plus (equipped with an SGP30 eCO2/TVOC sensor) for the ‘Premium Plus’ or 'Premium Plus Noise' packages (see Adafruit IO Packages)",

Adafruit IO Feed, Dashboard and Block Setup

The script sets up the Enviro Monitor’s Adafruit IO feeds, dashboards and blocks like this example

The script can set up multiple households and locations in one run, by populating the aio_feed_prefix dictionary with the required data. The format for aio_feed_prefix is:

aio_feed_prefix = {'Household 1 Name': {'key': 'household1key', 'package': 'aio_package', 'locations': {'Location1Name': 'location1key', 'Location2Name': 'location2key'}, 'visibility': 'public' or 'private'}, 'Household 2 Name': {'key': 'household2key', 'package': 'aio_package', 'locations': {'Location1Name': 'location1key'}, 'visibility': 'public' or 'private'}}

The Household Names and Household Keys need to be consistent with those defined in the relevant Enviro Monitors’ config.json files.

For example, if you only have one Enviro Monitor for your household, and if you’ve set "aio_household_prefix" to “home”, "aio_location_prefix" to “outdoor” and "aio_package" to “Premium” in your config.json file for that Enviro Monitor, and if you want the feeds, dashboards and blocks set with private visibility:

aio_feed_prefix = {‘Home’: {'key': 'home', 'package': Premium', 'locations': {‘Outdoor': 'outdoor’}, 'visibility': 'private'}}

If you have two Enviro Monitors for your household, and if you’ve set the config.json files as "aio_household_prefix" to “home” for both Enviro Monitors, "aio_location_prefix" to “outdoor” for the outdoor monitor and “indoor” for your indoor monitor, "aio_package" to “Premium” for your outdoor monitor and “Premium Plus” for your indoor monitor, and if you want the feeds, dashboards and blocks set with public visibility:

aio_feed_prefix = {‘Home’: {'key': 'home', 'package': Premium Plus', 'locations': {‘Outdoor': 'outdoor’, ‘Indoor’: ‘indoor’}, 'visibility': 'public'}}

The two other user-defined dictionaries are aio_user_name and aio_key. These need to be populated with the same user name and key that you used in your Enviro Monitor’s config.json file.

aio_user_name = "Your Adafruit IO User Name"

aio_key = "Your Adafruit IO Key"

Adafruit IO Throttling Control

If enabled, Adafruit IO feed updates are generated every 10 minutes. The config file's aio_feed_window and aio_feed_sequence variables are used to minimise Adafruit IO throttling errors when collecting feeds from multiple Enviro Monitors. The aio_feed_window variable can be a value between 0 and 9 to set the start time for a one minute feed update window. 0 opens the window at 0, 10, 20, 30, 40 and 50 minutes past the hour, 1 opens the window at 1, 11, 21, 31, 41, and 51 minutes past the hour, 2 opens the window at 2, 12, 22, 32, 42 and 52 minutes past the hour, and so on. The aio_feed_sequence variable can be a value between 0 and 3 to set the feed update start time within the one minute feed update window. 0 starts the feed update immediately after the window opens, 1 delays the start by 15 seconds, 2 by 30 seconds and 3 by 45 seconds.

Adafruit IO Naming Convention

The naming convention for each Enviro Monitor’s Adafruit IO feeds, dashboards or blocks, is to use the name of the household, followed by the location of the relevant Enviro Monitor’s location within that household, as a prefix for each feed, dashboard or block. You choose a suitable name for "aio_household_prefix", and "aio_location_prefix" can either be “indoor” or “outdoor”. For example, setting “aio_household_prefix" to “home” and "aio_location_prefix" to “outdoor” will set the prefix of each feed’s name as “Home Outdoor “ and the prefix of each feed’s key as “home-outdoor-“. So, the Temperature Feed will have the name “Home Outdoor Temperature” and the key “home-outdoor-temperature”. The dashboard will have the name “Home” and key “home” and the temperature gauge block within that dashboard will have the name “Outdoor Temperature Gauge” and the key “outdoor-temperature-gauge”.

Adafruit IO Packages

Six Adafruit IO package options are available: "Premium" with 14 data feeds per Enviro, "Premium Noise" with 17 data feeds per Enviro, "Premium Plus" with 16 data feeds per Enviro (i.e. the addition of eCO2 and TVOC through the optional SGP30 sensor), "Premium Plus Noise" with 19 data feeds per Enviro which all need an Adafruit IO+ account; "Basic Air" with 5 air quality data streams (Air Quality Level, Air Quality Text, PM1, PM2.5 and PM10) and "Basic Combo" with 5 air quality/climate streams (Air Quality Level, Weather Forecast Icon, Temperature, Humidity and Air Pressure).

Use of Adafruit IO Noise Packages

Using the "Premium Noise" and "Premium Plus Noise" Adafruit IO packages requires configuring and enabling Noise measurements in the Enviro, using the relevant setup instructions. Version 6.5 changes the noise feeds and dashboards to show Max, Min and Mean noise levels between feed updates, whereas prior versions only showed Max noise levels between feed updates.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgements

Weather Forecast based on www.worldstormcentral.co/law_of_storms/secret_law_of_storms.html by R. J. Ellis

enviro-monitor's People

Contributors

roscoe81 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

enviro-monitor's Issues

Northcliff Enviro+ LCD control feature request

hello,
firstly thanks for such a great component. it truly maximized the potential of the Enviro+ reporting capability

I don't really have an issue, but maybe more of a feature request:
1- how can I make dashboard selection? like only show 0,4,5,15
2- how can I turn the lcd completely off while running the script / separate the lcd part so that I can turn it on/off based on other parameters?

suggestions:
how did you fit the SGP30 in the case?
how would you map the red, nh3 and oxi sensors to the devices classes listed here ?
and would I need any conversion to read them in Homekit?

thank you

Setting up adafruit feed (please help with configuration

Hi Ross

I've spent a couple of hours trying to figure how to set up the adafruit io feed with the enviro+ and particle sensors and I feel I'm just a few settings away from getting this to work. I am attaching a couple of screenshots and will also describe what I have done. I would be very grateful if you could let me know why my feeds are not appearing in the io adafruit.

  1. I am using an pi zero with Enviro+ and the particle sensor.

  2. I have edited the "Northcliff_adafruit_io_feed_setup_Gen.py" file with my details but I'm really not sure what to do with the aio_feed_prefix. I have edited that line to have only 1 property and one location. I have called these "Mermaid" and "Home". Everything else, I left as default. I have also added that package type (Basic Combo), my "aio_user_name" and "aio_key" (see screenshot 1).When I run this script, I get no errors and the feeds and dashboard are created in my io adafruit website (see screen shot 2).

  3. I then edited my config.json file to include "enable_adafruit_io: true", my aio user name and aio key. I have also edited the "aio_houselhold_prefix" to correspond to "Mermaid" and the aio_location_prefix to correspond to "Home" but I feel that this is incorrect and I do not know what to add in these fields. Everything else I left as default but will eventually change the city name to "Gold Coast" and time zone to "Queensland" (see screen shot 3).

  4. I have edited the config.json to point it in the folder where my edited config is located (see screen shot 4). I also do not get any errors when I run this script and the enviro+ monitor in my pi turn on and I can cycle through the different data types.

I think the problem is just sending the feed to io adafruit but I am really not sure how to fix this.
Please let me know what I am doing wrong. I am really excited to get this dashboard working.

Thanking you in advance,

Victor

screenshot3
screenshot4
screenshot1
screenshot2

Deployment Process

I am new to all this so bare with me. After following the Enviro+ setup, how do you then go through and utilize the config.json file in the setup? I have a raspberry pi that I have managed to get connected with the enviro plus and I can get it to activate but looking at your documentation and reading through I would like to utilize it though I am unsure how to go about doing so.

SyntaxError: Non-ASCII character '\xc2' in file Northcliff_AQI_Monitor_Gen.py on line 1103

I´m getting this error if I try to run Northcliff_AQI_Monitor_Gen.py on my Raspi Zero.

File "Northcliff_AQI_Monitor_Gen.py", line 1103
SyntaxError: Non-ASCII character '\xc2' in file Northcliff_AQI_Monitor_Gen.py on line 1103, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

If I google the error message: SyntaxError: Non-ASCII character '\xc2' in file I´m getting the hint to: https://stackoverflow.com/questions/18078851/syntaxerror-of-non-ascii-character
Set # -- coding: utf-8 -- on top of the script.

But if I do that and run the py I`m gettin this:

File "Northcliff_AQI_Monitor_Gen.py", line 1105
    temp_string = f"{data['Temp'][1]:.0f}°C"
                                            ^
SyntaxError: invalid syntax

maybe this has something to do with my location settings?

pi@raspberrypi:~/enviro-monitor $ sudo raspi-config
Generating locales (this might take a while)...
  de_DE.UTF-8...

Case

Hello,

A couple of queries please.
Is there any chance of getting a picture of the assembled case?
What is the recommended plastic for construction?

Thanks
Hugh

Your Watchdog File Name Here

Hi, really want to use this but being a novice I'm a little lost. I can work my way around most issues but struggling with this one

For now I'm using the default json file /home/pi/enviro-monitor/Config/config.json
Searching for watchdog but a little lost -- may be beyond my level at the moment

Raspberry Pi Zero W Buster, Enviro+

Appreciate your time & efforts
Regards, Ian

pi@tas:~/enviro-monitor $ python3 Northcliff_AQI_Monitor_Gen.py
2022-11-16 10:59:37.556 INFO Northcliff_Environment_Monitor.py - Pimoroni Enviro+ with noise measurement (and optional SGP30) sensor capture and display.
Supports external sensor capture and Luftdaten, mqtt and Adafruit IO Updates
Disclaimer: The noise measurement is not to be used for accurate sound level measurements.

#Note: you'll need to register with Luftdaten at:
#https://meine.luftdaten.info/ and enter your Raspberry Pi
#serial number that's displayed on the Enviro plus LCD along
#with the other details before the data appears on the
#Luftdaten map.

6.11 - Gen
Retrieved Config {'version': 'Base-6.10a', 'temp_offset': 0, 'altitude': 23, 'enable_display': True, 'enable_adafruit_io': False, 'aio_user_name': '<>', 'aio_key': '<>', 'aio_feed_window': 0, 'aio_feed_sequence': 0, 'aio_household_prefix': '<>', 'aio_location_prefix': '<>', 'aio_package': '<>', 'enable_send_data_to_homemanager': False, 'enable_receive_data_from_homemanager': False, 'enable_indoor_outdoor_functionality': False, 'outdoor_source_type': '<>', 'outdoor_source_id': {}, 'enable_noise': False, 'mqtt_broker_name': '<>', 'mqtt_username': '', 'mqtt_password': '', 'enable_luftdaten': False, 'enable_luftdaten_noise': False, 'disable_luftdaten_sensor_upload': 'None', 'enable_climate_and_gas_logging': False, 'enable_particle_sensor': True, 'enable_eco2_tvoc': False, 'gas_daily_r0_calibration_hour': 3, 'reset_gas_sensor_calibration': False, 'incoming_temp_hum_mqtt_topic': '<>', 'incoming_temp_hum_mqtt_sensor_name': '<>', 'incoming_barometer_mqtt_topic': '<>', 'incoming_barometer_sensor_id': 0, 'indoor_outdoor_function': 'Outdoor', 'mqtt_client_name': '<>', 'outdoor_mqtt_topic': '<>', 'indoor_mqtt_topic': '<>', 'city_name': 'Sydney', 'time_zone': 'Australia/Sydney', 'custom_locations': ['Townsville, Australia, Queensland, -19.26639, 146.80569', 'Thredbo, Australia, Sydney, -36.4999989, 148.2999988', 'Romsey, Australia, Victoria, -37.3581082, 144.7365582']}
2022-11-16 10:59:39.843 INFO Raspberry Pi serial: 0000000000000000
2022-11-16 10:59:39.857 INFO Wi-Fi: connected

Startup R0. Red R0: 9328.0 Oxi R0: 3327.0 NH3 R0: 2416.0
No Mender Software Version Available. Using Default
No Mender Config Version Available. Using Default
No Persistent Data Log Available. Using Defaults
Invalid Persistent Data Log. Using Defaults
Internal Temp/Hum Sensor
Internal Barometer
Raw Bar: 989.6 Comp Bar: 992.3
Reading Raw Gas sensors before warmup completed
Red Rs: 133867.0 Oxi Rs: 2333.0 NH3 Rs: 4032.0
Luftdaten Values {'P2': '822', 'P1': '1077', 'temperature': '17.93', 'humidity': '74.66', 'pressure': '98962.31'}
mqtt Values {'Gas Calibrated': False, 'Bar': [992.3, '0'], 'Hum': [74.7, '1'], 'Forecast': {'Valid': False, '3 Hour Change': 0, 'Forecast': 'Insufficient Data'}, 'P2.5': 822, 'P10': 1077, 'P1': 298, 'Temp': 17.9, 'Min Temp': None, 'Max Temp': None, 'Red': 0.16, 'Oxi': 0.11, 'NH3': 0.27, 'Lux': 11.0}
Traceback (most recent call last):
File "Northcliff_AQI_Monitor_Gen.py", line 2289, in
with open('', 'w') as f:
PermissionError: [Errno 13] Permission denied: ''
pi@tas:~/enviro-monitor $ ^C

UnboundLocalError: local variable 'parsed_config_parameters' referenced before assignment

When I run the following, I get this error:

pi@raspberrypienviro:~/enviro-monitor $ python Northcliff_AQI_Monitor_Gen.py
2022-01-24 11:09:08.579 INFO Northcliff_Environment_Monitor.py - Pimoroni Enviro+ with noise measurement (and optional SGP30) sensor capture and display.
Supports external sensor capture and Luftdaten, mqtt and Adafruit IO Updates
Disclaimer: The noise measurement is not to be used for accurate sound level measurements.

#Note: you'll need to register with Luftdaten at:
#https://meine.luftdaten.info/ and enter your Raspberry Pi
#serial number that's displayed on the Enviro plus LCD along
#with the other details before the data appears on the
#Luftdaten map.

6.11 - Gen
Config Retrieval Failed
Traceback (most recent call last):
File "/home/pi/enviro-monitor/Northcliff_AQI_Monitor_Gen.py", line 190, in
outdoor_mqtt_topic, indoor_mqtt_topic, city_name, time_zone, custom_locations) = retrieve_config()
File "/home/pi/enviro-monitor/Northcliff_AQI_Monitor_Gen.py", line 85, in retrieve_config
temp_offset = parsed_config_parameters['temp_offset']
UnboundLocalError: local variable 'parsed_config_parameters' referenced before assignment

The only thing I updated in your Northcliff_AQI_Monitor_Gen.py is the config file location:

def retrieve_config():
try:
with open('/home/pi/enviro-monitor/Config', 'r') as f:
parsed_config_parameters = json.loads(f.read())
print('Retrieved Config', parsed_config_parameters)

This is what I have in the config.json set to:

{"version": "Base-6.10a",
"temp_offset": 0,
"altitude": 2,
"enable_display": true,
"enable_adafruit_io": false,
"aio_user_name": "",
"aio_key": "",
"aio_feed_window": 0,
"aio_feed_sequence": 0,
"aio_household_prefix": "",
"aio_location_prefix": "",
"aio_package": "",
"enable_send_data_to_homemanager": false,
"enable_receive_data_from_homemanager": false,
"enable_indoor_outdoor_functionality": false,
"outdoor_source_type": "Enviro",
"outdoor_source_id": {},
"enable_noise": false,
"mqtt_broker_name": "<>",
"mqtt_username": "",
"mqtt_password": "",
"enable_luftdaten": true,
"enable_luftdaten_noise": false,
"disable_luftdaten_sensor_upload": "None",
"enable_climate_and_gas_logging": false,
"enable_particle_sensor": true,
"enable_eco2_tvoc": false,
"gas_daily_r0_calibration_hour": 3,
"reset_gas_sensor_calibration": false,
"incoming_temp_hum_mqtt_topic": "",
"incoming_temp_hum_mqtt_sensor_name": "",
"incoming_barometer_mqtt_topic": "",
"incoming_barometer_sensor_id": 0,
"indoor_outdoor_function": "Outdoor",
"mqtt_client_name": "",
"outdoor_mqtt_topic": "",
"indoor_mqtt_topic": "",
"city_name": "Newark",
"time_zone": "America/New_York",
"custom_locations": ["Townsville, Australia, Queensland, -19.26639, 146.80569", "Thredbo, Australia, Sydney, -36.4999989, 148.2999988", "Romsey, Australia, Victoria, -37.3581082, 144.7365582"]}

Is there a mistake I made in the config.json file that's causing the error? Or is there a bug in the python script? The city_name I'm using is listed in the database already https://astral.readthedocs.io/en/latest/#additional-locations

[Question] PPM readings vs other recommendation guides

Hi

First of all, thank you for this.

Secondly, this is my first project like this of sorts, so you're repo, has really helped me understand how to use the Envrio+, outside of the examples, but I'm just wondering if you could explain a little bit more about the numbers, please?

I'm trying to make an indoor air quality sensor that I can use to keep tabs on my office, nothing super accurate, just something to let me know when changes are needed with the air quality, temp and humidity, so I'm trying to extend your code so that I can output overall quality regarding the factors mentioned, but when I come to work out the levels for the cO2 I see my reading are as followed in the json file

{"Time": "Sunday 06 February 2022 @ 10:29:01", "Run Time": 39005.0, "Raw Temperature": 35.84, "Output Temp": 24.21, "Raw Humidity": 17.07, "Output Humidity": 28.9, "Output Bar": 993.4, "Raw Bar": 972.4, "Oxi": 0.16, "Red": 3.31, "NH3": 0.89, "Raw OxiRS": 17448.0, "Raw RedRS": 310803.0, "Raw NH3RS": 66298.0}

and I know that the Red output is the one I'm looking for cO2 but when I compare that with some guidance of recommended cO2 PPM they don't correlate?

image
Taken from here

Is there a table you used to work out good/bad ranges? Are your numbers shortened? or am I just completely getting the wrong end of the stick? (more likely 😅 ).

Many thanks for the help in advance!

adafruit.io has updated package offerings

commenting here to note that adafruit.io now offers 10 free streams and anything else is considered adafruit.io+ that gives you access to 60 streams for $10.00 a month or $99.00 a year.

the current Basic or Basic air scripts get you 5 or 5 streams and the preminium gets you 14 which no longer fits the free tiers. 10 isn't optimal with the PM gauge, so I ended up having to mark my license as premium and remove extra items like lux and weather to get what I wanted.

Ultimately some of the code should be refactored to allow the additional free streams. I might take a crack at this if I have some time along with changing metrics to barbarian freedom units since I live in the US

SyntaxError

Hi roscoe81,

just tried to run your program.
Getting an error message. ...line 1205 SyntaxError: Non-ASCII character ˋ\xc2ˋ...on line 1205, but no encoding declared
Maybe I did something wrong. I’m pretty new at raspbian.

Thanks a lot

Readings or compensation factors for temperature and humidity seem way off

Disclaimer: I have yet to print the case, as I've just discovered this project yesterday. If this is the only variable it seems like airflow is extremely limited in the case and a fan to circulate air may be necessary.

I had previously purchased a ribbon cable and inserted a 10 second delay in the Pimoroni code based on a YouTube video where it seemed like constantly querying for data was heating up the sensors and giving completely incorrect data. I also purchased a BME688 breakout, installed on a breakout garden on another pi. This only measures temperature, pressure, humidity and "air quality" though the last one has no implementation other than an Ohm reading. On the Enviro+, the delay and ribbon cable seemed to fix the temperature and humidity readings, but then I ran into problems with the gas sensor which lead me to finding this https://forums.pimoroni.com/t/enviro-oxide-level-slow-climb/10835/53 post on the Pimoroni forum.

I just installed this yesterday as an alternative to the "combined" version offered by the official Pimoroni code.

The pressure reading seems to be fine, as it was with the Pimoroni code.

Both the temperature and humidity reading seem off compared to both the BME688, the original Pimoroni code for the Enviro+ and an analog thermometer + hygrometer which I had also purchased to compare data.

After installing the ribbon cable: the Enviro+ has always read about 2-3C high on the temperature with the original code compared to an analog thermometer, with similar results coming from the BME688 on another Pi which are side by side. The humidity had generally been in line on all three data points, though the analog hygrometer doesn't seem to be as sensitive as either of the digital sensors, but it will move in line with them.

Now with this code, the temperature is about 5C under what the analog thermometer shows (plus another 2-3C below the uncompensated temperature on the BME688, which again remains in line with the analog thermometer). As for the humidity, it shows between 20 and 25 points higher than either the BME688 or the analog hygrometer.

No module named 'paho'

Hi,
Hi I installed paho (with sudo pip install paho-mqtt) but still I get the following error:

$ python3 Northcliff_AQI_Monitor_Gen.py 
Traceback (most recent call last):
  File "Northcliff_AQI_Monitor_Gen.py", line 5, in <module>
    import paho.mqtt.client as mqtt
ModuleNotFoundError: No module named 'paho'

Why isn't paho found?

Pillow 10 has removed the "getsize" and "textsize" methods

Hello

When using this code, I ran across a breaking change in Pillow 10 and had to force pip to install Pillow 9.5.0 to make it work. With Pillow 10 it doesn't run at all. The methods getsize and textsize have been deprecated since 9.2.0 and were removed in Pillow 10.

This (Pillow 9.5.0) generates lots of warnings:

/home/james/enviro-monitor/./Northcliff_AQI_Monitor_Gen.py:1312: DeprecationWarning: getsize is deprecated and will be removed in Pillow 10 (2023-07-01). Use getbbox or getlength instead. w, h = font.getsize(text)

/home/james/enviro-monitor/./Northcliff_AQI_Monitor_Gen.py:569: DeprecationWarning: textsize is deprecated and will be removed in Pillow 10 (2023-07-01). Use textbbox or textlength instead.

Pillow's documentation on this: https://pillow.readthedocs.io/en/stable/deprecations.html#font-size-and-offset-methods

NameError: name 'aio_version_text_format' is not defined

I have been hitting this wall all day when Setting up Premium Plus Adafruit IO:

Sending Startup Versions to Adafruit IO Code: 6.11 - Gen Config: Base Config
Traceback (most recent call last):
  File "/home/pi/enviro-monitor/Northcliff_AQI_Monitor_Gen.py", line 2198, in <module>
    feed_resp = send_data_to_aio(aio_version_text_format, version_text)
NameError: name 'aio_version_text_format' is not defined

Any tips?
My knowledge is next to zero as this is my first project...
I have followed all the guidelines - let me know if specific screenshots would help...

Thanks :)

Example json and Adafruit IO Feed Setup

Hi

This project looks incredible and I have tried to implement but without too much success. I was able to create an Adafruit account and actually saw the feeds and dashboard being created in the Adafruit IO site. However, the data did stream to the site. The Envriro+ unit was definitely working but it really seems to be a streaming issue. Specifically, I struggled with these fields in the config file:

"aio_user_name": "<>",
"aio_key": "<>",
"aio_feed_window": 0,
"aio_feed_sequence": 0,
"aio_household_prefix": "<>",
"aio_location_prefix": "<>",

and these fields in the Adafruit IO Feed Setup:

{'Property 1 Name': {'key': 'property1key', 'package': '<aio_package>', 'locations': {'': '<location1key', '': '<location2key'}, 'visibility': '<"public" or "private">'},
'Property 2 Name': {'key': 'property2key', 'package': '<aio_package>', 'locations': {'': ''}, 'visibility': '<"public" or "private">'}}

Can you provide an example of a short tutorial?

Thank you!

Victor

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.