merdok / homebridge-xiaomi-fan

Homebridge plugin for Xiaomi Smartmi and Mija fans
MIT License
113 stars 15 forks source link

[Improvement] Switch to miio fork #119

Closed peterneutron closed 2 years ago

peterneutron commented 2 years ago

The currently used version of miio is outdated and no longer maintained, I propose switching to the fork from

https://github.com/homebridge-xiaomi-roborock-vacuum/homebridge-xiaomi-roborock-vacuum

Reasoning:

There is an issue that seems to randomly disconnect some devices after a few minutes and then fails to reconnect. For example this happens quiet frequently with my zhimi.fan.za4.

Issue:

https://github.com/homebridge-xiaomi-roborock-vacuum/homebridge-xiaomi-roborock-vacuum/issues/299 https://github.com/homebridge-xiaomi-roborock-vacuum/homebridge-xiaomi-roborock-vacuum/issues/367 https://github.com/homebridge-xiaomi-roborock-vacuum/homebridge-xiaomi-roborock-vacuum/issues/227

Fix:

https://github.com/homebridge-xiaomi-roborock-vacuum/homebridge-xiaomi-roborock-vacuum/pull/334

Testing:

I replaced the current miio module with the one from homebridge-xiaomi-roborock-vacuum. After this the disconnect issue seems to be fixed.

guzzzi commented 2 years ago

I have the same Issue with reconnection to a zhimi.fan.za4. But i didnt tested it to replace the miio module.

peterneutron commented 2 years ago

If you want to test this just replace ../node_modules/homebridge-xiaomi-fan/node_modules/miio with the one from homebridge-xiaomi-roborock-vacuum and restart homebridge.

My setup:

merdok commented 2 years ago

I would gladly reuse that but i do not think that is available as separate package which i can simply replace. For the homebridge-miot plugin i also already dumped the miio library and using an own implementation of that right now. I did not want to also use it in this plugin in order not to maintain two codebases of the same. Although if the fork of the miio library is a separate package then i could definitely reuse it here.

peterneutron commented 2 years ago

Would it be possible to ask the maintainer of homebridge-xiaomi-roborock-vacuum if he's willing to release his refactored miio module as a separate package to be used by other projects? I also have no clue how many devices or configurations are affected by this. Maybe the issue could be linked a bit more prominently for other people facing the same problem.

Your plugin is awesome by the way, thanks for making it available to the community 👍

merdok commented 2 years ago

I mean if the maintainer is willing to do that then i could definitely reuse it. But i did not see any activity from the developer in homebridge-xiaomi-roborock-vacuum since a couple of months...