Xiaomi Mi Air Purifier 3/3H - No Response

Hello community,

I’m currently trying to fix my Xiaomi Air Purifier integration. The connection has been a bit buggy since a long time (OH 2.x / but skipped 3.x). E.g. I had to send commands twice or wait 30 seconds to take effect. But it was okay.

Meanwhile, and I asumed due to some device updates, it became much worse.Some items are updated, some not at all and changing states or modes via openHAB succeed maybe only on 15th try.

In the logs I get the following at every update periodically:

2024-04-23 09:12:55.364 [DEBUG] [nal.transport.MiIoAsyncCommunication] - Communication error for Mi device at 192.168.24.16: Receive timed out
2024-04-23 09:12:55.365 [DEBUG] [nal.transport.MiIoAsyncCommunication] - Received message is without id: {"error":"No Response"}

Full periodically log entries:


2024-04-23 09:12:55.364 [DEBUG] [nal.transport.MiIoAsyncCommunication] - Communication error for Mi device at 192.168.24.16: Receive timed out
2024-04-23 09:12:55.364 [DEBUG] [nal.transport.MiIoAsyncCommunication] - No response from device 358311438 at 192.168.24.16 for command {"id":2513,"method":"get_properties","params":[{"did":"filter-used-time","siid":4,"piid":5}]}.
2024-04-23 09:12:55.365 [DEBUG] [nal.transport.MiIoAsyncCommunication] - Received message is without id: {"error":"No Response"}
2024-04-23 09:12:55.365 [DEBUG] [internal.handler.MiIoAbstractHandler] - Received response for device airpurifier1 type: GET_PROPERTIES, result: {}, fullresponse: {"error":"Received message is without id"}
2024-04-23 09:12:55.365 [DEBUG] [internal.handler.MiIoAbstractHandler] - Error received for command '{"id":2513,"method":"get_properties","params":[{"did":"filter-used-time","siid":4,"piid":5}]}': "Received message is without id".

2024-04-23 09:12:56.079 [DEBUG] [internal.handler.MiIoAbstractHandler] - Received response for device airpurifier1 type: GET_PROPERTIES, result: [{"did":"alarm","siid":5,"piid":1,"code":0,"value":false}], fullresponse: {"id":2514,"result":[{"did":"alarm","siid":5,"piid":1,"code":0,"value":false}],"exe_time":180}
2024-04-23 09:12:56.378 [DEBUG] [internal.handler.MiIoAbstractHandler] - Received response for device airpurifier1 type: GET_PROPERTIES, result: [{"did":"brightness","siid":6,"piid":1,"code":0,"value":0}], fullresponse: {"id":2515,"result":[{"did":"brightness","siid":6,"piid":1,"code":0,"value":0}],"exe_time":250}
2024-04-23 09:12:56.378 [DEBUG] [io.internal.handler.MiIoBasicHandler] - 'miio:basic:airpurifier1' channel 'brightness' has unit 'percentage' with symbol '%'.
2024-04-23 09:12:56.674 [DEBUG] [internal.handler.MiIoAbstractHandler] - Received response for device airpurifier1 type: GET_PROPERTIES, result: [{"did":"on1","siid":6,"piid":6,"code":0,"value":true}], fullresponse: {"id":2516,"result":[{"did":"on1","siid":6,"piid":6,"code":0,"value":true}],"exe_time":240}
2024-04-23 09:12:56.993 [DEBUG] [internal.handler.MiIoAbstractHandler] - Received response for device airpurifier1 type: GET_PROPERTIES, result: [{"did":"physical-controls-locked","siid":7,"piid":1,"code":0,"value":false}], fullresponse: {"id":2517,"result":[{"did":"physical-controls-locked","siid":7,"piid":1,"code":0,"value":false}],"exe_time":210}
2024-04-23 09:12:57.229 [DEBUG] [internal.handler.MiIoAbstractHandler] - Received response for device airpurifier1 type: GET_PROPERTIES, result: [{"did":"button-pressed","siid":8,"piid":1,"code":-4001}], fullresponse: {"id":2518,"result":[{"did":"button-pressed","siid":8,"piid":1,"code":-4001}],"exe_time":200}
2024-04-23 09:12:57.229 [DEBUG] [io.internal.handler.MiIoBasicHandler] - Error updating miio:basic:airpurifier1 property button-pressed with 'null' : java.lang.NullPointerException: null
2024-04-23 09:12:57.522 [DEBUG] [internal.handler.MiIoAbstractHandler] - Received response for device airpurifier1 type: GET_PROPERTIES, result: [{"did":"filter-max-time","siid":9,"piid":1,"code":0,"value":3500}], fullresponse: {"id":2519,"result":[{"did":"filter-max-time","siid":9,"piid":1,"code":0,"value":3500}],"exe_time":240}
2024-04-23 09:12:57.813 [DEBUG] [internal.handler.MiIoAbstractHandler] - Received response for device airpurifier1 type: GET_PROPERTIES, result: [{"did":"filter-hour-debug","siid":9,"piid":2,"code":0,"value":225}], fullresponse: {"id":2520,"result":[{"did":"filter-hour-debug","siid":9,"piid":2,"code":0,"value":225}],"exe_time":240}
2024-04-23 09:12:58.122 [DEBUG] [internal.handler.MiIoAbstractHandler] - Received response for device airpurifier1 type: GET_PROPERTIES, result: [{"did":"motor-strong","siid":10,"piid":1,"code":0,"value":2150}], fullresponse: {"id":2521,"result":[{"did":"motor-strong","siid":10,"piid":1,"code":0,"value":2150}],"exe_time":240}
2024-04-23 09:12:58.392 [DEBUG] [internal.handler.MiIoAbstractHandler] - Received response for device airpurifier1 type: GET_PROPERTIES, result: [{"did":"motor-high","siid":10,"piid":2,"code":0,"value":1900}], fullresponse: {"id":2522,"result":[{"did":"motor-high","siid":10,"piid":2,"code":0,"value":1900}],"exe_time":220}
2024-04-23 09:12:58.735 [DEBUG] [internal.handler.MiIoAbstractHandler] - Received response for device airpurifier1 type: GET_PROPERTIES, result: [{"did":"motor-med","siid":10,"piid":3,"code":0,"value":1600}], fullresponse: {"id":2523,"result":[{"did":"motor-med","siid":10,"piid":3,"code":0,"value":1600}],"exe_time":250}
2024-04-23 09:12:58.956 [DEBUG] [internal.handler.MiIoAbstractHandler] - Received response for device airpurifier1 type: GET_PROPERTIES, result: [{"did":"motor-med-l","siid":10,"piid":4,"code":0,"value":1300}], fullresponse: {"id":2524,"result":[{"did":"motor-med-l","siid":10,"piid":4,"code":0,"value":1300}],"exe_time":180}
2024-04-23 09:12:59.240 [DEBUG] [internal.handler.MiIoAbstractHandler] - Received response for device airpurifier1 type: GET_PROPERTIES, result: [{"did":"motor-low","siid":10,"piid":5,"code":0,"value":770}], fullresponse: {"id":2525,"result":[{"did":"motor-low","siid":10,"piid":5,"code":0,"value":770}],"exe_time":240}
2024-04-23 09:12:59.538 [DEBUG] [internal.handler.MiIoAbstractHandler] - Received response for device airpurifier1 type: GET_PROPERTIES, result: [{"did":"motor-silent","siid":10,"piid":6,"code":0,"value":390}], fullresponse: {"id":2526,"result":[{"did":"motor-silent","siid":10,"piid":6,"code":0,"value":390}],"exe_time":250}
2024-04-23 09:12:59.859 [DEBUG] [internal.handler.MiIoAbstractHandler] - Received response for device airpurifier1 type: GET_PROPERTIES, result: [{"did":"motor-favorite","siid":10,"piid":7,"code":0,"value":2150}], fullresponse: {"id":2527,"result":[{"did":"motor-favorite","siid":10,"piid":7,"code":0,"value":2150}],"exe_time":220}
2024-04-23 09:13:00.113 [DEBUG] [internal.handler.MiIoAbstractHandler] - Received response for device airpurifier1 type: GET_PROPERTIES, result: [{"did":"motor-speed","siid":10,"piid":8,"code":0,"value":0}], fullresponse: {"id":2528,"result":[{"did":"motor-speed","siid":10,"piid":8,"code":0,"value":0}],"exe_time":200}
2024-04-23 09:13:00.460 [DEBUG] [internal.handler.MiIoAbstractHandler] - Received response for device airpurifier1 type: GET_PROPERTIES, result: [{"did":"motor-set-speed","siid":10,"piid":9,"code":0,"value":0}], fullresponse: {"id":2529,"result":[{"did":"motor-set-speed","siid":10,"piid":9,"code":0,"value":0}],"exe_time":240}
2024-04-23 09:13:00.675 [DEBUG] [internal.handler.MiIoAbstractHandler] - Received response for device airpurifier1 type: GET_PROPERTIES, result: [{"did":"favorite-fan-level","siid":10,"piid":10,"code":0,"value":14}], fullresponse: {"id":2530,"result":[{"did":"favorite-fan-level","siid":10,"piid":10,"code":0,"value":14}],"exe_time":160}
2024-04-23 09:13:00.974 [DEBUG] [internal.handler.MiIoAbstractHandler] - Received response for device airpurifier1 type: GET_PROPERTIES, result: [{"did":"use-time","siid":12,"piid":1,"code":0,"value":24222000}], fullresponse: {"id":2531,"result":[{"did":"use-time","siid":12,"piid":1,"code":0,"value":24222000}],"exe_time":240}
2024-04-23 09:13:00.974 [DEBUG] [io.internal.handler.MiIoBasicHandler] - 'miio:basic:airpurifier1' channel 'use-time' has unit 'seconds' with symbol 's'.
2024-04-23 09:13:01.295 [DEBUG] [internal.handler.MiIoAbstractHandler] - Received response for device airpurifier1 type: GET_PROPERTIES, result: [{"did":"purify-volume","siid":13,"piid":1,"code":0,"value":310770}], fullresponse: {"id":2532,"result":[{"did":"purify-volume","siid":13,"piid":1,"code":0,"value":310770}],"exe_time":230}
2024-04-23 09:13:01.295 [DEBUG] [io.internal.handler.MiIoBasicHandler] - 'miio:basic:airpurifier1' channel 'purify-volume' has unit 'liter' with symbol 'l'.
2024-04-23 09:13:01.532 [DEBUG] [internal.handler.MiIoAbstractHandler] - Received response for device airpurifier1 type: GET_PROPERTIES, result: [{"did":"average-aqi","siid":13,"piid":2,"code":0,"value":2}], fullresponse: {"id":2533,"result":[{"did":"average-aqi","siid":13,"piid":2,"code":0,"value":2}],"exe_time":210}
2024-04-23 09:13:01.833 [DEBUG] [internal.handler.MiIoAbstractHandler] - Received response for device airpurifier1 type: GET_PROPERTIES, result: [{"did":"average-aqi-cnt","siid":13,"piid":3,"code":0,"value":80740}], fullresponse: {"id":2534,"result":[{"did":"average-aqi-cnt","siid":13,"piid":3,"code":0,"value":80740}],"exe_time":260}
2024-04-23 09:13:07.896 [DEBUG] [io.internal.handler.MiIoBasicHandler] - Periodic update for 'miio:basic:airpurifier1' (miio:basic)
2024-04-23 09:13:07.897 [DEBUG] [internal.handler.MiIoAbstractHandler] - Skipping periodic update for 'miio:basic:airpurifier1'. 21 elements in queue.

Sending a command (e.g. turning device on) seems to be added to the queue but does never happen most times or sometimes after a lot of tries.

==> data/openhab_userdata/logs/events.log <==
2024-04-23 09:13:51.935 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'air_purifier1_on' received command ON
2024-04-23 09:13:51.936 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'air_purifier1_on' predicted to become ON
2024-04-23 09:13:51.937 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'air_purifier1_on' changed from OFF to ON

==> data/openhab_userdata/logs/openhab.log <==
2024-04-23 09:13:51.940 [DEBUG] [io.internal.handler.MiIoBasicHandler] - Locating action for miio:basic:airpurifier1 channel 'on': 'ON'
2024-04-23 09:13:51.940 [DEBUG] [io.internal.handler.MiIoBasicHandler] - Sending command set_properties[{"did":"on","siid":2,"piid":2,"value":true}]
2024-04-23 09:13:51.940 [DEBUG] [nal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":2609,"method":"set_properties","params":[{"did":"on","siid":2,"piid":2,"value":true}]} -> 192.168.24.16 (Device: 358311438 token: 67DAF50CXXXXXXXXXXXXXXXXA218B94E Queue: 45).

Thing config:

//Xiaomi Mi Device 155B660E (358311438)
//Xiaomi Mi Device
//155B660E

// NAME:     Mi Air Purifier 3/3H
// ID:       358311438
// MAC:      54:48:E6:4D:8C:A3
// IP:       192.168.24.16
// TOKEN:    67DAF50CXXXXXXXXXXXXXXXXA218B94E
// MODEL:    zhimi.airpurifier.mb3

Thing miio:basic:airpurifier1 "airpurifier1" [ host="192.168.24.16", token="67DAF50CXXXXXXXXXXXXXXXXA218B94E", deviceId="358311438", model="zhimi.airpurifier.mb3", communication="direct" ]

Item config:

Group G_airpurifier "Mi Air Purifier 3/3H" <status>
Number air_purifier1_fault "Air Purifier - Fault" (G_airpurifier) {channel="miio:basic:airpurifier1:fault"}
Switch air_purifier1_on "Air Purifier - Switch Status" (G_airpurifier) {channel="miio:basic:airpurifier1:on"}
Number air_purifier1_fan_level (G_airpurifier) {channel="miio:basic:airpurifier1:fan-level"}
Number air_purifier1_mode "Air Purifier - Mode" (G_airpurifier) {channel="miio:basic:airpurifier1:mode"}
Number air_purifier1_pm2_5_density "Environment - Pm2.5 density" (G_airpurifier) {channel="miio:basic:airpurifier1:pm2_5-density"}
Number air_purifier1_relative_humidity "Environment - Relative Humidity" (G_airpurifier) {channel="miio:basic:airpurifier1:relative-humidity"}
Number:Temperature air_purifier1_temperature_temp (G_airpurifier) {channel="miio:basic:airpurifier1:temperature"}
Number:Temperature air_purifier1_temperature "Environment - Temperature" (G_airpurifier)
Number air_purifier1_filter_life_level "Filter - Filter Life Level" (G_airpurifier) {channel="miio:basic:airpurifier1:filter-life-level"}
Number:Time air_purifier1_filter_used_time "Filter - Filter Used Time" (G_airpurifier) {channel="miio:basic:airpurifier1:filter-used-time"}
Switch air_purifier1_alarm "Alarm - Alarm" (G_airpurifier) {channel="miio:basic:airpurifier1:alarm"}
Number:Dimensionless air_purifier1_brightness "Indicator Light - Brightness" (G_airpurifier) {channel="miio:basic:airpurifier1:brightness"}
Switch air_purifier1_on1 "Indicator Light - Switch Status" (G_airpurifier) {channel="miio:basic:airpurifier1:on1"}
Switch air_purifier1_physical_controls_locked "Physical Control Locked - Physical Control Locked" (G_airpurifier) {channel="miio:basic:airpurifier1:physical-controls-locked"}
String air_purifier1_button_pressed "Button - Button Pressed" (G_airpurifier) {channel="miio:basic:airpurifier1:button-pressed"}
Number air_purifier1_filter_max_time "Filter Time - Filter Max Time" (G_airpurifier) {channel="miio:basic:airpurifier1:filter-max-time"}
Number air_purifier1_filter_hour_debug "Filter Time - Filter Hour Debug" (G_airpurifier) {channel="miio:basic:airpurifier1:filter-hour-debug"}
Number air_purifier1_motor_strong "Motor Speed - Motor Strong" (G_airpurifier) {channel="miio:basic:airpurifier1:motor-strong"}
Number air_purifier1_motor_high "Motor Speed - Motor High" (G_airpurifier) {channel="miio:basic:airpurifier1:motor-high"}
Number air_purifier1_motor_med "Motor Speed - Motor Med" (G_airpurifier) {channel="miio:basic:airpurifier1:motor-med"}
Number air_purifier1_motor_med_l "Motor Speed - Motor Med L" (G_airpurifier) {channel="miio:basic:airpurifier1:motor-med-l"}
Number air_purifier1_motor_low "Motor Speed - Motor Low" (G_airpurifier) {channel="miio:basic:airpurifier1:motor-low"}
Number air_purifier1_motor_silent "Motor Speed - Motor Silent" (G_airpurifier) {channel="miio:basic:airpurifier1:motor-silent"}
Number air_purifier1_motor_favorite "Motor Speed - Motor Favorite" (G_airpurifier) {channel="miio:basic:airpurifier1:motor-favorite"}
Number air_purifier1_motor_speed "Motor Speed - Motor Speed" (G_airpurifier) {channel="miio:basic:airpurifier1:motor-speed"}
Number air_purifier1_motor_set_speed "Motor Speed - Motor Set Speed" (G_airpurifier) {channel="miio:basic:airpurifier1:motor-set-speed"}
Number air_purifier1_favorite_fan_level "Motor Speed - Favorite Fan Level" (G_airpurifier) {channel="miio:basic:airpurifier1:favorite-fan-level"}
Number:Time air_purifier1_use_time "Use Time - Use Time" (G_airpurifier) {channel="miio:basic:airpurifier1:use-time"}
Number:Volume air_purifier1_purify_volume "Aqi - Purify Volume" (G_airpurifier) {channel="miio:basic:airpurifier1:purify-volume"}
Number air_purifier1_average_aqi "Aqi - Average Aqi" (G_airpurifier) {channel="miio:basic:airpurifier1:average-aqi"}
Number air_purifier1_average_aqi_cnt "Aqi - Average Aqi Cnt" (G_airpurifier) {channel="miio:basic:airpurifier1:average-aqi-cnt"}
String air_purifier1_aqi_zone "Aqi - Aqi Zone" (G_airpurifier) {channel="miio:basic:airpurifier1:aqi-zone"}
String air_purifier1_sensor_state "Aqi - Sensor State" (G_airpurifier) {channel="miio:basic:airpurifier1:sensor-state"}
Number air_purifier1_aqi_goodh "Aqi - Aqi Goodh" (G_airpurifier) {channel="miio:basic:airpurifier1:aqi-goodh"}
Number air_purifier1_aqi_runstate "Aqi - Aqi Runstate" (G_airpurifier) {channel="miio:basic:airpurifier1:aqi-runstate"}
Number air_purifier1_aqi_state "Aqi - Aqi State" (G_airpurifier) {channel="miio:basic:airpurifier1:aqi-state"}
Number air_purifier1_aqi_updata_heartbeat "Aqi - Aqi Updata Heartbeat" (G_airpurifier) {channel="miio:basic:airpurifier1:aqi-updata-heartbeat"}
String air_purifier1_rfid_tag "Rfid - Rfid Tag" (G_airpurifier) {channel="miio:basic:airpurifier1:rfid-tag"}
String air_purifier1_rfid_factory_id "Rfid - Rfid Factory Id" (G_airpurifier) {channel="miio:basic:airpurifier1:rfid-factory-id"}
String air_purifier1_rfid_product_id "Rfid - Rfid Product Id" (G_airpurifier) {channel="miio:basic:airpurifier1:rfid-product-id"}
String air_purifier1_rfid_time "Rfid - Rfid Time" (G_airpurifier) {channel="miio:basic:airpurifier1:rfid-time"}
String air_purifier1_rfid_serial_num "Rfid - Rfid Serial Num" (G_airpurifier) {channel="miio:basic:airpurifier1:rfid-serial-num"}
Number air_purifier1_app_extra "Others - App Extra" (G_airpurifier) {channel="miio:basic:airpurifier1:app-extra"}
Number air_purifier1_main_channel "Others - Main Channel" (G_airpurifier) {channel="miio:basic:airpurifier1:main-channel"}
Number air_purifier1_slave_channel "Others - Slave Channel" (G_airpurifier) {channel="miio:basic:airpurifier1:slave-channel"}
String air_purifier1_cola "Others - Cola" (G_airpurifier) {channel="miio:basic:airpurifier1:cola"}
Switch air_purifier1_buttom_door "Others - Buttom Door" (G_airpurifier) {channel="miio:basic:airpurifier1:buttom-door"}
Number air_purifier1_reboot_cause "Others - Reboot Cause" (G_airpurifier) {channel="miio:basic:airpurifier1:reboot-cause"}
Number air_purifier1_hw_version "Others - Hw Version" (G_airpurifier) {channel="miio:basic:airpurifier1:hw-version"}
Number air_purifier1_iic_error_count "Others - Iic Error Count" (G_airpurifier) {channel="miio:basic:airpurifier1:iic-error-count"}
Number air_purifier1_manual_level "Others - Manual Level" (G_airpurifier) {channel="miio:basic:airpurifier1:manual-level"}
Number air_purifier1_country_code "Others - National Code" (G_airpurifier) {channel="miio:basic:airpurifier1:country-code"}
Number air_purifier2_Life "Life" (G_airpurifier) {channel="miio:basic:airpurifier1:network#life"}
String air_purifier1_ExecuteCommand "Execute Command" (G_airpurifier) {channel="miio:basic:airpurifier1:actions#commands"}

More information:

  • Tested on openHAB 4.0.0 and 4.1.2 with no difference.
  • openHAB instance and device are on the same subnet and openHAB can ping device (70-600ms).
  • Device can be controlled via MiHome App perfectly and immediatly.
  • I want to connect to the devices exclusively direct and without cloud. I want to disable the devices internet connection to prevent it from talking home.
  • I already do this with a Roborock vaccum which works good.

Any help fixing this is highly appreciated. Pollen season is in full swing here… :slightly_smiling_face:

suggest to remove all the non-essential channels.
You have many channels enabled, that means lot of data needs to be pulled.
Some of the devices get overwhelmed if so many data elements are pulled.

600ms ping is rather long, so may also be bit of connectivity issue ones in a while.
you can also try to reduce the refresh rate, that may also increase the response to commands (as th queue is not full with all sort of refresh requests)

normally your queue should be pretty empty, so it suggest some congestion (r.g. I see in your log 45 entries in the queue… if your ping would be 600 that means indeed 30 sec delay for your command to execute)

Thanks Marcel for your hints.

  • I removed a lot of channels. From initial 54 to 19 remaining.
  • The refreshInterval is now 60 seconds. The default seems to be 30.

With this the elements in queue now vary between 9-16 elements. Turning the device on/off now tooks ~1-2 minutes but seems to be reliable. Regarding the ping time: I took the average of 100 pings and it’s 268ms.

  1. Is the number of elements in the queue normal/expectable?

Should it normally be 0 at the period update? Because the log still shows: Skipping periodic update for 'miio:basic:airpurifier1'. 9 elements in queue.

  1. Do you know what the following means that now occurs occasionally?

Custom Refresh for device 'miio:basic:airpurifier1': 0 channels

No, the queue should normally be empty before the next refresh. Having still vijand there indeed shows the is sinds slowness. I guess some poor connection as ping times are normally under 30ms in a local network.

What you can try…

Get the JSON for for your device from GitHub.
Change the
“maxProperties”: 1,

To a higher number. You can experiment with the value, but up to 5 is prob possible.

That will make that less commands are needed to refresh, hence may go faster

Some devices use non standard commands to pull the values. Have not double checked if your does…but I would guess that you either get that every 60 seconds or never… Occasionally is odd