Ernst79 / bleparser

Parser for passive BLE advertisements
MIT License
29 stars 15 forks source link

Add support for Almendo bluSensor AIQ #29

Closed Tamarinen closed 2 years ago

Tamarinen commented 2 years ago

Datasheet for this device: https://www.blusensor.com/zdn/pdf/datasheets/BSP02AIQ%20EN%20datasheet.pdf

The parser is based on the documentation available at: https://github.com/blusensor/blusensor-api-bluetooth

Tamarinen commented 2 years ago

A set of example packets captured from this device. Wild values provoked by a glass of tea.

blusensor.txt

Tamarinen commented 2 years ago

Thanks for this PR. I have a few comments, please have a look.

Thank you for your feedback! I will address those issues as soon as possible.

Regarding the choice of Almendo; the manufacturer specific data tag 0x06E8 is the same value as the company identifier for Almendo Technologies GmbH, the manufacturer of the bluSensor series of products. I believe the use of Almendo is a suitable abstraction level, especially if they should begin using their company identifier when producing yelOwl car alarms or redEring false position tracker tags.

https://github.com/blusensor/blusensor-api-bluetooth#official-bluetooth-sig-id

Ernst79 commented 2 years ago

Ok, let's do the following then

                        "firmware": "Almendo V1",
                        "type": "bluSensor Mini",

I'll update my review comments.

Ernst79 commented 2 years ago

Thanks, merged

Ernst79 commented 2 years ago

I made some small changes in #30

Ernst79 commented 2 years ago

oh, and changed aiq to aqi (air quality index). Sensors sometimes use aiq, sometimes aqi. I used aqi for other sensors, so will do that for this one too.

Tamarinen commented 2 years ago

Excellent, thanks!

Worth noting could be that although Almendo states CO2 sensing capability, their CO2 value is actually CO2e, based on TVOC level and statistics. Other than that minor note, I have nothing to add.

I completely forgot about providing a test, my apologies.

Ernst79 commented 2 years ago

no problem. Has been released as 3.2.0

Ernst79 commented 2 years ago

I noticed that the RSSI value is quite strange in the txt file. The example I used in the test results in an RSSI = 61 (`0x3d). RSSI should be a negative value normally. Could you do some test by keeping the sensor close and far away and report back the values here for both situations? Perhaps we have to multiply with -1?

Tamarinen commented 2 years ago

Oops, you've found a bug in my translator from the nRF52840 sniffer, which return quite large packets with a lot of extra data, to HCI event packets. Use these instead, they're captured using more traditional methods:

043e26020100000eba64c4f5fc1a02010613ffe806010a0a08011800be0a89129d05fb0404020a09d9 {'rssi': -39, 'data': True, 'packet': 'no packet id', 'temperature': 27.5, 'humidity': 47.45, 'co2': 1437, 'tvoc': 1275, 'aqi': 4, 'firmware': 'Almendo V1', 'type': 'bluSensor Mini'}

043e26020100000eba64c4f5fc1a02010613ffe806010a0a08011800be0a8b128208860505020a09d5 {'rssi': -43, 'data': True, 'packet': 'no packet id', 'temperature': 27.5, 'humidity': 47.47, 'co2': 2178, 'tvoc': 1414, 'aqi': 5, 'firmware': 'Almendo V1', 'type': 'bluSensor Mini'}

043e26020100000eba64c4f5fc1a02010613ffe806010a0a08011800be0a8b128208860505020a09d8 {'rssi': -40, 'data': True, 'packet': 'no packet id', 'temperature': 27.5, 'humidity': 47.47, 'co2': 2178, 'tvoc': 1414, 'aqi': 5, 'firmware': 'Almendo V1', 'type': 'bluSensor Mini'}

043e26020100000eba64c4f5fc1a02010613ffe806010a0a08011800bb0aa3110005ab0304020a09cc {'rssi': -52, 'data': True, 'packet': 'no packet id', 'temperature': 27.47, 'humidity': 45.15, 'co2': 1280, 'tvoc': 939, 'aqi': 4, 'firmware': 'Almendo V1', 'type': 'bluSensor Mini'}

043e26020100000eba64c4f5fc1a02010613ffe806010a0a08011800bb0aa3110005ab0304020a09d6 {'rssi': -42, 'data': True, 'packet': 'no packet id', 'temperature': 27.47, 'humidity': 45.15, 'co2': 1280, 'tvoc': 939, 'aqi': 4, 'firmware': 'Almendo V1', 'type': 'bluSensor Mini'}

043e26020100000eba64c4f5fc1a02010613ffe806010a0a08011800bb0aa3110005ab0304020a09d1 {'rssi': -47, 'data': True, 'packet': 'no packet id', 'temperature': 27.47, 'humidity': 45.15, 'co2': 1280, 'tvoc': 939, 'aqi': 4, 'firmware': 'Almendo V1', 'type': 'bluSensor Mini'}

043e26020100000eba64c4f5fc1a02010613ffe806010a0a08011800d40aea218687e82605020a09d1 {'rssi': -47, 'data': True, 'packet': 'no packet id', 'temperature': 27.72, 'humidity': 86.82, 'co2': 34694, 'tvoc': 9960, 'aqi': 5, 'firmware': 'Almendo V1', 'type': 'bluSensor Mini'}

043e26020100000eba64c4f5fc1a02010613ffe806010a0a08011800d40aea218687e82605020a09d6 {'rssi': -42, 'data': True, 'packet': 'no packet id', 'temperature': 27.72, 'humidity': 86.82, 'co2': 34694, 'tvoc': 9960, 'aqi': 5, 'firmware': 'Almendo V1', 'type': 'bluSensor Mini'}

043e26020100000eba64c4f5fc1a02010613ffe806010a0a08011800180baa259728f90b05020a09d6 {'rssi': -42, 'data': True, 'packet': 'no packet id', 'temperature': 28.4, 'humidity': 96.42, 'co2': 10391, 'tvoc': 3065, 'aqi': 5, 'firmware': 'Almendo V1', 'type': 'bluSensor Mini'}

043e26020100000eba64c4f5fc1a02010613ffe806010a0a08011800180baa259728f90b05020a09db {'rssi': -37, 'data': True, 'packet': 'no packet id', 'temperature': 28.4, 'humidity': 96.42, 'co2': 10391, 'tvoc': 3065, 'aqi': 5, 'firmware': 'Almendo V1', 'type': 'bluSensor Mini'}

043e26020100000eba64c4f5fc1a02010613ffe806010a0a08011800180baa259728f90b05020a09da {'rssi': -38, 'data': True, 'packet': 'no packet id', 'temperature': 28.4, 'humidity': 96.42, 'co2': 10391, 'tvoc': 3065, 'aqi': 5, 'firmware': 'Almendo V1', 'type': 'bluSensor Mini'}

043e26020100000eba64c4f5fc1a02010613ffe806010a0a08011800160b1c1c75075e0805020a09d1 {'rssi': -47, 'data': True, 'packet': 'no packet id', 'temperature': 28.38, 'humidity': 71.96, 'co2': 1909, 'tvoc': 2142, 'aqi': 5, 'firmware': 'Almendo V1', 'type': 'bluSensor Mini'}

043e26020100000eba64c4f5fc1a02010613ffe806010a0a08011800160b1c1c75075e0805020a09cf {'rssi': -49, 'data': True, 'packet': 'no packet id', 'temperature': 28.38, 'humidity': 71.96, 'co2': 1909, 'tvoc': 2142, 'aqi': 5, 'firmware': 'Almendo V1', 'type': 'bluSensor Mini'}

043e26020100000eba64c4f5fc1a02010613ffe806010a0a08011800150b7a13ec03c50204020a09d1 {'rssi': -47, 'data': True, 'packet': 'no packet id', 'temperature': 28.37, 'humidity': 49.86, 'co2': 1004, 'tvoc': 709, 'aqi': 4, 'firmware': 'Almendo V1', 'type': 'bluSensor Mini'}

043e26020100000eba64c4f5fc1a02010613ffe806010a0a08011800150b7a13ec03c50204020a09d0 {'rssi': -48, 'data': True, 'packet': 'no packet id', 'temperature': 28.37, 'humidity': 49.86, 'co2': 1004, 'tvoc': 709, 'aqi': 4, 'firmware': 'Almendo V1', 'type': 'bluSensor Mini'}

043e26020100000eba64c4f5fc1a02010613ffe806010a0a08011800150b7a13ec03c50204020a09cb {'rssi': -53, 'data': True, 'packet': 'no packet id', 'temperature': 28.37, 'humidity': 49.86, 'co2': 1004, 'tvoc': 709, 'aqi': 4, 'firmware': 'Almendo V1', 'type': 'bluSensor Mini'}

043e26020100000eba64c4f5fc1a02010613ffe806010a0a080118000e0bf91130048c0204020a09c7 {'rssi': -57, 'data': True, 'packet': 'no packet id', 'temperature': 28.3, 'humidity': 46.01, 'co2': 1072, 'tvoc': 652, 'aqi': 4, 'firmware': 'Almendo V1', 'type': 'bluSensor Mini'}

043e26020100000eba64c4f5fc1a02010613ffe806010a0a080118000e0bf91130048c0204020a09d3 {'rssi': -45, 'data': True, 'packet': 'no packet id', 'temperature': 28.3, 'humidity': 46.01, 'co2': 1072, 'tvoc': 652, 'aqi': 4, 'firmware': 'Almendo V1', 'type': 'bluSensor Mini'}

043e26020100000eba64c4f5fc1a02010613ffe806010a0a08011800f90ac7106e05ac0204020a09c4 {'rssi': -60, 'data': True, 'packet': 'no packet id', 'temperature': 28.09, 'humidity': 42.95, 'co2': 1390, 'tvoc': 684, 'aqi': 4, 'firmware': 'Almendo V1', 'type': 'bluSensor Mini'}

043e26020100000eba64c4f5fc1a02010613ffe806010a0a08011800f90ac7106e05ac0204020a09bd {'rssi': -67, 'data': True, 'packet': 'no packet id', 'temperature': 28.09, 'humidity': 42.95, 'co2': 1390, 'tvoc': 684, 'aqi': 4, 'firmware': 'Almendo V1', 'type': 'bluSensor Mini'}

043e26020100000eba64c4f5fc1a02010613ffe806010a0a08011800f10a0512e5036b0204020a09c3 {'rssi': -61, 'data': True, 'packet': 'no packet id', 'temperature': 28.01, 'humidity': 46.13, 'co2': 997, 'tvoc': 619, 'aqi': 4, 'firmware': 'Almendo V1', 'type': 'bluSensor Mini'}

043e26020100000eba64c4f5fc1a02010613ffe806010a0a08011800f10a0512e5036b0204020a09c3 {'rssi': -61, 'data': True, 'packet': 'no packet id', 'temperature': 28.01, 'humidity': 46.13, 'co2': 997, 'tvoc': 619, 'aqi': 4, 'firmware': 'Almendo V1', 'type': 'bluSensor Mini'}