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

Integration for Xiaomi Mi temperature humidity sensors #176

Closed
alan-strohm opened this issue Apr 21, 2020 · 2 comments
Closed

Integration for Xiaomi Mi temperature humidity sensors #176

alan-strohm opened this issue Apr 21, 2020 · 2 comments

Comments

@alan-strohm
Copy link
Contributor

Is your feature request related to a problem? Please describe.
I have an E-Ink clock / LYWSD02MMC in the same room as the rasberry pi which I am using for presence detection. I'd like to use room assistant to report the temperature / humidity readings back to home assistant.

Describe the solution you'd like
I have a working patch that I'm willing to turn into a pull request. I'm creating this feature request to reach agreement on the high level strategy before I spend time writing tests and cleaning things up.

The patch is largely based on the homebridge-mi-hygrothermograph repos. We listen for BLE advertisements from a configured list of devices and then attempt to parse the readings out of the service data.

There has been some discussion on the homebridge repos about splitting it out into a lighter library. I plan on reaching out to the maintainer about whether it's worth a separate package just for the parser or if we should copy it into this repos.

I use the EntityService to create a separate Sensor for each device + type of reading (temperature, humidity, battery, etc) that I see. I then update the state on each new reading.

I tell noble to start / stop scanning on power state changes. I've been running my new integration in parallel with the existing BLE integration and so far haven't had any problems.

Describe alternatives you've considered
I could run a different service on the device to listen for readings and publish them to MQTT. I'm not sure if there any benefits to making sure everything goes through one instance of noble.

@mKeRix
Copy link
Owner

mKeRix commented Apr 22, 2020

I think you can actually only have one instance of noble running at the same time, as it blocks other Bluetooth calls when it's doing something. Generally your approach sounds good to me from the high-level view.

My suggestion for continuing here would be: just create a PR based on what you have in the patch so far. That way I can already give some feedback and provide support where possible before you dive deeper into the other things.

@mKeRix mKeRix closed this as completed in 0be912b May 8, 2020
github-actions bot pushed a commit that referenced this issue May 8, 2020
# [2.6.0](v2.5.0...v2.6.0) (2020-05-08)

### Features

* add new Xiaomi Mi integration ([#184](#184)) ([0be912b](0be912b)), closes [#176](#176)
@github-actions
Copy link

github-actions bot commented May 8, 2020

🎉 This issue has been resolved in version 2.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

No branches or pull requests

2 participants