Best air quality sensor for weewx

848 views
Skip to first unread message

František Slimařík

unread,
Apr 23, 2021, 2:04:22 AM4/23/21
to weewx-user
Hello,

I'd like to ask those who already use some air quality sensors connected with weewx what is the best option these days. When I check commercial weather webs I usually see values PM2.5, PM10, CO, O3, SO2, NO2. Do we have some all-in-box solution for these values already? Or it's necessary to build it from modules? I saw Arduino has many modules which can be plugged but not sure if I have enough time to play with that :)

Thanks for hints

Karen K

unread,
Apr 23, 2021, 5:36:52 AM4/23/21
to weewx-user
airQ

František Slimařík

unread,
Apr 23, 2021, 7:27:14 AM4/23/21
to weewx-user
That looks great Karen :) but do we have something also for outdoor placement?

Dne pátek 23. dubna 2021 v 11:36:52 UTC+2 uživatel kk44...@gmail.com napsal:

sbar...@gmail.com

unread,
Apr 23, 2021, 7:33:28 AM4/23/21
to weewx-user
Hi,

sds011, with usb is supported by weewx. And sensebox.de has hardware kits and diy info to make some that will survive outdoor. Do not know if there is an all-in-one solution for all the compounds you listed.

Regards,

Rainer Lang

unread,
Apr 23, 2021, 10:55:51 AM4/23/21
to sbar...@gmail.com, weewx...@googlegroups.com
In combination with a Weather station, or just with a console (GW1000) you can check e.g. the sensors and sensor-combos offered by FineOffset via Ecowitt and resellers.
You will find a lot of info regarding this in the WXforum (not limited to FineOffset (clones)). All supported by weewx.
As for FineOffset an overview would be https://www.wxforum.net/index.php?topic=40730.0
and there's a lot of discussion and exchange about it/them.

"Best options" depend on your use case, your priorities (indoor/outdoor/both), your situation/location (e.g. forest or near chemical plant, busy highway, ...) ....

I'd say, you first define for yourself your needs (use case), and then look out for what may serve your information needs (and budget situation) best.
At the end of the day you can use/add/combine many different sensors with (several instances of) weewx and can create a highly sophisticated metereological reporting.
--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/61fdec55-635b-4de5-9151-f5327dd92934n%40googlegroups.com.


František Slimařík

unread,
Apr 23, 2021, 3:27:45 PM4/23/21
to weewx-user
Hi Rainer,

best option for me would be solution provided by Karen (airQ) just for outdoor usage. I am searching for all-in-one device with minimum effort to make it work.

Dne pátek 23. dubna 2021 v 16:55:51 UTC+2 uživatel lang....@googlemail.com napsal:

weather list

unread,
Apr 28, 2021, 4:19:14 PM4/28/21
to weewx...@googlegroups.com
Karen,

Can WeeWx collect the output of the air-Q units directly via an API?

-- 
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.

weather list

unread,
May 18, 2021, 12:01:22 PM5/18/21
to weewx...@googlegroups.com
Karen,

Can WeeWx collect the output of the air-Q units directly via an API?
On 23 Apr, 2021, at 05:36, Karen K <kk44...@gmail.com> wrote:

Karen K

unread,
May 18, 2021, 1:37:01 PM5/18/21
to weewx-user
I do not know for sure by now. I plan to purchase one, but I think, it would be possible using weewx-MQTTsubscribe.

Karen K

unread,
Jun 15, 2021, 3:54:43 PM6/15/21
to weewx-user
I now can tell some experiences for the Air-Q device. First impression is, that it is a high quality equipment. The company is located at the university campus of the Technical University of Chemnitz, and they do some research regarding air quality measurement.

The MQTT configuration requires some knowledge in Python, as that configuration options are not included in the configuration tool but have to applied by an API. The documentation is excellent. But there are examples only, how to use the API, and you need to write a short script to set the option of your own. "Science" option is needed for that to work.

A simpler approach is to read the value page from the web interface by wget or curl, then get the values out of the HTML data by some script and write it to a text file, that in turn can be read by WeeWX. No special option is needed for that to work.

Smoke/fire detector is included in the device. If activated the device can warn in case of smoke or fire by a loud tone. The manufacturer provides detailed information about sensor accuracy. 

So I can finally recommend the device.

Karen K

unread,
Jul 11, 2021, 12:11:39 PM7/11/21
to weewx-user
Some time has passed, and finally I can present the first version of a driver (or better: service) to retrieve the data out of the Air-Q device of the Corant GmbH. You will find it there:

Web site of the Air-Q device (including possibility to purchase one)

The configuration is simple. The IP address of the device and the password are the only needed parameters. Observations are stored to the appropriate WeeWX observation types automatically.

If more than one Air-Q device is used, a name prefix can be prepended to the observation types to distinguish between the devices. That way it is possible to store the observations of more than one device in the same database.


Karen K

unread,
Jul 14, 2021, 11:10:54 AM7/14/21
to weewx-user
dayPM.png
https://github.com/roe-dl/weewx-airQ

The device is specified down to -20°C. So, outside usage is possible, if it is protected against rain.

František Slimařík

unread,
Jul 14, 2021, 3:29:41 PM7/14/21
to weewx...@googlegroups.com
Thanks for review Karen. I also found this  device uRADMonitor » Products for similar price. Now the worst part, choose one :)

st 14. 7. 2021 v 17:10 odesílatel Karen K <kk44...@gmail.com> napsal:
--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/ljyMS0EQR4k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/8049deb7-a33b-4428-bc8c-f22a7a769958n%40googlegroups.com.
Message has been deleted
Message has been deleted

hesf...@gmail.com

unread,
Jul 17, 2021, 10:16:21 AM7/17/21
to weewx-user
Hallo,
by
root@hesba:/home/weewx/bin# ./wee_extension --install weewx-airQ.zip
Request to install 'weewx-airQ.zip'
Extracting from zip archive weewx-airQ.zip
Traceback (most recent call last):
  File "./wee_extension", line 88, in <module>
    main()
  File "./wee_extension", line 80, in main
    ext.install_extension(options.install)
  File "/home/weewx/bin/weecfg/extension.py", line 130, in install_extension
    self.install_from_dir(extension_dir)
  File "/home/weewx/bin/weecfg/extension.py", line 150, in install_from_dir
    installer_path, installer = weecfg.get_extension_installer(extension_dir)
  File "/home/weewx/bin/weecfg/__init__.py", line 1851, in get_extension_installer
    __import__('install')
  File "/var/tmp/weewx-airQ-master/install.py", line 26
    '#altitude': 'set_if_not_station_altitude'
               ^
SyntaxError: invalid syntax

and

root@hesba:/home/weewx/bin# ./wee_extension --install weewx-airQ.zip
Request to install 'weewx-airQ.zip'
Extracting from zip archive weewx-airQ.zip
Traceback (most recent call last):
  File "./wee_extension", line 88, in <module>
    main()
  File "./wee_extension", line 80, in main
    ext.install_extension(options.install)
  File "/home/weewx/bin/weecfg/extension.py", line 130, in install_extension
    self.install_from_dir(extension_dir)
  File "/home/weewx/bin/weecfg/extension.py", line 150, in install_from_dir
    installer_path, installer = weecfg.get_extension_installer(extension_dir)
  File "/home/weewx/bin/weecfg/__init__.py", line 1858, in get_extension_installer
    installer = loader()
  File "/var/tmp/weewx-airQ-master/install.py", line 8, in loader
  File "/var/tmp/weewx-airQ-master/install.py", line 12, in __init__
NameError: name 'GTSInstaller' is not defined

root@hesba:/home/weewx/bin# ./wee_extension --install weewx-airQ.zip
Request to install 'weewx-airQ.zip'
Extracting from zip archive weewx-airQ.zip
Saving installer file to /home/weewx/bin/user/installer/airQ
Saved configuration dictionary. Backup copy at /home/weewx/weewx.conf.20210717161220
Finished installing extension 'weewx-airQ.zip'

how do i get the data into a database

Hartmut

Karen K

unread,
Jul 17, 2021, 4:01:22 PM7/17/21
to weewx-user
From those logs and the removed messages (I read them before they were removed) I am not sure what is the actual state of your installation. Does it generally work or not?

In the moment I write a tool to add the necessary columns to the database schema. By now the only way is to add the columns using wee_database one by one. If you do not set a prefix, some data is already saved to the database like pm1_0, pm2_5, and pm10_0. 

hesf...@gmail.com

unread,
Jul 18, 2021, 1:18:29 AM7/18/21
to weewx-user
Guten Morgen,
ich habe die Fehler während der Installation beseitigt. auch unter
1. airQ_corant.py Zeile 279 'co': ('co', 'milligram_per_meter_cubed', 'group_concentration',lambda x:x[0]),
                                                                 microgram_per_meter_cubed
2. wie funktioniert das mit dem "prefix"
  wird dann co oder co2 zu "prefixco" oder "prefixco2"

Bei einem Rechner war ich erfolgreich mit der Installation.

Danke

Hallo,
I fixed the errors during the installation.
how does that work with that "prefix"

I thank you for the very good work

A note for installing: "Crypto"
$ sudo apt-get install build-essential python3-dev
$ pip3 install pycryptodomex
$ python3 -m Cryptodome.SelfTest

I was successful with the installation on one computer.

Thanks
Hartmut

Karen K

unread,
Jul 18, 2021, 12:48:36 PM7/18/21
to weewx-user
CO is really milligram not microgram according to the airQ documentation and the display in the airQ app.

Regarding "prefix": If you have more than one airQ device, you need different names of the observation types for each of them. That's the prefix for. Imagine there are 3 airQ devices, one outside, one in the bedroom and one in the living room. Your could configure the outside device without prefix to put "co", "co2", "no2", "noise", "o3", "pm1_0", "pm2_5", "pm10_0", and "so2" into the predefined columns of the WeeWX database. For the bedroom device you could set "prefix = bedroom". So you get "bedroom_co", "bedroom_co2" etc. for that device. And for the living room device you could set "prefix = livingroom". So you get "livingroom_co", "livingroom_co2", etc. for that. To create the appropriate columns in the database I prepare a tool. I it is written, but still not tested. I got the second shot of Corona vaccination yesterday, and I am still down.

Thank you for the information about installing the crypto modules. In my case there was no need to install it separately. But I will include it in the documentation.

Karen K

unread,
Jul 18, 2021, 3:21:11 PM7/18/21
to weewx-user
Configuration tool is uploaded to Github. Please, be careful using it. Don't forget backup.

Karen K

unread,
Jul 24, 2021, 3:12:16 PM7/24/21
to weewx-user
I added an additional command to the configuration tool, that creates a simple skin based on the Seasons skin with all the airQ devices found in weewx.conf and displaying the values and the diagrams for them. Simply call sudo airq_conf --create-skin and find the new skin in /etc/weewx/skins/airQ.

hesf...@gmail.com

unread,
Jul 25, 2021, 2:00:08 AM7/25/21
to weewx-user
Hallo und Guten Morgen,

da sind noch 2 Fehler.
1. airQ_corant.py
__altitude = config_dict['airQ'][device]['altitude']

if len(__altitude)==3:

     __altitude = weewx.units.ValueTuple(__altitude[0],__altitude[1],__altitude[2])

else:
     __altitude = weewx.units.ValueTuple(__altitude[0],__altitdue[1],'group_altitude')
in Zeile 355

2. ich weiß nicht wo ich suchen muss.
Jul 25 07:50:39 hesba weewx[10248] INFO weewx.reportengine: Using localization file /home/weewx/skins/airQ/lang/de.conf for report 'airqReport'
Jul 25 07:50:40 hesba weewx[10248] ERROR weewx.cheetahgenerator: Generate failed with exception '<class 'TypeError'>'
Jul 25 07:50:40 hesba weewx[10248] ERROR weewx.cheetahgenerator: **** Ignoring template /home/weewx/skins/airQ/first_device.html.tmpl
Jul 25 07:50:40 hesba weewx[10248] ERROR weewx.cheetahgenerator: **** Reason: 'UnknownType' object is not subscriptable
Jul 25 07:50:40 hesba weewx[10248] ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):
Jul 25 07:50:40 hesba weewx[10248] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 332, in generate
Jul 25 07:50:40 hesba weewx[10248] ERROR weewx.cheetahgenerator: ****      unicode_string = compiled_template.respond()
Jul 25 07:50:40 hesba weewx[10248] ERROR weewx.cheetahgenerator: ****    File "_home_weewx_skins_airQ_first_device_html_tmpl.py", line 346, in respond
Jul 25 07:50:40 hesba weewx[10248] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/units.py", line 1612, in __getattr__
Jul 25 07:50:40 hesba weewx[10248] ERROR weewx.cheetahgenerator: ****      converted = self.convert(target_unit)
Jul 25 07:50:40 hesba weewx[10248] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/units.py", line 1593, in convert
Jul 25 07:50:40 hesba weewx[10248] ERROR weewx.cheetahgenerator: ****      value_t = convert(self.value_t, target_unit)
Jul 25 07:50:40 hesba weewx[10248] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/units.py", line 1938, in convert
Jul 25 07:50:40 hesba weewx[10248] ERROR weewx.cheetahgenerator: ****      if val_t[1] == target_unit:
Jul 25 07:50:40 hesba weewx[10248] ERROR weewx.cheetahgenerator: ****  TypeError: 'UnknownType' object is not subscriptable

wenn ich in  $current.airqHumAbs.gram_per_meter_cubed  ".gram_per_meter_cubed" keine Fehler

Gruß
Hartmut

hesf...@gmail.com

unread,
Jul 25, 2021, 2:37:04 AM7/25/21
to weewx-user
sorry
die Erweiterung für die Einheitendarstellung in

$current.airqHumAbs.gram_per_meter_cubed
$current.airqCO.milligram_per_meter_cubed.format("%.2f")
$current.airqO3.microgram_per_meter_cubed.format("%.1f")

habe ich in first_device.html.tmpl entfernt, dann generiert weewx die Seiten
Hartmut

Karen K

unread,
Jul 25, 2021, 4:45:54 AM7/25/21
to weewx-user
Vielen Dank für die Hinweise. Ich werde es mir ansehen und korrigieren.

Karen K

unread,
Jul 25, 2021, 6:42:03 AM7/25/21
to weewx-user
Ich habe mal eine kleine Änderung vorgenommen (siehe Anhang). Vielleicht funktioniert es damit. Ich kann es leider nicht selbst testen, weil es bei mir funktioniert.

Karen
airQ_corant.py

hesf...@gmail.com

unread,
Jul 25, 2021, 9:52:39 AM7/25/21
to weewx-user
Ich habe keine Lösung "ppm" zu "ppb" funktioniert.

und jetzt spielt mein air-Q nicht mehr mit. Kein WLAN-Netz. Aber keine Sorge, das wird
Danke
Hartmut

Karen K

unread,
Jul 25, 2021, 3:01:58 PM7/25/21
to weewx-user
hesf...@gmail.com schrieb am Sonntag, 25. Juli 2021 um 15:52:39 UTC+2:
Ich habe keine Lösung "ppm" zu "ppb" funktioniert.

Seltsam.
 
und jetzt spielt mein air-Q nicht mehr mit. Kein WLAN-Netz. Aber keine Sorge, das wird 


Das habe ich schon mehrfach erlebt. Laut dem airQ-Support-Forum soll es etwas mit der Nachtmodusumschaltung zu tun haben.
 
Ich habe die Sprachdatei für die deutsche Version noch eingebaut. Das funktioniert aber nur mit der Alpha-Version von WeeWX 4.6 und einer installierten Seasons-Skin ebenfalls von 4.6.


hesf...@gmail.com

unread,
Jul 26, 2021, 10:42:24 AM7/26/21
to weewx-user
Noch seltsamer

log:
Jul 26 16:35:20 hesba weewx[25964] INFO user.airQ: air-Q-Data: {'tvoc': [167, 25.05], 'pm2_5': [7, 11], 'DeviceID': 'g..g', 'Status': 'OK', 'humidity': [57.74, 3.42], 'measuretime': 2315, 'cnt0_3': [1053, 114], 'sound': [20.0, 20.0], 'temperature': [26.675, 0.53], 'cnt0_5': [332, 43], 'performance': 787.9454, 'co': [1.687, 0.21], 'humidity_abs': [14.659, 0.68], 'co2': [494, 64.82], 'uptime': 14783, 'so2': [610.98, 142.4], 'cnt2_5': [2, 10], 'o3': [25.23, 1.7], 'cnt10': [0, 10], 'no2': [23.17, 3.9], 'cnt5': [0, 10], 'timestamp': 1627310100000, 'pressure': [1004.27, 1.0], 'TypPS': 2.31, 'cnt1': [36, 14], 'door_event': 0, 'pm1': [6, 11], 'oxygen': [20.501, 0.75], 'dewpt': [17.304, 0.8], 'pm10': [8, 11], 'health': 711, 'bat': [0, 0], 'dHdt': -0.14, 'dCO2dt': 1.15}
Jul 26 16:35:20 hesba weewx[25964] INFO user.airQ: air-Q-Data: {'tvoc': [170, 25.5], 'pm2_5': [8, 11], 'DeviceID': 'g...g', 'Status': 'OK', 'humidity': [57.74, 3.42], 'measuretime': 1772, 'cnt0_3': [1110, 119], 'sound': [20.0, 20.0], 'temperature': [26.675, 0.53], 'cnt0_5': [345, 44], 'performance': 788.2166, 'co': [1.688, 0.21], 'humidity_abs': [14.659, 0.68], 'co2': [493, 64.79], 'uptime': 14790, 'so2': [610.98, 142.4], 'cnt2_5': [6, 11], 'o3': [25.29, 1.7], 'cnt10': [0, 10], 'no2': [23.36, 3.9], 'cnt5': [4, 10], 'timestamp': 1627310107000, 'pressure': [1004.27, 1.0], 'TypPS': 4.12, 'cnt1': [42, 14], 'door_event': 0, 'pm1': [7, 11], 'oxygen': [20.501, 0.75], 'dewpt': [17.304, 0.8], 'pm10': [12, 11], 'health': 667, 'bat': [0, 0], 'dHdt': -0.14, 'dCO2dt': 2.6}
Jul 26 16:35:20 hesba weewx[25964] INFO user.airQ: air-Q-Data: {'tvoc': [174, 26.1], 'pm2_5': [9, 11], 'DeviceID': 'g...g', 'Status': 'OK', 'humidity': [57.74, 3.42], 'measuretime': 1849, 'cnt0_3': [981, 107], 'sound': [20.0, 20.0], 'temperature': [26.655, 0.53], 'cnt0_5': [309, 40], 'performance': 789.4027, 'co': [1.688, 0.21], 'humidity_abs': [14.643, 0.68], 'co2': [493, 64.79], 'uptime': 14794, 'so2': [610.63, 142.4], 'cnt2_5': [4, 10], 'o3': [25.18, 1.7], 'cnt10': [0, 10], 'no2': [23.04, 3.9], 'cnt5': [4, 10], 'timestamp': 1627310112000, 'pressure': [1004.27, 1.0], 'TypPS': 2.91, 'cnt1': [57, 16], 'door_event': 0, 'pm1': [7, 11], 'oxygen': [20.501, 0.75], 'dewpt': [17.286, 0.8], 'pm10': [11, 11], 'health': 667, 'bat': [0, 0], 'dHdt': -0.14, 'dCO2dt': 3.44}
Jul 26 16:35:21 hesba weewx[25964] INFO weewx.manager: Added record 2021-07-26 16:35:00 CEST (1627310100) to database 'wee2021'
Jul 26 16:35:22 hesba weewx[25964] INFO weewx.manager: Added record 2021-07-26 16:35:00 CEST (1627310100) to daily summary in 'wee2021'
Jul 26 16:35:34 hesba weewx[25964] INFO weewx.cheetahgenerator: Generated 8 files for report SeasonsReport in 12.12 seconds
Jul 26 16:35:38 hesba weewx[25964] INFO weewx.imagegenerator: Generated 15 images for report SeasonsReport in 3.46 seconds
Jul 26 16:35:38 hesba weewx[25964] INFO weewx.reportengine: Copied 0 files to /home/weewx/public_html
Jul 26 16:35:38 hesba weewx[25964] INFO weewx.cheetahgenerator: Generated 3 files for report airqReport in 0.24 seconds
Jul 26 16:35:41 hesba weewx[25964] INFO weewx.imagegenerator: Generated 15 images for report airqReport in 2.76 seconds
Jul 26 16:35:41 hesba weewx[25964] INFO weewx.reportengine: Copied 0 files to /home/weewx/public_html/airQ

und in der Datenbank keine Einträge (DeviceID habe ich gelöscht)
log einfach # loginf("air-Q devices Data: %s" % reply) eingefügt
Gruss
Hartmut

Karen K

unread,
Jul 26, 2021, 12:13:39 PM7/26/21
to weewx-user
Ich habe nicht wirklich etwas geändert.

In Zeile 532 überträgt event.packet.update(data) die Daten vom airQ in den LOOP-Datensatz von WeeWX. Man könnte vorher data loggen oder danach event.packet. Auch Einstellungen im Abschnit [Accumulator] von weewx.conf können das Verhalten beeinflussen. Man kann auch noch in [StdWXCalculate][[Calculations]] die Werte mit "= software" eintragen.

Manche Verhaltensweisen erscheinen mir auch so, als ob die Ergänzungen in weewx.units.obs_group_dict und weewx.units.conversionDict nicht mehr da sind.

hesf...@gmail.com

unread,
Jul 27, 2021, 12:46:21 AM7/27/21
to weewx-user
Guten Morgen,
Plötzlich läuft alles nach dem Neustart.
Ich habe in units.py die Umrechnungen Micro, Milli, ppm, ppb vollständig ergänzt und dann in airQ_corant.py auskommentiert .
Mein Problem war, ich habe weewx in zwei unterschiedlichen conf-Dateien laufen (weewx.conf und cmon.conf)
So war weewx.conf die Einstellungen von cmon.conf nicht bekannt. Denn unter cmon.conf hatte ich airQ ergänzt, als nächster Schritt folgt nun die Berechnung "European Union's European Air Quality Index"
Danke für die Unterstützung
Hartmut

Karen K

unread,
Jul 27, 2021, 5:07:14 AM7/27/21
to weewx-user
hesf...@gmail.com schrieb am Dienstag, 27. Juli 2021 um 06:46:21 UTC+2:
als nächster Schritt folgt nun die Berechnung "European Union's European Air Quality Index"


Hierzu ein Hinweis: Bei zwei Größen verwendet das airQ-Gerät andere Einheiten als WeeWX:
  • Kohlenmonoxid (CO): airQ mg/m^3, WeeWX ppm
  • Ozon: (O3): airQ µg/m^3, WeeWX ppm
Deswegen habe ich die Größen auch unterschiedlich benannt. Bei WeeWX heißen sie "co" und "o3", beim airQ "airqCO" und "airqO3". Mit einer möglichen Umrechnung habe ich mich noch nicht beschäftigt.


Reply all
Reply to author
Forward
0 new messages