marcelm / radonwave

Read radon levels from Airthings Wave

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

wave plus released

dvand opened this issue · comments

commented

Any interest in figuring out how to get data from a wave plus?

It presets the data in a different way but I think I may have figured out how to get the radon value.

I don’t own a Wave Plus nor do I plan to buy one any time soon, so I’m personally not interested. However, if you can either describe how to get the data off the device or even change the code in such a way that it can be used with both devices, I would happily accept a pull request.

I'm planning to buy a wave plus too. I already read that the current script does not work with it.
Do you think it should be possible to adapt the script using the nRF Connect app?

I really don’t know. If the platform is the same, uses Bluetooth Low Energy, and the company didn’t decide to explicitly hide the radon level, then it is probably simple to figure out how to get the value. I would hope that only the UUIDs need to be changed. Then the nRF Connect app would help, yes. Alternatively, using gatttool on the Linux command line as described in the README is also a good idea. It’s a bit more complicated to use, but copying&pasting the UUIDs into the script is simpler this way.

Please note that I cannot promise anything, though! It may well be that Airthings doesn’t like people tinkering with their devices and has tried to lock them out in this new version.

However, if it works and you figure out how to get the levels off the device, I’ll gladly help you to integrate this into the current script so it would work for both devices.

commented

Ah, thanks for the details. It could be that this change isn’t meant to make things more complicated, but perhaps to make reading faster. For some reason, reading each characteristic takes quite a lot of time. So if you put everything in a single characteristic, that could speed things up.

commented

May have been wrong earlier, 13&14 appear to be CO2 while 15&16 appear to be TVOC.

commented

The UUID of the service/characteristic is:
b42e2a68-ade7-11e4-89d3-123b93f75cba
Sample value:
Properties: READ
Parsed value: (0x) 01-46-09-00-00-00-00-00-8C-08-F7-BF-23-03-1F-00-00-FE-CE-03
Raw value: (0x) 01-46-09-00-00-00-00-00-8C-08-F7-BF-23-03-1F-00-00-FE-CE-03

Thanks, I will try to integrate this unless you want to try yourself to come up with a patch.

The ones I think I've figured out this far are:

  • Byte 0: always 1 (version number perhaps?)
  • Byte 1: humidity (divide by 2)
  • Byte 2-3: ??
  • Byte 4-5: radon (short)
  • Byte 6-7: radon (long)
  • Byte 8-9: temp (divide by 100)
  • Byte 10-11: pressure (multiply by 2)
  • Byte 12-13: CO2
  • Byte 14-15: VOC
  • Byte 16-19: ??
commented

Cool! Anyone wants to send a pull request? I don’t think that I can integrate this myself after all, at least at the moment, as I don’t have the device. If you’re not actually using the script, you could just update the README.

Airthings published their own python script (MIT license) for reading the values:

https://github.com/Airthings/waveplus-reader/blob/master/read_waveplus.py#L167

commented

Their script seems to require root to run.

I have a wave plus since yesterday. the "official" script linked above seems to work for 5 minutes and then die (and needs python 2 and root and seems to have no error handling... but it does at least seem to document the decode of the bytes)
Happy to provide any assistance / testing if required. Will work on posting the results to thingspeak too

In addition to the official script being flaky, the official andriod app didn't work for me either - connected once and then not again, hence the interest in the pi :). Had to pull the batteries to reset it

I implemented something really hackish to get the data into my local home-assistant, https://github.com/gkreitz/homeassistant-airthings/blob/master/airthings.py . Seems to be reasonably stable at least. A few things I noticed when building that may be useful for others:

  • I went with disconnecting and connecting for every poll, based on what airthings wrote in the docs for the script for the wave, I assume only one thing can be connected to the airwave at once.
  • I had to increase the timeout for connections quite significantly, sometimes the wave plus simply seems horribly slow to connect.
  • For some reason, reading the characteristic via UUID didn't work in gattool (and therefore, not in pygatt). Did not seem to be an issue with bluepy (which the airthings script uses)

Just managed to bodge something to send to thingspeak

https://thingspeak.com/channels/674115

Should update every 10 minutes. Once I work out quite how github works, and python, will post some code... first experience of both :)

--edit-- learned a bit about github, forked it and placed my code on

https://github.com/snyggapa/waveplus-reader

run with a system cron job and uploading stats to the thingspeak URL above

commented
commented

My bad. Seems my device flaked out and I had to pull the battery. Unfortunately seems very common with this device :(

Just an FYI - I am running on a fork of the "official" script but it died after 28 days (and never gave me any long-term radon readings)

Link to the issue in case anyone has the same:

Airthings/waveplus-reader#10

If anybody wants to collaborate on getting history from the Wave+ ping me at waveplus@sifter.org . I think I have the basics worked out, but wouldn't hurt to have more eyes on it.