Importing data from awair sensor

85 views
Skip to first unread message

sting ray

unread,
Jan 12, 2024, 6:41:45 AM1/12/24
to weewx-user
Any advice how to import and display data from awair element sensors?    These are intended for indoor aqi monitoring but appear to function in covered outdoor locations like a back porch.

Thanks,
Steve Lim

Can access current sensor data on LAN with url http://192.168.86.43/air-data/latest
raw data:   {"timestamp":"2024-01-12T11:26:12.379Z","score":95,"dew_point":13.51,"temp":23.85,"humid":52.37,"abs_humid":11.27,"co2":630,"co2_est":400,"co2_est_baseline":36710,"voc":164,"voc_baseline":37478,"voc_h2_raw":27,"voc_ethanol_raw":36,"pm25":0,"pm10_est":1}

Screenshot 2024-01-12 063551.png

John Smith

unread,
Jan 12, 2024, 6:57:29 AM1/12/24
to weewx...@googlegroups.com
On Fri, 12 Jan 2024 at 22:41, sting ray <lgvs...@gmail.com> wrote:
Any advice how to import and display data from awair element sensors?    These are intended for indoor aqi monitoring but appear to function in covered outdoor locations like a back porch.

If no one else replies with a better answer you could look at https://github.com/glennmckechnie/weewx-uradmon which takes json values on a uradmon and injects it into a DB and then has a skin to display graphs. 

michael.k...@gmx.at

unread,
Jan 12, 2024, 7:29:48 AM1/12/24
to weewx-user
Write an extension that queries the device every archive_interval

or

Get the device to publish it's value per MQTT (if it supports anything such this) and use mqttsubscribe

or

find a third party that queries the device and publishes the value per MQTT (node red should work) and use mqttsubscribe

I'd go for the first option, if the second option isn't available, since I've done something like this already: (Get JSON, parse it and put the values into a desired column of the weewx database):

sting ray

unread,
Jan 12, 2024, 4:21:02 PM1/12/24
to weewx-user
the uradman example looks promising  Am also using seasons 4.10.2. 

Glenn McKechnie

unread,
Jan 12, 2024, 8:47:26 PM1/12/24
to weewx...@googlegroups.com
Hi,
As the author of the previously mentioned uradmon, I probably should pitch in.

At first glance your json data and fields look very similar to uradmons, and that's without looking at the uradmon code (it's been a while!) Reviewing the code confirms that.
It should be a fairly straight forward to adapt it, with the bonus that the extra uradmon specific code (retries and timeouts) can hopefully be ignored in your case.
One difference is your data supplies a timestamp. uradmon.py generates its own timestamp as the unit doesn't supply one. The choices begin!

The uradmon.py was written pretty much as a standalone service, under weewx control of course.
It defines the units / groups  / formats /  labels and conversions etc that it uses because at the time these weren't included in weewx itself, plus it uses some oddball ones - Pa, cpm. I believe some of them are now included in weewx.

It writes to its own database primarily because I didn't want to go adding or co-opting weewx fields for uradmon purposes, and then live with the consequences at upgrade time. It also seemed the simplest method to prevent stomping on other users choices.  It was also written before the new schema although looking at your fields there are some rather awair specific names?

The uradmon code is fairly well commented with example data (there are at least 4 different types of urad units) and if you go down that path and have any queries then you can contact me directly - if you read this via an email client my address should be visible.


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie


--
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/181df546-7bb9-427c-94ba-23b4c8b41cdan%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages