kinu-garage / hut_10sqft

Computer setup tools for my own environment, and public discussion place holder.
Apache License 2.0
2 stars 1 forks source link

Upright fan (xiaomi / smart xi) not connecting to openHAB #466

Closed 130s closed 3 years ago

130s commented 3 years ago

xiaomi fan https://github.com/130s/hut_10sqft/issues/445 is indeed recognized by smart xi Bindings on openHAB but it keeps saying Status: OFFLINE - CONFIGURATION_ERROR Token required. Configure token. I'm following the Bindings' doc https://www.openhab.org/addons/bindings/miio/ but so far no success.

130s commented 3 years ago
2020-10-04 11:45:14.869 [hingStatusInfoChangedEvent] - 'miio:generic:06xxxxxx' changed from OFFLINE (CONFIGURATION_ERROR): Token required. Configure token to UNINITIALIZED
2020-10-04 11:45:14.972 [hingStatusInfoChangedEvent] - 'miio:generic:06xxxxxx' changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)
2020-10-04 11:45:15.540 [hingStatusInfoChangedEvent] - 'miio:generic:06xxxxxx' changed from UNINITIALIZED (HANDLER_MISSING_ERROR) to INITIALIZING
2020-10-04 11:45:15.590 [hingStatusInfoChangedEvent] - 'miio:generic:06xxxxxx' changed from INITIALIZING to OFFLINE (CONFIGURATION_ERROR): Token required. Configure token

2020-10-04 16:09:44.026 [INFO ] [miio.internal.cloud.MiCloudConnector] - Error logging on to Xiaomi cloud (0): Error getting logon location URL. Return code: 70002
:
2020-10-04 21:49:43.935 [INFO ] [miio.internal.cloud.MiCloudConnector] - Error logging on to Xiaomi cloud (0): Error getting logon location URL. Return code: 70002
:
2020-10-04 22:29:44.055 [INFO ] [miio.internal.cloud.MiCloudConnector] - Error logging on to Xiaomi cloud (0): Error getting logon location URL. Return code: 70016
130s commented 3 years ago

Looks like the same error (although the device in use in the ref is different) https://github.com/openhab/openhab-addons/issues/7459.

130s commented 3 years ago

While I was playing with both xiaomi cloud https://i.mi.com/#/ and on the Android app, I saw the following logged, and now openHAB seems to be communicating with the device (although device type is unknown).

2020-10-04 22:49:43.679 [me.event.ThingUpdatedEvent] - Thing 'miio:generic:06F68ECF' has been updated.
2020-10-04 22:49:54.282 [hingStatusInfoChangedEvent] - 'miio:generic:06F68ECF' changed from OFFLINE to ONLINE
2020-10-04 22:49:54.349 [me.event.ThingUpdatedEvent] - Thing 'miio:generic:06F68ECF' has been updated.
2020-10-04 22:49:54.390 [me.event.ThingUpdatedEvent] - Thing 'miio:generic:06F68ECF' has been updated.
==> /var/log/openhab2/openhab.log <==
2020-10-04 22:50:04.424 [INFO ] [internal.handler.MiIoAbstractHandler] - Mi Device model zhimi.fan.za3 identified as: Unknown Mi IO Device (unknown). Does not match thingtype miio:generic. Changing thingtype to miio:unsupported
==> /var/log/openhab2/events.log <==
2020-10-04 22:50:04.432 [me.event.ThingUpdatedEvent] - Thing 'miio:generic:06F68ECF' has been updated.
2020-10-04 22:50:04.480 [hingStatusInfoChangedEvent] - 'miio:generic:06F68ECF' changed from ONLINE to UNINITIALIZED
2020-10-04 22:50:04.530 [hingStatusInfoChangedEvent] - 'miio:generic:06F68ECF' changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)
2020-10-04 22:50:04.667 [hingStatusInfoChangedEvent] - 'miio:generic:06F68ECF' changed from UNINITIALIZED (HANDLER_MISSING_ERROR) to INITIALIZING
2020-10-04 22:50:04.704 [hingStatusInfoChangedEvent] - 'miio:generic:06F68ECF' changed from INITIALIZING to OFFLINE
2020-10-04 22:50:04.710 [me.event.ThingUpdatedEvent] - Thing 'miio:generic:06F68ECF' has been updated.
2020-10-04 22:50:14.736 [hingStatusInfoChangedEvent] - 'miio:generic:06F68ECF' changed from OFFLINE to ONLINE
marcelrv commented 3 years ago

suggest to open issue in oh gh to add support for zhimi.fan.za3

marcelrv commented 3 years ago

the cloud errors are typical logon errors, correcting the userid/passwd may help. If you can read chinese, the trace log of the cloudconnector gives an error message in Chinese. next to the error code. Maybe you can translate them and I can add some more meaningful feedback on what is the problem at hand rather than the return code itself.