Closed RomanGar closed 4 years ago
Here is the traceback from running read_wave.py
...
[11:10:25] openhabian@openhab:~/bt$ sudo python2 read_wave.py 295000XXXX 120
Traceback (most recent call last):
File "read_wave.py", line 197, in
running on Raspberry Pi 4 Linux openhab 4.19.75-v7l+ #1270 SMP Tue Sep 24 18:51:41 BST 2019 armv7l GNU/Linux bluepy is at vesrion 1.2.0
from the traceback above it is apparent that read_wave.py fails upon attempting to read the DATETIME UUID, which suppose to be at 0x2a08, but there is no UUID that starts with 0x2a08, when available characteristics are listed with gatttool __handle: 0x0001, uuid: 00002800-0000-1000-8000-00805f9b34fb handle: 0x0002, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x0003, uuid: 00002a00-0000-1000-8000-00805f9b34fb handle: 0x0004, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x0005, uuid: 00002a01-0000-1000-8000-00805f9b34fb handle: 0x0006, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x0007, uuid: 00002a04-0000-1000-8000-00805f9b34fb handle: 0x0008, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x0009, uuid: 00002ac9-0000-1000-8000-00805f9b34fb handle: 0x000a, uuid: 00002800-0000-1000-8000-00805f9b34fb handle: 0x000b, uuid: 00002800-0000-1000-8000-00805f9b34fb handle: 0x000c, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x000d, uuid: b42e4dcc-ade7-11e4-89d3-123b93f75cba handle: 0x000e, uuid: 00002901-0000-1000-8000-00805f9b34fb handle: 0x000f, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x0010, uuid: b42e50d8-ade7-11e4-89d3-123b93f75cba handle: 0x0011, uuid: 00002901-0000-1000-8000-00805f9b34fb handle: 0x0012, uuid: 00002902-0000-1000-8000-00805f9b34fb handle: 0x0013, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x0014, uuid: b42e538a-ade7-11e4-89d3-123b93f75cba handle: 0x0015, uuid: 00002901-0000-1000-8000-00805f9b34fb handle: 0x0016, uuid: 00002902-0000-1000-8000-00805f9b34fb handle: 0x0017, uuid: 00002800-0000-1000-8000-00805f9b34fb handle: 0x0018, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x0019, uuid: f000ffc1-0451-4000-b000-000000000000 handle: 0x001a, uuid: 00002902-0000-1000-8000-00805f9b34fb handle: 0x001b, uuid: 00002901-0000-1000-8000-00805f9b34fb handle: 0x001c, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x001d, uuid: f000ffc2-0451-4000-b000-000000000000 handle: 0x001e, uuid: 00002902-0000-1000-8000-00805f9b34fb handle: 0x001f, uuid: 00002901-0000-1000-8000-00805f9b34fb handle: 0x0020, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x0021, uuid: f000ffc5-0451-4000-b000-000000000000 handle: 0x0022, uuid: 00002902-0000-1000-8000-00805f9b34fb handle: 0x0023, uuid: 00002901-0000-1000-8000-00805f9b34fb handle: 0x0024, uuid: 00002800-0000-1000-8000-00805f9b34fb handle: 0x0025, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x0026, uuid: 00002a23-0000-1000-8000-00805f9b34fb handle: 0x0027, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x0028, uuid: 00002a24-0000-1000-8000-00805f9b34fb handle: 0x0029, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x002a, uuid: 00002a25-0000-1000-8000-00805f9b34fb handle: 0x002b, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x002c, uuid: 00002a26-0000-1000-8000-00805f9b34fb handle: 0x002d, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x002e, uuid: 00002a27-0000-1000-8000-00805f9b34fb handle: 0x002f, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x0030, uuid: 00002a29-0000-1000-8000-00805f9b34fb
Hi RomanGar,
Yes, there's currently no support for reading the sensor values from a 2nd generation Wave device.
However, with some small modification to the waveplus_reader.py script in the waveplus-reader repository, you should be able to get some readings.
In class WavePlus init method, change self.uuid to UUID("b42e4dcc-ade7-11e4-89d3-123b93f75cba")
Note that Wave 2nd generation does not have Pressure, CO2 and VOC readings. So you could optionally remove the code related to these values.
About the traceback: In my experience, instantiating a communication link between a raspberry pi and a BLE target using bluepy does not always succeed on the first try. Although the simple reader script does not provide exception handling, I suggest that you implement this yourself. Here's a small code snippet of how you could start handling exceptions.
` try:
except Exception as e:
# Note that this exception handler block catches all exceptions (even user errors).
# So you could limit the exceptions you catch to the ones raised by bluepy.
else:
# 2) Read sensor values
# 3) print/log etc... sensor values
# 4) disconnect from device
time.sleep(...) `
Sorry for duplicate post, for some reason it did not show up when I logged in second time. Roman
Hi orjangj,
Thanks for quick response and the new UUID. I am aware that the 2nd generation Wave does not support barometric pressure, CO2 and VOC.
With the new UUID, the read_waveplus.py script seems to work as I am now getting readings for RH, Radon ST avg, Radon LT avg and Temperature. The pressure, CO2 and VOC readings show maximum sensor values, as expected.
Not sure how you are affiliated with Airthings, but do you know if there are any plans to improve integration of their sensors in to the home automation systems?
It would be nice if they publish some documentation, at least publishing/describing UUIDs for individual models and how values/descriptors are structured.
Thanks for your help, Roman
Great that you got the script working :)
Regarding the last questions: I think it's best if you contact Airthings through Customer Service since I cannot answer these questions :/
I'll mark this issue as resolved, since you got your custom script working.
I have purchased the 2nd generation Wave (model 2950) on beginning of December, with intention to integrate it in to the openHAB home automation. Unfortunately, wave_read.py does not work with this device. I tried to troubleshoot it a bit deeper and found that UUIDs that are used to retrieve date, humidity, temperature and radon values are reported as invalid by gatttool
The device itself presents as "Airthings Wave+" (uuid: 00002a00-0000-1000-8000-00805f9b34fb). So I tried it with read_waveplus.py script. but it does not work either.
Firmware was updated and currently is: MSP:1.1.2 CC:1.2.4