Xiaomi electric fan

Hey
I was wondering if anybody has integrated the xiaomi electric fan in openhab?
I would think this would be in the miio binding range.

Here is a link to the product.
2018 Xiaomi Mijia DC Inverter Fan for Home Cooler House Floor Standing Fan Portable Air Conditioner Natural Wind APP Control
http://s.aliexpress.com/qae2INri?fromSns=Copy to Clipboard

1 Like

I think this is supported by the Xiaomi miio binding. Version 3 off the fan is tested with the binding.

I’ve been looking into buying the fan but last time I looked most shops were out of stock.

Edit: in the mean time I see they are available again… one is on the way to here :slight_smile:

1 Like

Today I (finally) received the Xiaomi Mi Smart Pedestal Fan the lower cost one without battery (zhimi.fan.sa1)
With small update in the database it is now working just fine with the miio binding.

2 Likes

I have just bought a Xiaomi fan, device id is zhimi.fan.za4.

Is it possible to update the binding to include my fan

Hi @ahaghshenas,

Yes, can you please try to control it with the current binding.
Pls add your device manually as basic device. Than overwrite in the config the modelId with zhimi.fan.za1 That most likely will allow the control.
Pls feedback if that works.

That seems to work, not sure if it is 100%.

Move Direction channel doesn’t report anything, even if I move with the Mi Home app

Run Time channel, I am not sure what should be displayed here. It was displaying “5” two days ago and then “6” and now “7” maybe days running?

Also is there a way to control fan speed?

The fan speed I expect is controllable. Maybe your model uses slightly different way for this than mine.

To understand your fan model better, can you make a ‘debug log’

log:set debug org.openhab.binding.miio
log:display org.openhab.binding.miio

This will give insight into what the fan is responding to the commands.

Here is the debug

Blockquote
openhab> log:display org.openhab.binding.miio
16:16:15.784 [DEBUG] [ding.miio.handler.MiIoAbstractHandler] - Received response for 45ed3644 type: GET_PROPERTY, result: [0,“on”], fullresponse: {“id”:133,“result”:[0,“on”]}
16:16:44.879 [DEBUG] [binding.miio.handler.MiIoBasicHandler] - Periodic update for ‘miio:basic:45ed3644’ (miio:basic)
16:16:44.883 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Sending Ping 076DEF4D (192.168.0.148)
16:16:44.981 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Ping 076DEF4D (192.168.0.148) success
16:16:44.986 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {“id”:134,“method”:“get_prop”,“params”:[“power”,“angle_enable”,“use_time”,“angle”,“poweroff_time”]} → 192.168.0.148 (Device: 076DEF4D token: A79D462947A4309DBFAE5DA63A1FA4FD Queue: 1)
16:16:44.989 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Sending Ping 076DEF4D (192.168.0.148)
16:16:45.003 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Ping 076DEF4D (192.168.0.148) success
16:16:45.011 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {“id”:135,“method”:“get_prop”,“params”:[“buzzer”,“led_b”,“child_lock”,“speed_level”,“speed”]} → 192.168.0.148 (Device: 076DEF4D token: A79D462947A4309DBFAE5DA63A1FA4FD Queue: 2)
16:16:45.013 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Sending Ping 076DEF4D (192.168.0.148)
16:16:45.083 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Ping 076DEF4D (192.168.0.148) success
16:16:45.087 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {“id”:136,“method”:“get_prop”,“params”:[“natural_level”,“ac_power”]} → 192.168.0.148 (Device: 076DEF4D token: A79D462947A4309DBFAE5DA63A1FA4FD Queue: 2)
16:16:45.090 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Sending Ping 076DEF4D (192.168.0.148)
16:16:45.185 [DEBUG] [ding.miio.handler.MiIoAbstractHandler] - Received response for 45ed3644 type: GET_PROPERTY, result: [“off”,“off”,32490,90,0], fullresponse: {“id”:134,“result”:[“off”,“off”,32490,90,0]}
16:16:45.194 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Ping 076DEF4D (192.168.0.148) success
16:16:45.201 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {“id”:137,“method”:“miIO.info”,“params”:} → 192.168.0.148 (Device: 076DEF4D token: A79D462947A4309DBFAE5DA63A1FA4FD Queue: 3)
16:16:45.205 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Sending Ping 076DEF4D (192.168.0.148)
16:16:45.216 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Ping 076DEF4D (192.168.0.148) success
16:16:45.227 [DEBUG] [binding.miio.handler.MiIoBasicHandler] - Transformed with ‘SecondsToHours’: Run Time 32490 → 9
16:16:45.685 [DEBUG] [ding.miio.handler.MiIoAbstractHandler] - Received response for 45ed3644 type: GET_PROPERTY, result: [0,1,“off”,74,0], fullresponse: {“id”:135,“result”:[0,1,“off”,74,0]}
16:16:45.865 [DEBUG] [ding.miio.handler.MiIoAbstractHandler] - Received response for 45ed3644 type: GET_PROPERTY, result: [0,“on”], fullresponse: {“id”:136,“result”:[0,“on”]}
16:16:45.902 [DEBUG] [ding.miio.handler.MiIoAbstractHandler] - Received response for 45ed3644 type: MIIO_INFO, result: {“life”:406146,“uid”:1662886216,“model”:“zhimi.fan.za4”,“token”:“a79d462947a4309dbfae5da63a1fa4fd”,“fw_ver”:“2.0.2”,“mcu_fw_ver”:“0008”,“miio_ver”:“0.0.3”,“hw_ver”:“esp32”,“mmfree”:70136,“mac”:“04:CF:8C:30:A4:A4”,“wifi_fw_ver”:“v3.1.3-8-gce4d3fe10”,“ap”:{“rssi”:-54,“ssid”:“Hobas”,“primary”:2,“bssid”:“90:8D:78:68:79:0C”},“netif”:{“localIp”:“192.168.0.148”,“mask”:“255.255.255.0”,“gw”:“192.168.0.1”},“miio_times”:[406145,929,247,404969]}, fullresponse: {“id”:137,“result”:{“life”:406146,“uid”:1662886216,“model”:“zhimi.fan.za4”,“token”:“a79d462947a4309dbfae5da63a1fa4fd”,“fw_ver”:“2.0.2”,“mcu_fw_ver”:“0008”,“miio_ver”:“0.0.3”,“hw_ver”:“esp32”,“mmfree”:70136,“mac”:“04:CF:8C:30:A4:A4”,“wifi_fw_ver”:“v3.1.3-8-gce4d3fe10”,“ap”:{“rssi”:-54,“ssid”:“Hobas”,“primary”:2,“bssid”:“90:8D:78:68:79:0C”},“netif”:{“localIp”:“192.168.0.148”,“mask”:“255.255.255.0”,“gw”:“192.168.0.1”},“miio_times”:[406145,929,247,404969]}}
16:17:15.222 [DEBUG] [binding.miio.handler.MiIoBasicHandler] - Periodic update for ‘miio:basic:45ed3644’ (miio:basic)
16:17:15.224 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Sending Ping 076DEF4D (192.168.0.148)
16:17:15.292 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Ping 076DEF4D (192.168.0.148) success
16:17:15.296 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {“id”:138,“method”:“get_prop”,“params”:[“power”,“angle_enable”,“use_time”,“angle”,“poweroff_time”]} → 192.168.0.148 (Device: 076DEF4D token: A79D462947A4309DBFAE5DA63A1FA4FD Queue: 1)
16:17:15.299 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Sending Ping 076DEF4D (192.168.0.148)
16:17:15.309 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Ping 076DEF4D (192.168.0.148) success
16:17:15.313 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {“id”:139,“method”:“get_prop”,“params”:[“buzzer”,“led_b”,“child_lock”,“speed_level”,“speed”]} → 192.168.0.148 (Device: 076DEF4D token: A79D462947A4309DBFAE5DA63A1FA4FD Queue: 2)
16:17:15.316 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Sending Ping 076DEF4D (192.168.0.148)
16:17:15.324 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Ping 076DEF4D (192.168.0.148) success
16:17:15.328 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {“id”:140,“method”:“get_prop”,“params”:[“natural_level”,“ac_power”]} → 192.168.0.148 (Device: 076DEF4D token: A79D462947A4309DBFAE5DA63A1FA4FD Queue: 3)
16:17:15.337 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Sending Ping 076DEF4D (192.168.0.148)
16:17:15.585 [DEBUG] [ding.miio.handler.MiIoAbstractHandler] - Received response for 45ed3644 type: GET_PROPERTY, result: [“off”,“off”,32490,90,0], fullresponse: {“id”:138,“result”:[“off”,“off”,32490,90,0]}
16:17:15.589 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Ping 076DEF4D (192.168.0.148) success
16:17:15.598 [DEBUG] [binding.miio.handler.MiIoBasicHandler] - Transformed with ‘SecondsToHours’: Run Time 32490 → 9
16:17:15.803 [DEBUG] [ding.miio.handler.MiIoAbstractHandler] - Received response for 45ed3644 type: GET_PROPERTY, result: [0,1,“off”,74,0], fullresponse: {“id”:139,“result”:[0,1,“off”,74,0]}
16:17:15.921 [DEBUG] [ding.miio.handler.MiIoAbstractHandler] - Received response for 45ed3644 type: GET_PROPERTY, result: [0,“on”], fullresponse: {“id”:140,“result”:[0,“on”]}
16:17:45.592 [DEBUG] [binding.miio.handler.MiIoBasicHandler] - Periodic update for ‘miio:basic:45ed3644’ (miio:basic)
16:17:45.594 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Sending Ping 076DEF4D (192.168.0.148)
16:17:46.012 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Ping 076DEF4D (192.168.0.148) success
16:17:46.016 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {“id”:141,“method”:“get_prop”,“params”:[“power”,“angle_enable”,“use_time”,“angle”,“poweroff_time”]} → 192.168.0.148 (Device: 076DEF4D token: A79D462947A4309DBFAE5DA63A1FA4FD Queue: 1)
16:17:46.018 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Sending Ping 076DEF4D (192.168.0.148)
16:17:46.025 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Ping 076DEF4D (192.168.0.148) success
16:17:46.028 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {“id”:142,“method”:“get_prop”,“params”:[“buzzer”,“led_b”,“child_lock”,“speed_level”,“speed”]} → 192.168.0.148 (Device: 076DEF4D token: A79D462947A4309DBFAE5DA63A1FA4FD Queue: 2)
16:17:46.030 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Sending Ping 076DEF4D (192.168.0.148)
16:17:46.037 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Ping 076DEF4D (192.168.0.148) success
16:17:46.040 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {“id”:143,“method”:“get_prop”,“params”:[“natural_level”,“ac_power”]} → 192.168.0.148 (Device: 076DEF4D token: A79D462947A4309DBFAE5DA63A1FA4FD Queue: 3)
16:17:46.042 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Sending Ping 076DEF4D (192.168.0.148)
16:17:46.049 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Ping 076DEF4D (192.168.0.148) success
16:17:46.052 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {“id”:144,“method”:“miIO.info”,“params”:} → 192.168.0.148 (Device: 076DEF4D token: A79D462947A4309DBFAE5DA63A1FA4FD Queue: 4)
16:17:46.054 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Sending Ping 076DEF4D (192.168.0.148)
16:17:46.115 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Ping 076DEF4D (192.168.0.148) success
16:17:46.305 [DEBUG] [ding.miio.handler.MiIoAbstractHandler] - Received response for 45ed3644 type: GET_PROPERTY, result: [“off”,“off”,32490,90,0], fullresponse: {“id”:141,“result”:[“off”,“off”,32490,90,0]}
16:17:46.322 [DEBUG] [binding.miio.handler.MiIoBasicHandler] - Transformed with ‘SecondsToHours’: Run Time 32490 → 9
16:17:46.527 [DEBUG] [ding.miio.handler.MiIoAbstractHandler] - Received response for 45ed3644 type: GET_PROPERTY, result: [0,1,“off”,74,0], fullresponse: {“id”:142,“result”:[0,1,“off”,74,0]}
16:17:46.658 [DEBUG] [ding.miio.handler.MiIoAbstractHandler] - Received response for 45ed3644 type: GET_PROPERTY, result: [0,“on”], fullresponse: {“id”:143,“result”:[0,“on”]}
16:17:46.847 [DEBUG] [ding.miio.handler.MiIoAbstractHandler] - Received response for 45ed3644 type: MIIO_INFO, result: {“life”:406207,“uid”:1662886216,“model”:“zhimi.fan.za4”,“token”:“a79d462947a4309dbfae5da63a1fa4fd”,“fw_ver”:“2.0.2”,“mcu_fw_ver”:“0008”,“miio_ver”:“0.0.3”,“hw_ver”:“esp32”,“mmfree”:70136,“mac”:“04:CF:8C:30:A4:A4”,“wifi_fw_ver”:“v3.1.3-8-gce4d3fe10”,“ap”:{“rssi”:-56,“ssid”:“Hobas”,“primary”:2,“bssid”:“90:8D:78:68:79:0C”},“netif”:{“localIp”:“192.168.0.148”,“mask”:“255.255.255.0”,“gw”:“192.168.0.1”},“miio_times”:[406206,929,247,405030]}, fullresponse: {“id”:144,“result”:{“life”:406207,“uid”:1662886216,“model”:“zhimi.fan.za4”,“token”:“a79d462947a4309dbfae5da63a1fa4fd”,“fw_ver”:“2.0.2”,“mcu_fw_ver”:“0008”,“miio_ver”:“0.0.3”,“hw_ver”:“esp32”,“mmfree”:70136,“mac”:“04:CF:8C:30:A4:A4”,“wifi_fw_ver”:“v3.1.3-8-gce4d3fe10”,“ap”:{“rssi”:-56,“ssid”:“Hobas”,“primary”:2,“bssid”:“90:8D:78:68:79:0C”},“netif”:{“localIp”:“192.168.0.148”,“mask”:“255.255.255.0”,“gw”:“192.168.0.1”},“miio_times”:[406206,929,247,405030]}}
16:18:16.118 [DEBUG] [binding.miio.handler.MiIoBasicHandler] - Periodic update for ‘miio:basic:45ed3644’ (miio:basic)
16:18:16.120 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Sending Ping 076DEF4D (192.168.0.148)
16:18:16.221 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Ping 076DEF4D (192.168.0.148) success
16:18:16.226 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {“id”:145,“method”:“get_prop”,“params”:[“power”,“angle_enable”,“use_time”,“angle”,“poweroff_time”]} → 192.168.0.148 (Device: 076DEF4D token: A79D462947A4309DBFAE5DA63A1FA4FD Queue: 1)
16:18:16.234 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Sending Ping 076DEF4D (192.168.0.148)
16:18:16.425 [DEBUG] [ding.miio.handler.MiIoAbstractHandler] - Received response for 45ed3644 type: GET_PROPERTY, result: [“off”,“off”,32490,90,0], fullresponse: {“id”:145,“result”:[“off”,“off”,32490,90,0]}
16:18:16.429 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Ping 076DEF4D (192.168.0.148) success
16:18:16.432 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {“id”:146,“method”:“get_prop”,“params”:[“buzzer”,“led_b”,“child_lock”,“speed_level”,“speed”]} → 192.168.0.148 (Device: 076DEF4D token: A79D462947A4309DBFAE5DA63A1FA4FD Queue: 1)
16:18:16.433 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Sending Ping 076DEF4D (192.168.0.148)
16:18:16.448 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Ping 076DEF4D (192.168.0.148) success
16:18:16.452 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {“id”:147,“method”:“get_prop”,“params”:[“natural_level”,“ac_power”]} → 192.168.0.148 (Device: 076DEF4D token: A79D462947A4309DBFAE5DA63A1FA4FD Queue: 2)
16:18:16.455 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Sending Ping 076DEF4D (192.168.0.148)
16:18:16.734 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Ping 076DEF4D (192.168.0.148) success
16:18:16.743 [DEBUG] [binding.miio.handler.MiIoBasicHandler] - Transformed with ‘SecondsToHours’: Run Time 32490 → 9
16:18:16.883 [DEBUG] [ding.miio.handler.MiIoAbstractHandler] - Received response for 45ed3644 type: GET_PROPERTY, result: [0,1,“off”,74,0], fullresponse: {“id”:146,“result”:[0,1,“off”,74,0]}
16:18:17.050 [DEBUG] [ding.miio.handler.MiIoAbstractHandler] - Received response for 45ed3644 type: GET_PROPERTY, result: [0,“on”], fullresponse: {“id”:147,“result”:[0,“on”]}
16:18:46.739 [DEBUG] [binding.miio.handler.MiIoBasicHandler] - Periodic update for ‘miio:basic:45ed3644’ (miio:basic)
16:18:46.744 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Sending Ping 076DEF4D (192.168.0.148)
16:18:46.839 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Ping 076DEF4D (192.168.0.148) success
16:18:46.842 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {“id”:148,“method”:“get_prop”,“params”:[“power”,“angle_enable”,“use_time”,“angle”,“poweroff_time”]} → 192.168.0.148 (Device: 076DEF4D token: A79D462947A4309DBFAE5DA63A1FA4FD Queue: 1)
16:18:46.845 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Sending Ping 076DEF4D (192.168.0.148)
16:18:46.854 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Ping 076DEF4D (192.168.0.148) success
16:18:46.858 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {“id”:149,“method”:“get_prop”,“params”:[“buzzer”,“led_b”,“child_lock”,“speed_level”,“speed”]} → 192.168.0.148 (Device: 076DEF4D token: A79D462947A4309DBFAE5DA63A1FA4FD Queue: 2)
16:18:46.861 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Sending Ping 076DEF4D (192.168.0.148)
16:18:46.874 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Ping 076DEF4D (192.168.0.148) success
16:18:46.878 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {“id”:150,“method”:“get_prop”,“params”:[“natural_level”,“ac_power”]} → 192.168.0.148 (Device: 076DEF4D token: A79D462947A4309DBFAE5DA63A1FA4FD Queue: 2)
16:18:46.881 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Sending Ping 076DEF4D (192.168.0.148)
16:18:46.964 [DEBUG] [ding.miio.handler.MiIoAbstractHandler] - Received response for 45ed3644 type: GET_PROPERTY, result: [“off”,“off”,32490,90,0], fullresponse: {“id”:148,“result”:[“off”,“off”,32490,90,0]}
16:18:47.453 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Ping 076DEF4D (192.168.0.148) success
16:18:47.455 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {“id”:151,“method”:“miIO.info”,“params”:} → 192.168.0.148 (Device: 076DEF4D token: A79D462947A4309DBFAE5DA63A1FA4FD Queue: 3)
16:18:47.457 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Sending Ping 076DEF4D (192.168.0.148)
16:18:47.465 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Ping 076DEF4D (192.168.0.148) success
16:18:47.473 [DEBUG] [binding.miio.handler.MiIoBasicHandler] - Transformed with ‘SecondsToHours’: Run Time 32490 → 9
16:18:47.643 [DEBUG] [ding.miio.handler.MiIoAbstractHandler] - Received response for 45ed3644 type: GET_PROPERTY, result: [0,1,“off”,74,0], fullresponse: {“id”:149,“result”:[0,1,“off”,74,0]}
16:18:47.784 [DEBUG] [ding.miio.handler.MiIoAbstractHandler] - Received response for 45ed3644 type: GET_PROPERTY, result: [0,“on”], fullresponse: {“id”:150,“result”:[0,“on”]}
16:18:48.281 [DEBUG] [ding.miio.handler.MiIoAbstractHandler] - Received response for 45ed3644 type: MIIO_INFO, result: {“life”:406268,“uid”:1662886216,“model”:“zhimi.fan.za4”,“token”:“a79d462947a4309dbfae5da63a1fa4fd”,“fw_ver”:“2.0.2”,“mcu_fw_ver”:“0008”,“miio_ver”:“0.0.3”,“hw_ver”:“esp32”,“mmfree”:70136,“mac”:“04:CF:8C:30:A4:A4”,“wifi_fw_ver”:“v3.1.3-8-gce4d3fe10”,“ap”:{“rssi”:-56,“ssid”:“Hobas”,“primary”:2,“bssid”:“90:8D:78:68:79:0C”},“netif”:{“localIp”:“192.168.0.148”,“mask”:“255.255.255.0”,“gw”:“192.168.0.1”},“miio_times”:[406267,929,247,405091]}, fullresponse: {“id”:151,“result”:{“life”:406268,“uid”:1662886216,“model”:“zhimi.fan.za4”,“token”:“a79d462947a4309dbfae5da63a1fa4fd”,“fw_ver”:“2.0.2”,“mcu_fw_ver”:“0008”,“miio_ver”:“0.0.3”,“hw_ver”:“esp32”,“mmfree”:70136,“mac”:“04:CF:8C:30:A4:A4”,“wifi_fw_ver”:“v3.1.3-8-gce4d3fe10”,“ap”:{“rssi”:-56,“ssid”:“Hobas”,“primary”:2,“bssid”:“90:8D:78:68:79:0C”},“netif”:{“localIp”:“192.168.0.148”,“mask”:“255.255.255.0”,“gw”:“192.168.0.1”},“miio_times”:[406267,929,247,405091]}}
16:19:17.490 [DEBUG] [binding.miio.handler.MiIoBasicHandler] - Periodic update for ‘miio:basic:45ed3644’ (miio:basic)
16:19:17.496 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Sending Ping 076DEF4D (192.168.0.148)
16:19:17.559 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Ping 076DEF4D (192.168.0.148) success
16:19:17.565 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {“id”:152,“method”:“get_prop”,“params”:[“power”,“angle_enable”,“use_time”,“angle”,“poweroff_time”]} → 192.168.0.148 (Device: 076DEF4D token: A79D462947A4309DBFAE5DA63A1FA4FD Queue: 1)
16:19:17.569 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Sending Ping 076DEF4D (192.168.0.148)
16:19:17.666 [DEBUG] [ding.miio.handler.MiIoAbstractHandler] - Received response for 45ed3644 type: GET_PROPERTY, result: [“off”,“off”,32490,90,0], fullresponse: {“id”:152,“result”:[“off”,“off”,32490,90,0]}
16:19:17.674 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Ping 076DEF4D (192.168.0.148) success
16:19:17.681 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {“id”:153,“method”:“get_prop”,“params”:[“buzzer”,“led_b”,“child_lock”,“speed_level”,“speed”]} → 192.168.0.148 (Device: 076DEF4D token: A79D462947A4309DBFAE5DA63A1FA4FD Queue: 1)
16:19:17.685 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Sending Ping 076DEF4D (192.168.0.148)
16:19:17.692 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Ping 076DEF4D (192.168.0.148) success
16:19:17.699 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {“id”:154,“method”:“get_prop”,“params”:[“natural_level”,“ac_power”]} → 192.168.0.148 (Device: 076DEF4D token: A79D462947A4309DBFAE5DA63A1FA4FD Queue: 2)
16:19:17.702 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Sending Ping 076DEF4D (192.168.0.148)
16:19:18.173 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Ping 076DEF4D (192.168.0.148) success
16:19:18.182 [DEBUG] [binding.miio.handler.MiIoBasicHandler] - Transformed with ‘SecondsToHours’: Run Time 32490 → 9
16:19:18.344 [DEBUG] [ding.miio.handler.MiIoAbstractHandler] - Received response for 45ed3644 type: GET_PROPERTY, result: [0,1,“off”,74,0], fullresponse: {“id”:153,“result”:[0,1,“off”,74,0]}
16:19:18.524 [DEBUG] [ding.miio.handler.MiIoAbstractHandler] - Received response for 45ed3644 type: GET_PROPERTY, result: [0,“on”], fullresponse: {“id”:154,“result”:[0,“on”]}
16:19:48.179 [DEBUG] [binding.miio.handler.MiIoBasicHandler] - Periodic update for ‘miio:basic:45ed3644’ (miio:basic)
16:19:48.182 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Sending Ping 076DEF4D (192.168.0.148)
16:19:48.279 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Ping 076DEF4D (192.168.0.148) success
16:19:48.284 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {“id”:155,“method”:“get_prop”,“params”:[“power”,“angle_enable”,“use_time”,“angle”,“poweroff_time”]} → 192.168.0.148 (Device: 076DEF4D token: A79D462947A4309DBFAE5DA63A1FA4FD Queue: 1)
16:19:48.289 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Sending Ping 076DEF4D (192.168.0.148)
16:19:48.296 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Ping 076DEF4D (192.168.0.148) success
16:19:48.303 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {“id”:156,“method”:“get_prop”,“params”:[“buzzer”,“led_b”,“child_lock”,“speed_level”,“speed”]} → 192.168.0.148 (Device: 076DEF4D token: A79D462947A4309DBFAE5DA63A1FA4FD Queue: 2)
16:19:48.306 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Sending Ping 076DEF4D (192.168.0.148)
16:19:48.314 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Ping 076DEF4D (192.168.0.148) success
16:19:48.318 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {“id”:157,“method”:“get_prop”,“params”:[“natural_level”,“ac_power”]} → 192.168.0.148 (Device: 076DEF4D token: A79D462947A4309DBFAE5DA63A1FA4FD Queue: 3)
16:19:48.323 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Sending Ping 076DEF4D (192.168.0.148)
16:19:48.689 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Ping 076DEF4D (192.168.0.148) success
16:19:48.692 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {“id”:158,“method”:“miIO.info”,“params”:} → 192.168.0.148 (Device: 076DEF4D token: A79D462947A4309DBFAE5DA63A1FA4FD Queue: 3)
16:19:48.693 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Sending Ping 076DEF4D (192.168.0.148)
16:19:48.884 [DEBUG] [ding.miio.handler.MiIoAbstractHandler] - Received response for 45ed3644 type: GET_PROPERTY, result: [“off”,“off”,32490,90,0], fullresponse: {“id”:155,“result”:[“off”,“off”,32490,90,0]}
16:19:48.891 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Ping 076DEF4D (192.168.0.148) success
16:19:48.897 [DEBUG] [binding.miio.handler.MiIoBasicHandler] - Transformed with ‘SecondsToHours’: Run Time 32490 → 9
16:19:49.063 [DEBUG] [ding.miio.handler.MiIoAbstractHandler] - Received response for 45ed3644 type: GET_PROPERTY, result: [0,1,“off”,74,0], fullresponse: {“id”:156,“result”:[0,1,“off”,74,0]}
16:19:49.233 [DEBUG] [ding.miio.handler.MiIoAbstractHandler] - Received response for 45ed3644 type: GET_PROPERTY, result: [0,“on”], fullresponse: {“id”:157,“result”:[0,“on”]}
16:19:49.724 [DEBUG] [ding.miio.handler.MiIoAbstractHandler] - Received response for 45ed3644 type: MIIO_INFO, result: {“life”:406329,“uid”:1662886216,“model”:“zhimi.fan.za4”,“token”:“a79d462947a4309dbfae5da63a1fa4fd”,“fw_ver”:“2.0.2”,“mcu_fw_ver”:“0008”,“miio_ver”:“0.0.3”,“hw_ver”:“esp32”,“mmfree”:70136,“mac”:“04:CF:8C:30:A4:A4”,“wifi_fw_ver”:“v3.1.3-8-gce4d3fe10”,“ap”:{“rssi”:-56,“ssid”:“Hobas”,“primary”:2,“bssid”:“90:8D:78:68:79:0C”},“netif”:{“localIp”:“192.168.0.148”,“mask”:“255.255.255.0”,“gw”:“192.168.0.1”},“miio_times”:[406329,929,247,405153]}, fullresponse: {“id”:158,“result”:{“life”:406329,“uid”:1662886216,“model”:“zhimi.fan.za4”,“token”:“a79d462947a4309dbfae5da63a1fa4fd”,“fw_ver”:“2.0.2”,“mcu_fw_ver”:“0008”,“miio_ver”:“0.0.3”,“hw_ver”:“esp32”,“mmfree”:70136,“mac”:“04:CF:8C:30:A4:A4”,“wifi_fw_ver”:“v3.1.3-8-gce4d3fe10”,“ap”:{“rssi”:-56,“ssid”:“Hobas”,“primary”:2,“bssid”:“90:8D:78:68:79:0C”},“netif”:{“localIp”:“192.168.0.148”,“mask”:“255.255.255.0”,“gw”:“192.168.0.1”},“miio_times”:[406329,929,247,405153]}}

It seems the channel “use_time” is receiving a raw value of 32490

and the handler is transforming with ‘SecondsToHours’ which gives a value of 9

But there is no way that the fan has only ran 9 hours

So, the good news is that the properties appear to be similar, as wrong/unknown properties result in null responses or no response.

Wrt to the use time, as the timer is also not increasing this may be something else e.g. the total hours / days that the fan was one or something. don’t really know. You say it was increasing by the day…is your fan on for the whole day?

the direction does not have a property, that means that it can only send commands, but will not display any value. If I recall right, you can send left and right to it

Wrt the speed,… there are 2 fields for that, speed and speedlevel. you may eed t experiment what the values are (change them in the mihome app, see what is the result in OH) you should than be able to send similar values via OH

Hi Marcel,

could you explain what you mean with "Than overwrite in the config the modelId with zhimi.fan.za1". Where do i have to overwrite the modelid and how?

Do you have already an updated jar file of your binding, which I could try?

Regards,

Riza

I mean, go into the thing configuration. There you can see the modelId…If communication is working, this would be auto populated with the model of your fan.
Overwrite this with the modelId zhimi.fan.za1 as than the binding will take that model’s commands/channels etc.

This way you can experiment with devices for which no definition exists yet by using similar models.
Many models share similar commands, with slight variations depending on the devices capabilities.

Marcel,

I did edit the device model string as shown in the picture:

However, it stays being unsupported:
image

No fan control channels are available. What am I doing wrong?

Normally that should work. You can try to add it as a basic device instead (manually), than it does not do the switching of thingtype in the background.
Make sure you remove the unsupported type as 2 things for the same device gives connectivity issues

That did the trick. I was trying to reconfigure the “found” thing, but I hat to create it from scratch. Thank you.

The Speedlevel, Natural Level an Angle can be controlled with this sitemap:

Slider item=speedLevel
Slider item=naturalLevel
Switch item=angle label="angle []" mappings=[30="30°", 60="60°", 90="90°", 120="120°"]

update: This does work for Basic UI. Speedlevel control does not work with the app. I have no idea, why.

Hi,

in my openhab app under iOS it works great. no issue.
Thanks for the template.

1 Like

I can confirm that it does not work on Android app. Interesting…
But I’m also unable to enable sound via the Buzzer channel.
I tried adding the device as a zhimi.fan.v3 as well, as it does in fact have a battery, but am unable to get any charge info from it.

What is it we need to add the zhimi.fan.za4 device properly? I see the section about adding local database files to support new devices. Any more detailed descriptions someone can share?

I’ve added it yesterday based on the za1 fan, so it will be availabe in the new build.
I checked the source, and I did not see any reference to a battery level / AC switch. Do you see anythink like that in the mihome app? Otherwise it may be the case it does not expose any property of the battery…

for the local db, there is indeed no documentation… but the if you look at the file it should give a good idea of how to add a property by copy/paste a similar one. Suggest to start with trying commands via the command channel (e.g. try something like 'get_properties("battery")' and once you see your device responds with a good response you can add it as a channel. If you have a better file than pls share.

1 Like