gateway
gateway copied to clipboard
Xiaomi HHCCJCY01HHCC battery
Describe the bug TheengsGateway doesn't connect to Xiaomi HHCCJCY01HHCC in order to get battery reading like OpenMQTTGateway
To Reproduce
- Start TheengsGateway
- Have a Xiaomi HHCCJCY01HHCC nearby
Expected behavior TheengsGateway should connect to Xiaomi HHCCJCY01HHCC in order to get battery reading like OpenMQTTGateway.
Screenshots
Environment (please complete the following information):
- version used (V0.1.5)
Additional context
Indeed, for the moment Theengs focus on ble broadcaster not connection.
Thanks for the clarification. I thought it's a bug. TheengsGateway being able to mimic the BLE functionality of OpenMQTTGateway would make it really popular. If you have some pointers about this particular case, I can give it a shot at porting it to TheengsGateway.
Thanks for proposing help, here is some pointers:
- so as to connect we can already use the model_id coming from the decoder to know if we are dealing with a HHCCJCY01HHCC,
- once identified OMG attempt a connect for the battery 1/10 times so as to avoid consuming too much battery of the device
- from this you can attempts a connection to it, the gateway uses bleak, so you can try to use this library
- once the sensor is connected, you will have to retrieve a value from a pair of service/characteristic, here is where it is done from OMG
- finally this value can be published This could be done as a separate process from scanning so as to don't block it, even if the data is published with only the battery.
This is definitely more than I can chew. 😁 Hopefully some of the other developers can add this feature.
I would love this aswell :)
According to the supported devices page this should work, but it doesnt unfortunately