Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Almendo bluSensor AIQ #29

Merged
merged 3 commits into from Jul 5, 2022

Conversation

Tamarinen
Copy link
Contributor

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
Copy link
Contributor Author

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

blusensor.txt

"co2e": co2e,
"tvoc": tvoc,
"aiq": aiq,
"firmware": "bluSensor V1",
Copy link
Owner

@Ernst79 Ernst79 Jul 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Owner

@Ernst79 Ernst79 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@Tamarinen
Copy link
Contributor Author

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
Copy link
Owner

Ernst79 commented Jul 5, 2022

Ok, let's do the following then

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

I'll update my review comments.

@Ernst79 Ernst79 merged commit c13d966 into Ernst79:master Jul 5, 2022
@Ernst79
Copy link
Owner

Ernst79 commented Jul 5, 2022

Thanks, merged

@Ernst79
Copy link
Owner

Ernst79 commented Jul 5, 2022

I made some small changes in #30

  • Added a test
  • changed co2e to co2 (as I use co2 in BLE monitor as key for CO2 sensors)
  • Added a "packet": "no packet id" field in the output. I need this for BLE monitor to work in Home Assistant.

@Ernst79
Copy link
Owner

Ernst79 commented Jul 5, 2022

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
Copy link
Contributor Author

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
Copy link
Owner

Ernst79 commented Jul 5, 2022

no problem. Has been released as 3.2.0

@Tamarinen Tamarinen deleted the almendo-blusensor-aiq branch July 5, 2022 15:19
@Ernst79
Copy link
Owner

Ernst79 commented Jul 5, 2022

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
Copy link
Contributor Author

Tamarinen commented Jul 5, 2022

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'}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants