gateway icon indicating copy to clipboard operation
gateway copied to clipboard

Xiaomi HHCCJCY01HHCC battery

Open mihsu81 opened this issue 3 years ago • 6 comments

Describe the bug TheengsGateway doesn't connect to Xiaomi HHCCJCY01HHCC in order to get battery reading like OpenMQTTGateway

To Reproduce

  1. Start TheengsGateway
  2. 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

  • You should not have a compilation error if you use the versions of the libraries linked into the libraries folder, this badges show you the state of the compilation Build Status
  • If you are not sure this is a bug or an enhancement post your question to the forum

mihsu81 avatar May 06 '22 10:05 mihsu81

Indeed, for the moment Theengs focus on ble broadcaster not connection.

1technophile avatar May 07 '22 15:05 1technophile

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.

mihsu81 avatar May 07 '22 19:05 mihsu81

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.

1technophile avatar May 08 '22 00:05 1technophile

This is definitely more than I can chew. 😁 Hopefully some of the other developers can add this feature.

mihsu81 avatar May 22 '22 20:05 mihsu81

I would love this aswell :)

marcokreeft87 avatar Aug 19 '23 09:08 marcokreeft87

According to the supported devices page this should work, but it doesnt unfortunately

marcokreeft87 avatar Aug 19 '23 11:08 marcokreeft87