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

https://github.com/Bluetooth-Devices/xiaomi-ble/blob/main/src/xiaomi_ble/parser.py #108

Open
rmeissne opened this issue Jan 5, 2025 · 4 comments
Labels
enhancement New feature or request

Comments

@rmeissne
Copy link

rmeissne commented Jan 5, 2025

Thanks for your work on this project.

I checked the parser for the Xiaomi BLE announcements:

https://github.com/Bluetooth-Devices/xiaomi-ble/blob/main/src/xiaomi_ble/parser.py

I have checked the beacons the sensor Xiaomi Motion Sensor 2S (XMPIR02SGXS). It is using the following object IDs:

  • 4a08 (Motion detected with Illuminance in lux)
  • 4818 (Time in seconds of no motion) - first one comes when motion is detected, 0 seconds, next one comes at 120 seconds, later at 300 seconds (looks like there is no more message after 600 or 1200 seconds)
  • 4805 (Illuminance in lux) - now sure how much of a change is needed in the lux to have the device sending a new value (max. value seems to be 1000).

There is one new object ID, the encrypted text would be: 3548020a00. This would be object ID 0x4835, length 2, value 000a (10).

struct.unpack('<xxxH', bytes.fromhex("3548020a00"))
(10,)
struct.unpack('<xxxh', bytes.fromhex("3548020a00"))
(10,)

Any Idea what this value does represent? It is received from time to time, on a (regular basis?). It is not a triggered value. I assume this could be the battery value, but what should 10 mean? It is a new battery. Like 10 to be multiplied by 10 = 100%?

Is this documented somehow? Can anybody help interpreting this (new?) object ID?

Thanks,
Robert

@rmeissne rmeissne added the enhancement New feature or request label Jan 5, 2025
@rmeissne
Copy link
Author

rmeissne commented Jan 5, 2025

Actually, I am as well receiving "3548020000". Which is value 0. Looks like this cannot be the battery level. Any idea?

Thanks,
Robert

@Ernst79
Copy link
Collaborator

Ernst79 commented Jan 5, 2025

You can try to find out with the miot spec website. I think it is this device

https://home.miot-spec.com/spec/xiaomi.motion.pir1

most is in Chinese, but the possible properties are in English

@rmeissne
Copy link
Author

rmeissne commented Jan 5, 2025

Thanks. This is the device, indeed. The documentation is more for the BLE settings you can change on the device. It is not talking about the object IDs which are used in the BLE announcements.

@rmeissne
Copy link
Author

rmeissne commented Jan 5, 2025

Battery is this one: 034c0164 (0x4c03, one byte), 64 hex, 100%.
I figured, that 3548020a00 does represent the "Timeout of no motion", which is 10 minutes. The value does change to 20 when I change this setting in this app. Not really sure what it is doing, but anyway - not sure what I would need this value for anyway.

Thanks,
Robert

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

No branches or pull requests

2 participants