h4 / LYWSD02-home-assistant

Home-Assistant sensor for LYWSD02 Thermometer
75 stars 12 forks source link

Merge/share with sensor.mitemp_bt lib #12

Closed ma-zal closed 4 years ago

ma-zal commented 4 years ago

Hi. It can be great to consider the merge with project sensor.mitemp_bt. Or alternatively just to share knowledges between libraries.

Mentioned lib sensor.mitemp_bt:

h4 commented 4 years ago

As I know it impossible to read battery/time info without direct connection to device. Will it be really helpful if it start use two different types of connection?

ma-zal commented 4 years ago

I agree with you @h4. For temp+hum data the passive listening should be used.

For battery/time the active connection should be used. Honestly the "time" info is not so important. I see the "battery" info as priority. This infomation can be readed in really long interval (like 1x per week), because of long battery life. So no need to update every 5 minutes. In this case the active connection 1x per week probably will not drain the battery.

It will be great, if you will describe this BLE communication in documentation. It can help others to understand it and implement it in another libraries.

h4 commented 4 years ago

@ma-zal All communication with BLE is located in separate library. Look at https://github.com/h4/lywsd02, It there are not enough documentation I'll add it.

ma-zal commented 4 years ago

Thanks for link to library h4/lywsd02. I miss this dependency.