h4 / LYWSD02-home-assistant

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

Random disconnections #7

Open mimmus68 opened 5 years ago

mimmus68 commented 5 years ago

I found another problem that after a while the sensor works correctly, it loses the connection and I have to restart hassio to make it work again. I also found the same problem with the round sensor and solved it with a custom component https://community.home-assistant.io/t/xiaomi-mijia-bluetooth-temperature-humidity-sensor-compatibility/43568/147

There are possible solutions

thanks

I attach a custom component file

mi_bt.zip

h4 commented 5 years ago

Thanks! I'll hope this sample helps me to fix my component.

h4 commented 5 years ago

So, I looked at this component, it uses BLE-advertising instead of subscription (which my component uses). Pros: it may be more stable, Cons: it can't deal with extended data (like time, units, history).

Thanks again for help. I am hope, I can fix disconnect errors soon.

clau-bucur commented 4 years ago

Have you switched to using BLE-advertising?

h4 commented 4 years ago

@clau-bucur no, but if you looking for it – please see https://github.com/h4/LYWSD02-home-assistant/issues/12, there are an link to alternative component, which supports it.

clau-bucur commented 4 years ago

Thank you! I've installed that and it's working nicely.