Awair Support

I just saw this product on TechCrunch and find it interesting. They say they have an open API, but you need to contact them for access. I was wondering if anyone had any information on it. I could see it being useful for turning on the air filter in our bedroom and/or notifying us some windows need to be opened for some fresh air.

Thanks in advance!

I have used their api to retrieve the sensor readings. You do not need to request an api key, you just use your username and password to retrieve the data.
I built a web-based dashboard which you can use to view awair or foobot readings :

All the code I used to fetch the readings is there. In terms of api - the foobot api is easier to use and graph.

I have two of their commercial products, Awair Omni. They have a local http server that provides json data of the current conditions, and I believe it can recall history too via the local json api. They do not require a key or account to access local API. JSON looks like this:

{“timestamp”:“2022-01-27T21:01:36.583Z”,“score”:83,“temp”:23.83,“humid”:51.60,“co2”:914,“voc”:1091,“pm25”:0,“lux”:0.0,“spl_a”:49.7}

I’m trying to get it to work with @rigpapa 's SiteSensor right now, but frustratingly it keeps getting http error 500 when sitesensor pulls it, yet if I curl it from the vera’s linux commandline, I get a 200 and the normal json response!

15:13:05: SiteSensor: Requesting JSON data
15:13:05: SiteSensor: “GET” “http://192.168.0.55/air-data/latest”, headers={ }
15:13:06: SiteSensor: Request returned no data, status 500

Set UseCurl to 1 in the SiteSensor’s Advanced > Variables tab and call it good. Sometimes the built-in Lua libraries just don’t cut it.

Roger that. I did manage to install tcpdump in my Vera and get a pcap of working fetches via curl and non-working ones via lua

That’s cool… what were the differences? I have a suspicion (missing Host header first, Accept second)…?

Host and Accept headers were in a different order at least, and some other differences:


Left side no work. right side yes work.
I had to google TE: trailers. I haven’t noticed that header before. But if I had to guess it’s the connection:close at the very beginning?

The text/json MIME type in the Accept header on the Lua request is pretty unusual. IANA specifies application/json as the correct type for a JSON response. Did you supply that header and value? If so, try switching it to application/json and see if it works.

Yes, I did supply that header/value at one point when I was grasping at straws. I since removed it though. I just tried setting usecurl to 0 and verifying the headers box is empty and it still 500’s though