Closed denysdovhan closed 3 years ago
xiaomi_miio documentation xiaomi_miio source (message by IssueLinks)
Hey there @rytilahti, @syssi, mind taking a look at this issue as its been labeled with a integration (xiaomi_miio
) you are listed as a codeowner for? Thanks!
(message by CodeOwnersMention)
I suspect this to be a hardware issue. The 3H unit is responding very badly to pings and requests. I see a constant ping response time in the hundreds of ms and even timeouts, with the unit next to my access point.
Having bad pings is OK - it doesn’t break functionality. I’m worried about purifier getting completely unavailable after some time.
This usually happens every 6-12 hours for me and requires reboot of router and Home Assistant.
Having bad pings is indicative of the responsiveness of the unit, this will also reflect in its reachability from HA. However I don't have the issue where I need to restart anything to get it working again. It just doesn't respond very often.
Seems like I have managed to fix purifier getting completely unavailable every few hours. I manually specified my model:
fan:
- platform: xiaomi_miio
name: purifier
model: zhimi.airpurifier.mb3 # I specified my model here
host: !secret purifier_host
token: !secret purifier_token
After that change, my purifier is still up for more than 48 hours.
However, general availability is still blinking:
I have the same issue
Could it be related to cloud connectivity issues? Some xiaomi vacuums are known to have issues if the packets are simply dropped, see https://python-miio.readthedocs.io/en/latest/troubleshooting.html#intermittent-connection-issues-timeouts-xiaomi-vacuum
Sometimes 'user ack timeout' indicates that the command is not supported by the device, but consider it is working sometimes that shouldn't be the case..
After upgrade to 0.112, my purifier gets completely unavailable. Restarting HA, router, or purifier doesn't help.
See the already linked 'command error' issue which is the likely the cause, that is however a different problem than this 'user ack timeout' issue.
I've rolled back to the previous 0.111.* release.
And it is working just fine with it? Maybe there are differences between devices/firmware version/something, that is causing the timeout instead of that command error. In that case this would be a duplicate of that issue.
ade to 0.112, my purifier gets completely unavailable. Restarting HA, router, or purifier doesn't help.
also for me, the update of ha to 0.102 has made the purifier 3h unusable. its status is: not available
After update i got the same problem :/ [homeassistant.components.xiaomi_miio.fan] Got exception while fetching the state: {'code': -5001, 'message': 'command error'}
For 'command error', see https://github.com/home-assistant/core/issues/36993 which will be fixed with a new python-miio release, sorry for the inconvenience :(
Still error in HA 0.112.2 and python-miio 0.5.2.1. My device is Xiaomi Air Purifier 3 (zhimi.airpurifier.ma4)
2020-07-04 17:48:52 ERROR (MainThread) [homeassistant.components.xiaomi_miio.fan] Got exception while fetching the state: {'code': -9999, 'message': 'user ack timeout'}
2020-07-04 18:24:04 ERROR (SyncWorker_10) [miio.miioprotocol] Unable to discover a device at address 192.168.100.227
2020-07-04 18:24:04 ERROR (MainThread) [homeassistant.components.xiaomi_miio.fan] Got exception while fetching the state: Unable to discover the device 192.168.100.227
2020-07-04 18:39:28 ERROR (MainThread) [homeassistant.components.xiaomi_miio.fan] Got exception while fetching the state: {'code': -9999, 'message': 'user ack timeout'}
2020-07-04 19:03:17 ERROR (SyncWorker_9) [miio.miioprotocol] Unable to discover a device at address 192.168.100.227
2020-07-04 19:03:17 ERROR (MainThread) [homeassistant.components.xiaomi_miio.fan] Got exception while fetching the state: Unable to discover the device 192.168.100.227
2020-07-04 19:05:21 ERROR (SyncWorker_14) [miio.miioprotocol] Unable to discover a device at address 192.168.100.227
2020-07-04 19:05:21 ERROR (MainThread) [homeassistant.components.xiaomi_miio.fan] Got exception while fetching the state: Unable to discover the device 192.168.100.227
2020-07-04 19:21:22 ERROR (SyncWorker_4) [miio.miioprotocol] Unable to discover a device at address 192.168.100.227
2020-07-04 19:21:22 ERROR (MainThread) [homeassistant.components.xiaomi_miio.fan] Got exception while fetching the state: Unable to discover the device 192.168.100.227
2020-07-04 20:26:52 ERROR (MainThread) [homeassistant.components.xiaomi_miio.fan] Got exception while fetching the state: {'code': -9999, 'message': 'user ack timeout'}
2020-07-04 20:39:16 ERROR (MainThread) [homeassistant.components.xiaomi_miio.fan] Got exception while fetching the state: {'code': -9999, 'message': 'user ack timeout'}
2020-07-04 20:51:18 ERROR (SyncWorker_13) [miio.miioprotocol] Unable to discover a device at address 192.168.100.227
2020-07-04 20:51:18 ERROR (MainThread) [homeassistant.components.xiaomi_miio.fan] Got exception while fetching the state: Unable to discover the device 192.168.100.227
2020-07-04 21:01:02 ERROR (SyncWorker_16) [miio.miioprotocol] Unable to discover a device at address 192.168.100.227
2020-07-04 21:01:02 ERROR (MainThread) [homeassistant.components.xiaomi_miio.fan] Got exception while fetching the state: Unable to discover the device 192.168.100.227
2020-07-04 21:22:13 ERROR (SyncWorker_7) [miio.miioprotocol] Unable to discover a device at address 192.168.100.227
2020-07-04 21:22:13 ERROR (MainThread) [homeassistant.components.xiaomi_miio.fan] Got exception while fetching the state: Unable to discover the device 192.168.100.227
2020-07-04 21:25:19 ERROR (SyncWorker_5) [miio.miioprotocol] Unable to discover a device at address 192.168.100.227
2020-07-04 21:25:19 ERROR (MainThread) [homeassistant.components.xiaomi_miio.fan] Got exception while fetching the state: Unable to discover the device 192.168.100.227
2020-07-04 21:39:46 ERROR (SyncWorker_9) [miio.miioprotocol] Unable to discover a device at address 192.168.100.227
2020-07-04 21:39:46 ERROR (MainThread) [homeassistant.components.xiaomi_miio.fan] Got exception while fetching the state: Unable to discover the device 192.168.100.227
2020-07-04 21:51:14 ERROR (SyncWorker_10) [miio.miioprotocol] Unable to discover a device at address 192.168.100.227
2020-07-04 21:51:14 ERROR (MainThread) [homeassistant.components.xiaomi_miio.fan] Got exception while fetching the state: Unable to discover the device 192.168.100.227
2020-07-04 21:52:02 ERROR (MainThread) [homeassistant.components.xiaomi_miio.fan] Got exception while fetching the state: {'code': -9999, 'message': 'user ack timeout'}
@balloob please, reopen this issue. The error message persists in logs.
FYI, I have upgraded to HA 0.113.3 (with the bump of python-miio) but still have an issue (Xiaomi Air Purifier 3H).
2020-08-02 16:16:50 ERROR (MainThread) [homeassistant.components.xiaomi_miio.fan] Got exception while fetching the state: {'code': -9999, 'message': 'user ack timeout'}
No discovery issues in my logs (python miio fix).
Okay, let's reopen this, but I don't really know what would be a suitable fix for this. That {'code': -9999, 'message': 'user ack timeout'}
message is coming from the device itself, so for some reason it fails to execute the called method.
On potential way to alleviate this would be either to retry (or ignore it from homeassistant's side and keep the old state) but it feels a bit hacky solution.
The same issue (user ack timeout) with model zhimi.humidifier.ca1 (Air Humidifier v2) Home Assistant 0.113.1 python-miio==0.5.2.1
On potential way to alleviate this would be either to retry (or ignore it from homeassistant's side and keep the old state) but it feels a bit hacky solution.
I think it's really better than got log full of this messages.
@alive-corpse Could you check the error of your device (CA1) a second time? It's a "user ack timeout" or "UART timeout"?
I add myself to this thread
Using
miiocli device --ip IP --token TOKEN info
It works:
Model: zhimi.airpurifier.mb3 Hardware version: esp32 Firmware version: 2.0.5
Using
miiocli airpurifiermiot --ip IP --token TOKEN status
It doesn't work:
Error: {'code': -9999, 'message': 'user ack timeout'}
miiocli, version 0.5.4
I'm getting a lot of these too:
Got exception while fetching the state: Unable to discover the device 192.168.254.156
Got exception while fetching the state: {'code': -9999, 'message': 'user ack timeout'}
Retrying the call with a small timeout and a limit of x retries would probably be a good fix.
I'm getting a lot of these too:
Got exception while fetching the state: Unable to discover the device 192.168.254.156 Got exception while fetching the state: {'code': -9999, 'message': 'user ack timeout'}
Retrying the call with a small timeout and a limit of x retries would probably be a good fix.
How ??
I'm getting a lot of these too:
Got exception while fetching the state: Unable to discover the device 192.168.254.156 Got exception while fetching the state: {'code': -9999, 'message': 'user ack timeout'}
Retrying the call with a small timeout and a limit of x retries would probably be a good fix.
How ??
I don't know, I'm still learning Python. But as a quick fix setting self._available
(line 1097) of fan.py to True
would probably fix the unavailable
messages. But this is not a good fix in any way, so we should probably wait for someone with more talent then me to resolve this issue.
Got the same problem (with Xiaomi Air Purifier 3H):
[homeassistant.components.xiaomi_miio.fan] Got exception while fetching the state: {'code': -9999, 'message': 'user ack timeout'}
Would be nice to have some working solution
Restart your purifier. If you connect to it after restarting, I agee that it happens when you are querying your purifier too many times in a short delay. I use node red and I can set querying delay, I have no more problem increasing this delay.
Restart your purifier. If you connect to it after restarting, I agee that it happens when you are querying your purifier too many times in a short delay. I use node red and I can set querying delay, I have no more problem increasing this delay.
Great suggestion Mind sharing your nodered recipe?
I use https://python-miio.readthedocs.io/en/latest/ with an "exec" node (executes a system command) I increased querying time from 5s to 30s.
If you want to reduce the update interval you could change the scan_interval
. cp.
https://www.home-assistant.io/docs/configuration/platform_options/
Where does the component increase the scan_interval? fan
by default uses 30s and I haven't seen any different in xiaomi_miio
: https://github.com/home-assistant/core/blob/13cdf0ba6310c92758a858405dab60ad371e8a46/homeassistant/components/fan/__init__.py#L27
@SeraphimSerapis You are right. The component uses the default value.
I've tried adjusting the scan_interval, but it doesn't solve the issue for me. Although less, I still get 'unavailable' status.
Same here - set scan_interval: 60, but I'm still getting:
[homeassistant.components.xiaomi_miio.fan] Got exception while fetching the state: {'code': -9999, 'message': 'user ack timeout'}
Additionally, I noticed that this parameter has no real impact on refreshing, e.g. AQI value refreshes irregularly every 3 to 20 minutes. I also noticed that with longer refresh intervals it helps to use Mi Home application (it forces values to refresh).
I'm getting a lot of these too:
Got exception while fetching the state: Unable to discover the device 192.168.254.156 Got exception while fetching the state: {'code': -9999, 'message': 'user ack timeout'}
Retrying the call with a small timeout and a limit of x retries would probably be a good fix.
Totally Same problem.
Same problem, but i not get discover problem, only "-9999" message.
It not affect the working, only trash the log.
Same problem here with HA core-2021.4.6
Got exception while fetching the state: {'code': -9999, 'message': 'user ack timeout'}
The problem
I have connected my Mi Air Purifier 3H (zhimi.airpurifier.mb3) via Xiaomi Air Purifier integration. This model is specified as a supported one.
However, I’ve noticed it gets offline from time to time, every 30-90 minutes.
If you take a closer look at the history graph, you’ll notice that availability is blinking and eventually it gets unavailable completely every few hours. Only rebooting a router and/or humidifier helps to get it back online.
Environment
Problem-relevant
configuration.yaml
Traceback/Error logs
The most interesting part here (from my point of view):
Additional information
Probably I've found relevant issues: