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

Xiaomi HHCCJCY01HHCC battery #26

Open
mihsu81 opened this issue May 6, 2022 · 6 comments
Open

Xiaomi HHCCJCY01HHCC battery #26

mihsu81 opened this issue May 6, 2022 · 6 comments

Comments

@mihsu81
Copy link

mihsu81 commented May 6, 2022

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
@1technophile
Copy link
Member

1technophile commented May 7, 2022

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

@mihsu81
Copy link
Author

mihsu81 commented May 7, 2022

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.

@1technophile
Copy link
Member

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.

@mihsu81
Copy link
Author

mihsu81 commented May 22, 2022

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

@marcokreeft87
Copy link

I would love this aswell :)

@marcokreeft87
Copy link

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

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

No branches or pull requests

3 participants