openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.86k stars 3.57k forks source link

[mihome] Gateway goes offline after 5 minutes #12094

Open goodfore opened 2 years ago

goodfore commented 2 years ago

I have a Xiaomi gateway v2. I have been using it for my OH 2.5 instance without any issues. I installed a OH 3.2 instance and started configuring it. I added the Xiaomi binding and adding a V2 gateway in. The Thing seems to be connected ok at first, showing all the connected devices etc, however after 5 minutes or so, it would go to disconnect state.

Since I have both OH 2.5 and OH 3.2 instances, I can confirm that the gateway is working as expected with the OH 2.5.

A quick search in the community forum shows that others have the same issue, and it can be fixed by adding serialNumber (MAC address of gateway without : or -) in the Thing configuration.

Expected Behavior

It seems like serialNumber is a required field, it should be added as a required field in the add Thing menu.

Current Behavior

When adding gateway, it does not ask for serialNumber. Without it the Thing would go offline after 5 minutes.

Possible Solution

Make serialNumber a required field

Steps to Reproduce (for Bugs)

  1. Add Xiaomi binding in OH 3.2
  2. Add Thing -> Xiaomi -> Xiaomi Mi Smart Home Bridge
  3. Enter in IP and developer key

Context

Thing don't work properly without entering the serial number

Your Environment

OH 3.2 on docker in Raspberry Pi 4/Zerio

openhab-bot commented 2 years ago

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/xiaomi-bindings-loose-connection-and-item-not-updated-triggered/137211/3

goodfore commented 2 years ago

Tested on OH 3.3 on docker in RPi 4/Zero. Bug still exists.

lsiepel commented 1 year ago

Still an issue with 4.0.x? When looking at the thing config, the config parameter is readonly. https://github.com/openhab/openhab-addons/blob/main/bundles/org.openhab.binding.mihome/src/main/resources/OH-INF/config/config.xml#L16

Might be related to https://github.com/openhab/openhab-addons/pull/8409

stale[bot] commented 5 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.