merdok / homebridge-miot

Homebridge plugin for devices supporting the Xiaomi miot protocol
MIT License
399 stars 64 forks source link

Fan on local connection unresponsive, MiCloud connection timeouts #622

Closed Smexhy closed 1 week ago

Smexhy commented 3 months ago

Describe the bug My Xiaomi Smart fan used to work months back, now however, I am unable to get it work with set through local connection at all. All tokens and IDs are fetched through xiaomi account. Forcing MiCloud connection makes some request work, but mostly just timeouts and repeats trying to reconnect with MiCloud without success. Not sure if there was some change over the last many months with HB, this plugin or Xiaomi fan / firmware. Official Xiaomi Home app works fine though.

Expected behavior Being able to operate this fan through homebridge.

Your config.json

{
    "devices": [
        {
            "name": "Ventilátor",
            "ip": "192.168.1.150",
            "token": "****",
            "deviceId": "496384288",
            "model": "zhimi.fan.za5",
            "pollingInterval": 30,
            "deepDebugLog": true,
            "silentLog": false,
            "deviceEnabled": true,
            "micloud": {
                "username": "****",
                "password": "****",
                "country": "de",
                "forceMiCloud": false
            },
            "customAccessory": false,
            "onlyMainService": true,
            "buzzerControl": false,
            "ledControl": false,
            "childLockControl": false,
            "modeControl": false,
            "horizontalAngleButtons": [
                60,
                90,
                120
            ]
        }
    ],
    "platform": "miot"
}

Debug log

[8/15/2024, 1:09:08 PM] [miot] [Ventilátor] (Protocol) Start handshake 192.168.1.150
[8/15/2024, 1:09:08 PM] [miot] [Ventilátor] (Protocol) 192.168.1.150 <- (1) {"method":"miIO.info","params":{"timeout":5000,"retries":3},"id":101}
[8/15/2024, 1:09:08 PM] [miot] [Ventilátor] (Protocol) 192.168.1.150 <- !1p�9 ����lw�+�����d
[8/15/2024, 1:09:12 PM] [miot] [Ventilátor] (Protocol) Start handshake 192.168.1.150
[8/15/2024, 1:09:12 PM] [miot] [Ventilátor] (Protocol) 192.168.1.150 <- (0) {"method":"miIO.info","params":{"timeout":5000,"retries":3},"id":201}
[8/15/2024, 1:09:12 PM] [miot] [Ventilátor] (Protocol) 192.168.1.150 <- !1p�9 ����)�l�s���'�R?
[8/15/2024, 1:09:16 PM] [miot] [Ventilátor] (Protocol) 192.168.1.150 <- Reached maximum number of retries, giving up miIO.info - {"timeout":5000,"retries":3}
[8/15/2024, 1:09:16 PM] [miot] [Ventilátor] (Protocol) 192.168.1.150 <- Error during send! (timeout) Call to device timed out | Request: {"method":"miIO.info","params":{"timeout":5000,"retries":3},"id":201}
[8/15/2024, 1:09:16 PM] [miot] [Ventilátor] Error: Call to device timed out
[8/15/2024, 1:09:16 PM] [miot] [Ventilátor] Error during connection! Retrying in 60 seconds!
[8/15/2024, 1:10:16 PM] [miot] [Ventilátor] (Protocol) Start handshake 192.168.1.150
[8/15/2024, 1:10:16 PM] [miot] [Ventilátor] (Protocol) Call 192.168.1.150: miIO.info - {"timeout":5000,"retries":3} - {}
[8/15/2024, 1:10:16 PM] [miot] [Ventilátor] (Protocol) Start handshake 192.168.1.150
[8/15/2024, 1:10:16 PM] [miot] [Ventilátor] (Protocol) 192.168.1.150 <- (2) {"method":"miIO.info","params":{"timeout":5000,"retries":3},"id":202}
[8/15/2024, 1:10:16 PM] [miot] [Ventilátor] (Protocol) 192.168.1.150 <- !1p�9 ��@s����k��ZJ��!
[8/15/2024, 1:10:20 PM] [miot] [Ventilátor] (Protocol) Start handshake 192.168.1.150
[8/15/2024, 1:10:20 PM] [miot] [Ventilátor] (Protocol) 192.168.1.150 <- (1) {"method":"miIO.info","params":{"timeout":5000,"retries":3},"id":302}
[8/15/2024, 1:10:20 PM] [miot] [Ventilátor] (Protocol) 192.168.1.150 <- !1p�9 ���,g$^ɝ�%*�Y
[8/15/2024, 1:10:24 PM] [miot] [Ventilátor] (Protocol) Start handshake 192.168.1.150
[8/15/2024, 1:10:24 PM] [miot] [Ventilátor] (Protocol) 192.168.1.150 <- (0) {"method":"miIO.info","params":{"timeout":5000,"retries":3},"id":402}
[8/15/2024, 1:10:24 PM] [miot] [Ventilátor] (Protocol) 192.168.1.150 <- !1p�9 ��[}�CCRB+u�
                                                                                          2�
[8/15/2024, 1:10:28 PM] [miot] [Ventilátor] (Protocol) 192.168.1.150 <- Reached maximum number of retries, giving up miIO.info - {"timeout":5000,"retries":3}
[8/15/2024, 1:10:28 PM] [miot] [Ventilátor] (Protocol) 192.168.1.150 <- Error during send! (timeout) Call to device timed out | Request: {"method":"miIO.info","params":{"timeout":5000,"retries":3},"id":402}
[8/15/2024, 1:10:28 PM] [miot] [Ventilátor] Error: Call to device timed out
[8/15/2024, 1:10:28 PM] [miot] [Ventilátor] Error during connection! Retrying in 60 seconds!
[8/15/2024, 1:11:28 PM] [miot] [Ventilátor] (Protocol) Start handshake 192.168.1.150
[8/15/2024, 1:11:33 PM] [miot] [Ventilátor] Error: Could not connect to device, handshake timeout
[8/15/2024, 1:11:33 PM] [miot] [Ventilátor] Error during connection! Retrying in 60 seconds!
[8/15/2024, 1:11:39 PM] [miot] [Ventilátor] (Protocol) 192.168.1.150 -> Handshake reply

Debug with MiCloud connection force enabled: (as you can see it works for a while and then just starts timeouting. Setting polling rate to 30secs didn't help and anything beyond that would be most likely unusable.)

[8/15/2024, 1:22:13 PM] [miot] [Ventilátor] (MiCloud) Login step 1
[8/15/2024, 1:22:13 PM] [miot] [Ventilátor] (MiCloud) Login step 1 result: OK
[8/15/2024, 1:22:13 PM] [miot] [Ventilátor] (MiCloud) Login step 2
[8/15/2024, 1:22:13 PM] [miot] [Ventilátor] (MiCloud) Login step 2 result: OK 
[8/15/2024, 1:22:13 PM] [miot] [Ventilátor] (MiCloud) Login step 3
[8/15/2024, 1:22:13 PM] [miot] [Ventilátor] (MiCloud) Login step 3 result: OK - ok
[8/15/2024, 1:22:13 PM] [miot] [Ventilátor] (MiCloud) Login successful!
[8/15/2024, 1:22:13 PM] [miot] [Ventilátor] Using server country: de
[8/15/2024, 1:22:13 PM] [miot] [Ventilátor] Successfully connected to MiCloud! Setting up miot device from MiCloud connection!
[8/15/2024, 1:22:13 PM] [miot] [Ventilátor] Fetching device info from the MiCloud!
[8/15/2024, 1:22:13 PM] [miot] [Ventilátor] (MiCloud) Encrypted request https://de.api.io.mi.com/app/home/device_list - {"dids":["496384288"]}
[8/15/2024, 1:22:13 PM] [miot] [Ventilátor] Got device info from MiCloud: 
{
  "did": "496384288",
  "token": "***",
  "longitude": "0.0",
  "latitude": "0.0",
  "name": "Ventilator",
  "pid": "0",
  "localip": "192.168.1.150",
  "mac": "7C:C2:94:36:81:66",
  "ssid": "***",
  "bssid": "D8:B3:70:54:FC:5E",
  "parent_id": "",
  "parent_model": "",
  "show_mode": 1,
  "model": "zhimi.fan.za5",
  "adminFlag": 1,
  "shareFlag": 0,
  "permitLevel": 16,
  "isOnline": true,
  "desc": "Device online ",
  "extra": {
    "isSetPincode": 0,
    "pincodeType": 0,
    "fw_version": "2.2.1",
    "needVerifyCode": 0,
    "isPasswordEncrypt": 0,
    "mcu_version": "0018"
  },
  "uid": 6356753247,
  "pd_id": 2334,
  "password": "",
  "p2p_id": "",
  "rssi": -67,
  "family_id": 0,
  "reset_flag": 0
}
[8/15/2024, 1:22:13 PM] [miot] [Ventilátor] Connected to device: zhimi.fan.za5
[8/15/2024, 1:22:13 PM] [miot] [Ventilátor] Doing initial property fetch.
[8/15/2024, 1:22:13 PM] [miot] [Ventilátor] Preparing property poll!
[8/15/2024, 1:22:13 PM] [miot] [Ventilátor] Splitting properties into chunks. Number of chunks: 2. Chunk size: 14
[8/15/2024, 1:22:13 PM] [miot] [Ventilátor] Chunks:  [
 [
  "fan:on",
  "fan:fan-level",
  "fan:horizontal-swing",
  "fan:horizontal-angle",
  "fan:mode",
  "fan:off-delay",
  "fan:anion",
  "physical-controls-locked:physical-controls-locked",
  "indicator-light:brightness",
  "alarm:alarm",
  "environment:relative-humidity",
  "environment:temperature",
  "custom-service:battery-state",
  "custom-service:speed-now"
 ],
 [
  "custom-service:ac-state",
  "custom-service:speed-level"
 ]
]
[8/15/2024, 1:22:13 PM] [miot] [Ventilátor] (MiCloud) Encrypted request https://de.api.io.mi.com/app/miotspec/prop/get - {"params":[{"did":"496384288","siid":2,"piid":1},{"did":"496384288","siid":2,"piid":2},{"did":"496384288","siid":2,"piid":3},{"did":"496384288","siid":2,"piid":5},{"did":"496384288","siid":2,"piid":7},{"did":"496384288","siid":2,"piid":10},{"did":"496384288","siid":2,"piid":11},{"did":"496384288","siid":3,"piid":1},{"did":"496384288","siid":4,"piid":3},{"did":"496384288","siid":5,"piid":1},{"did":"496384288","siid":7,"piid":1},{"did":"496384288","siid":7,"piid":7},{"did":"496384288","siid":6,"piid":2},{"did":"496384288","siid":6,"piid":4}]}
[8/15/2024, 1:22:13 PM] [miot] [Ventilátor] (MiCloud) Encrypted request https://de.api.io.mi.com/app/miotspec/prop/get - {"params":[{"did":"496384288","siid":6,"piid":5},{"did":"496384288","siid":6,"piid":8}]}
[8/15/2024, 1:22:13 PM] [miot] [Ventilátor] Successfully saved device info!
[8/15/2024, 1:22:15 PM] [miot] [Ventilátor] Successfully updated property chunk! RAW: [{"did":"496384288","iid":"0.2.1","siid":2,"piid":1,"value":true,"code":0,"updateTime":1723718351,"exe_time":0},{"did":"496384288","iid":"0.2.2","siid":2,"piid":2,"value":2,"code":0,"updateTime":1723719960,"exe_time":0},{"did":"496384288","iid":"0.2.3","siid":2,"piid":3,"value":true,"code":0,"updateTime":1723648479,"exe_time":0},{"did":"496384288","iid":"0.2.5","siid":2,"piid":5,"value":60,"code":0,"updateTime":1723717751,"exe_time":0},{"did":"496384288","iid":"0.2.7","siid":2,"piid":7,"value":1,"code":0,"updateTime":1723648479,"exe_time":0},{"did":"496384288","iid":"0.2.10","siid":2,"piid":10,"value":0,"code":0,"updateTime":1723648479,"exe_time":0},{"did":"496384288","iid":"0.2.11","siid":2,"piid":11,"value":true,"code":0,"updateTime":1723648479,"exe_time":0},{"did":"496384288","iid":"0.3.1","siid":3,"piid":1,"value":false,"code":0,"updateTime":1723648479,"exe_time":0},{"did":"496384288","iid":"0.4.3","siid":4,"piid":3,"value":100,"code":0,"updateTime":1723648479,"exe_time":0},{"did":"496384288","iid":"0.5.1","siid":5,"piid":1,"value":false,"code":0,"updateTime":1723648479,"exe_time":0},{"did":"496384288","iid":"0.7.1","siid":7,"piid":1,"value":61,"code":0,"updateTime":1723718351,"exe_time":0},{"did":"496384288","iid":"0.7.7","siid":7,"piid":7,"value":23.8,"code":0,"updateTime":1723718351,"exe_time":0},{"did":"496384288","iid":"0.6.2","siid":6,"piid":2,"value":false,"code":0,"updateTime":1723720935,"exe_time":90,"net_cost":1546,"ot_cost":2,"otlocalts":1723720935474424,"oa_cost":-1,"_oa_rpc_cost":1642},{"did":"496384288","iid":"0.6.4","siid":6,"piid":4,"value":502,"code":0,"updateTime":1723720935,"exe_time":90,"net_cost":1546,"ot_cost":2,"otlocalts":1723720935474424,"oa_cost":-1,"_oa_rpc_cost":1642}]
[8/15/2024, 1:22:15 PM] [miot] [Ventilátor] Property fan:on value changed to ---> true
[8/15/2024, 1:22:15 PM] [miot] [Ventilátor] Property fan:fan-level value changed to ---> 2
[8/15/2024, 1:22:15 PM] [miot] [Ventilátor] Property fan:horizontal-swing value changed to ---> true
[8/15/2024, 1:22:15 PM] [miot] [Ventilátor] Property fan:horizontal-angle value changed to ---> 60
[8/15/2024, 1:22:15 PM] [miot] [Ventilátor] Property fan:mode value changed to ---> 1
[8/15/2024, 1:22:15 PM] [miot] [Ventilátor] Property fan:anion value changed to ---> true
[8/15/2024, 1:22:15 PM] [miot] [Ventilátor] Property indicator-light:brightness value changed to ---> 100
[8/15/2024, 1:22:15 PM] [miot] [Ventilátor] Property environment:relative-humidity value changed to ---> 61
[8/15/2024, 1:22:15 PM] [miot] [Ventilátor] Property environment:temperature value changed to ---> 23.8
[8/15/2024, 1:22:15 PM] [miot] [Ventilátor] Property custom-service:speed-now value changed to ---> 502
[8/15/2024, 1:22:15 PM] [miot] [Ventilátor] Successfully updated property chunk! RAW: [{"did":"496384288","iid":"0.6.5","siid":6,"piid":5,"value":true,"code":0,"updateTime":1723720935,"exe_time":200,"net_cost":1579,"ot_cost":1,"otlocalts":1723720935746890,"oa_cost":-1,"_oa_rpc_cost":1784},{"did":"496384288","iid":"0.6.8","siid":6,"piid":8,"value":46,"code":0,"updateTime":1723719960,"exe_time":0}]
[8/15/2024, 1:22:15 PM] [miot] [Ventilátor] Property custom-service:ac-state value changed to ---> true
[8/15/2024, 1:22:15 PM] [miot] [Ventilátor] Property custom-service:speed-level value changed to ---> 46
[8/15/2024, 1:22:15 PM] [miot] [Ventilátor] Got initial device properties: 
[
  "fan:on: true",
  "fan:fan-level: 2",
  "fan:horizontal-swing: true",
  "fan:horizontal-angle: 60",
  "fan:mode: 1",
  "fan:off-delay: 0",
  "fan:anion: true",
  "physical-controls-locked:physical-controls-locked: false",
  "indicator-light:brightness: 100",
  "alarm:alarm: false",
  "environment:relative-humidity: 61",
  "environment:temperature: 23.8",
  "custom-service:button-press: 0 | (not synced)",
  "custom-service:battery-state: false",
  "custom-service:speed-now: 502",
  "custom-service:ac-state: true",
  "custom-service:speed-level: 46",
  "custom-service:country-code:  | (not synced)",
  "custom-service:temp-sens: false | (not synced)"
]
[8/15/2024, 1:22:15 PM] [miot] [Ventilátor] Starting property polling.
[8/15/2024, 1:22:45 PM] [miot] [Ventilátor] Preparing property poll!
[8/15/2024, 1:22:45 PM] [miot] [Ventilátor] Splitting properties into chunks. Number of chunks: 2. Chunk size: 14
[8/15/2024, 1:22:45 PM] [miot] [Ventilátor] Chunks:  [
 [
  "fan:on",
  "fan:fan-level",
  "fan:horizontal-swing",
  "fan:horizontal-angle",
  "fan:mode",
  "fan:off-delay",
  "fan:anion",
  "physical-controls-locked:physical-controls-locked",
  "indicator-light:brightness",
  "alarm:alarm",
  "environment:relative-humidity",
  "environment:temperature",
  "custom-service:battery-state",
  "custom-service:speed-now"
 ],
 [
  "custom-service:ac-state",
  "custom-service:speed-level"
 ]
]
[8/15/2024, 1:22:45 PM] [miot] [Ventilátor] (MiCloud) Encrypted request https://de.api.io.mi.com/app/miotspec/prop/get - {"params":[{"did":"496384288","siid":2,"piid":1},{"did":"496384288","siid":2,"piid":2},{"did":"496384288","siid":2,"piid":3},{"did":"496384288","siid":2,"piid":5},{"did":"496384288","siid":2,"piid":7},{"did":"496384288","siid":2,"piid":10},{"did":"496384288","siid":2,"piid":11},{"did":"496384288","siid":3,"piid":1},{"did":"496384288","siid":4,"piid":3},{"did":"496384288","siid":5,"piid":1},{"did":"496384288","siid":7,"piid":1},{"did":"496384288","siid":7,"piid":7},{"did":"496384288","siid":6,"piid":2},{"did":"496384288","siid":6,"piid":4}]}
[8/15/2024, 1:22:45 PM] [miot] [Ventilátor] (MiCloud) Encrypted request https://de.api.io.mi.com/app/miotspec/prop/get - {"params":[{"did":"496384288","siid":6,"piid":5},{"did":"496384288","siid":6,"piid":8}]}
[8/15/2024, 1:22:47 PM] [miot] [Ventilátor] Successfully updated property chunk! RAW: [{"did":"496384288","iid":"0.2.1","siid":2,"piid":1,"value":true,"code":0,"updateTime":1723718351,"exe_time":0},{"did":"496384288","iid":"0.2.2","siid":2,"piid":2,"value":2,"code":0,"updateTime":1723719960,"exe_time":0},{"did":"496384288","iid":"0.2.3","siid":2,"piid":3,"value":true,"code":0,"updateTime":1723648479,"exe_time":0},{"did":"496384288","iid":"0.2.5","siid":2,"piid":5,"value":60,"code":0,"updateTime":1723717751,"exe_time":0},{"did":"496384288","iid":"0.2.7","siid":2,"piid":7,"value":1,"code":0,"updateTime":1723648479,"exe_time":0},{"did":"496384288","iid":"0.2.10","siid":2,"piid":10,"value":0,"code":0,"updateTime":1723648479,"exe_time":0},{"did":"496384288","iid":"0.2.11","siid":2,"piid":11,"value":true,"code":0,"updateTime":1723648479,"exe_time":0},{"did":"496384288","iid":"0.3.1","siid":3,"piid":1,"value":false,"code":0,"updateTime":1723648479,"exe_time":0},{"did":"496384288","iid":"0.4.3","siid":4,"piid":3,"value":100,"code":0,"updateTime":1723648479,"exe_time":0},{"did":"496384288","iid":"0.5.1","siid":5,"piid":1,"value":false,"code":0,"updateTime":1723648479,"exe_time":0},{"did":"496384288","iid":"0.7.1","siid":7,"piid":1,"value":61,"code":0,"updateTime":1723718351,"exe_time":0},{"did":"496384288","iid":"0.7.7","siid":7,"piid":7,"value":23.8,"code":0,"updateTime":1723718351,"exe_time":0},{"did":"496384288","iid":"0.6.2","siid":6,"piid":2,"value":false,"code":0,"updateTime":1723720967,"exe_time":90,"net_cost":1898,"otlocalts":1723720967901409,"oa_cost":-1,"_oa_rpc_cost":1995},{"did":"496384288","iid":"0.6.4","siid":6,"piid":4,"value":504,"code":0,"updateTime":1723720967,"exe_time":90,"net_cost":1898,"otlocalts":1723720967901409,"oa_cost":-1,"_oa_rpc_cost":1995}]
[8/15/2024, 1:22:47 PM] [miot] [Ventilátor] Property custom-service:speed-now value changed to ---> 504
[8/15/2024, 1:22:48 PM] [miot] [Ventilátor] Successfully updated property chunk! RAW: [{"did":"496384288","iid":"0.6.5","siid":6,"piid":5,"value":true,"code":0,"updateTime":1723720968,"exe_time":210,"net_cost":1970,"ot_cost":1,"otlocalts":1723720968116288,"oa_cost":-1,"_oa_rpc_cost":2186},{"did":"496384288","iid":"0.6.8","siid":6,"piid":8,"value":46,"code":0,"updateTime":1723719960,"exe_time":0}]
[8/15/2024, 1:22:48 PM] [miot] [Ventilátor] Device properties updated: 
[
  "fan:on: true",
  "fan:fan-level: 2",
  "fan:horizontal-swing: true",
  "fan:horizontal-angle: 60",
  "fan:mode: 1",
  "fan:off-delay: 0",
  "fan:anion: true",
  "physical-controls-locked:physical-controls-locked: false",
  "indicator-light:brightness: 100",
  "alarm:alarm: false",
  "environment:relative-humidity: 61",
  "environment:temperature: 23.8",
  "custom-service:button-press: 0 | (not synced)",
  "custom-service:battery-state: false",
  "custom-service:speed-now: 504",
  "custom-service:ac-state: true",
  "custom-service:speed-level: 46",
  "custom-service:country-code:  | (not synced)",
  "custom-service:temp-sens: false | (not synced)"
]
[8/15/2024, 1:23:02 PM] [miot] [Ventilátor] Set fan:on property request! RAW: {"did":"496384288","siid":2,"piid":1,"value":false}
[8/15/2024, 1:23:02 PM] [miot] [Ventilátor] (MiCloud) Encrypted request https://de.api.io.mi.com/app/miotspec/prop/set - {"params":[{"did":"496384288","siid":2,"piid":1,"value":false}]}
[8/15/2024, 1:23:04 PM] [miot] [Ventilátor] Successfully set property fan:on to value false! Response: [{"did":"496384288","iid":"0.2.1","siid":2,"piid":1,"code":0,"exe_time":0}]
[8/15/2024, 1:23:04 PM] [miot] [Ventilátor] Property fan:on value changed to ---> false
[8/15/2024, 1:23:06 PM] [miot] [Ventilátor] Set fan:on property request! RAW: {"did":"496384288","siid":2,"piid":1,"value":true}
[8/15/2024, 1:23:06 PM] [miot] [Ventilátor] (MiCloud) Encrypted request https://de.api.io.mi.com/app/miotspec/prop/set - {"params":[{"did":"496384288","siid":2,"piid":1,"value":true}]}
[8/15/2024, 1:23:11 PM] [miot] [Ventilátor] Successfully set property fan:on to value true! Response: [{"did":"496384288","iid":"0.2.1","siid":2,"piid":1,"code":0,"exe_time":0}]
[8/15/2024, 1:23:11 PM] [miot] [Ventilátor] Property fan:on value changed to ---> true
[8/15/2024, 1:23:15 PM] [miot] [Ventilátor] Preparing property poll!
[8/15/2024, 1:23:15 PM] [miot] [Ventilátor] Splitting properties into chunks. Number of chunks: 2. Chunk size: 14
[8/15/2024, 1:23:15 PM] [miot] [Ventilátor] Chunks:  [
 [
  "fan:on",
  "fan:fan-level",
  "fan:horizontal-swing",
  "fan:horizontal-angle",
  "fan:mode",
  "fan:off-delay",
  "fan:anion",
  "physical-controls-locked:physical-controls-locked",
  "indicator-light:brightness",
  "alarm:alarm",
  "environment:relative-humidity",
  "environment:temperature",
  "custom-service:battery-state",
  "custom-service:speed-now"
 ],
 [
  "custom-service:ac-state",
  "custom-service:speed-level"
 ]
]
[8/15/2024, 1:23:15 PM] [miot] [Ventilátor] (MiCloud) Encrypted request https://de.api.io.mi.com/app/miotspec/prop/get - {"params":[{"did":"496384288","siid":2,"piid":1},{"did":"496384288","siid":2,"piid":2},{"did":"496384288","siid":2,"piid":3},{"did":"496384288","siid":2,"piid":5},{"did":"496384288","siid":2,"piid":7},{"did":"496384288","siid":2,"piid":10},{"did":"496384288","siid":2,"piid":11},{"did":"496384288","siid":3,"piid":1},{"did":"496384288","siid":4,"piid":3},{"did":"496384288","siid":5,"piid":1},{"did":"496384288","siid":7,"piid":1},{"did":"496384288","siid":7,"piid":7},{"did":"496384288","siid":6,"piid":2},{"did":"496384288","siid":6,"piid":4}]}
[8/15/2024, 1:23:15 PM] [miot] [Ventilátor] (MiCloud) Encrypted request https://de.api.io.mi.com/app/miotspec/prop/get - {"params":[{"did":"496384288","siid":6,"piid":5},{"did":"496384288","siid":6,"piid":8}]}
[8/15/2024, 1:23:19 PM] [miot] [Ventilátor] Set custom-service:speed-level property request! RAW: {"did":"496384288","siid":6,"piid":8,"value":100}
[8/15/2024, 1:23:19 PM] [miot] [Ventilátor] (MiCloud) Encrypted request https://de.api.io.mi.com/app/miotspec/prop/set - {"params":[{"did":"496384288","siid":6,"piid":8,"value":100}]}
[8/15/2024, 1:23:20 PM] [miot] [Ventilátor] Poll failed 1 times!
[8/15/2024, 1:23:20 PM] [miot] [Ventilátor] Poll failed! FetchError: network timeout at: https://de.api.io.mi.com/app/miotspec/prop/get
[8/15/2024, 1:23:24 PM] [miot] [Ventilátor] FetchError: network timeout at: https://de.api.io.mi.com/app/miotspec/prop/set
[8/15/2024, 1:23:26 PM] [miot] [Ventilátor] Set custom-service:speed-level property request! RAW: {"did":"496384288","siid":6,"piid":8,"value":30}
[8/15/2024, 1:23:26 PM] [miot] [Ventilátor] (MiCloud) Encrypted request https://de.api.io.mi.com/app/miotspec/prop/set - {"params":[{"did":"496384288","siid":6,"piid":8,"value":30}]}
[8/15/2024, 1:23:29 PM] [miot] [Ventilátor] Successfully set property custom-service:speed-level to value 30! Response: [{"did":"496384288","iid":"0.6.8","siid":6,"piid":8,"code":0,"exe_time":0}]
[8/15/2024, 1:23:29 PM] [miot] [Ventilátor] Property custom-service:speed-level value changed to ---> 30
[8/15/2024, 1:23:34 PM] [miot] [Ventilátor] Set custom-service:speed-level property request! RAW: {"did":"496384288","siid":6,"piid":8,"value":100}
[8/15/2024, 1:23:34 PM] [miot] [Ventilátor] (MiCloud) Encrypted request https://de.api.io.mi.com/app/miotspec/prop/set - {"params":[{"did":"496384288","siid":6,"piid":8,"value":100}]}
[8/15/2024, 1:23:39 PM] [miot] [Ventilátor] FetchError: network timeout at: https://de.api.io.mi.com/app/miotspec/prop/set
[8/15/2024, 1:23:45 PM] [miot] [Ventilátor] Preparing property poll!
[8/15/2024, 1:23:45 PM] [miot] [Ventilátor] Splitting properties into chunks. Number of chunks: 2. Chunk size: 14
[8/15/2024, 1:23:45 PM] [miot] [Ventilátor] Chunks:  [
 [
  "fan:on",
  "fan:fan-level",
  "fan:horizontal-swing",
  "fan:horizontal-angle",
  "fan:mode",
  "fan:off-delay",
  "fan:anion",
  "physical-controls-locked:physical-controls-locked",
  "indicator-light:brightness",
  "alarm:alarm",
  "environment:relative-humidity",
  "environment:temperature",
  "custom-service:battery-state",
  "custom-service:speed-now"
 ],
 [
  "custom-service:ac-state",
  "custom-service:speed-level"
 ]
]
[8/15/2024, 1:23:45 PM] [miot] [Ventilátor] (MiCloud) Encrypted request https://de.api.io.mi.com/app/miotspec/prop/get - {"params":[{"did":"496384288","siid":2,"piid":1},{"did":"496384288","siid":2,"piid":2},{"did":"496384288","siid":2,"piid":3},{"did":"496384288","siid":2,"piid":5},{"did":"496384288","siid":2,"piid":7},{"did":"496384288","siid":2,"piid":10},{"did":"496384288","siid":2,"piid":11},{"did":"496384288","siid":3,"piid":1},{"did":"496384288","siid":4,"piid":3},{"did":"496384288","siid":5,"piid":1},{"did":"496384288","siid":7,"piid":1},{"did":"496384288","siid":7,"piid":7},{"did":"496384288","siid":6,"piid":2},{"did":"496384288","siid":6,"piid":4}]}
[8/15/2024, 1:23:45 PM] [miot] [Ventilátor] (MiCloud) Encrypted request https://de.api.io.mi.com/app/miotspec/prop/get - {"params":[{"did":"496384288","siid":6,"piid":5},{"did":"496384288","siid":6,"piid":8}]}
[8/15/2024, 1:23:50 PM] [miot] [Ventilátor] Poll failed 2 times!
[8/15/2024, 1:23:50 PM] [miot] [Ventilátor] Poll failed! FetchError: network timeout at: https://de.api.io.mi.com/app/miotspec/prop/get
[8/15/2024, 1:24:04 PM] [miot] [Ventilátor] Set custom-service:speed-level property request! RAW: {"did":"496384288","siid":6,"piid":8,"value":38}
[8/15/2024, 1:24:04 PM] [miot] [Ventilátor] (MiCloud) Encrypted request https://de.api.io.mi.com/app/miotspec/prop/set - {"params":[{"did":"496384288","siid":6,"piid":8,"value":38}]}
[8/15/2024, 1:24:09 PM] [miot] [Ventilátor] FetchError: network timeout at: https://de.api.io.mi.com/app/miotspec/prop/set
[8/15/2024, 1:24:13 PM] [miot] [Ventilátor] Set custom-service:speed-level property request! RAW: {"did":"496384288","siid":6,"piid":8,"value":94}
[8/15/2024, 1:24:13 PM] [miot] [Ventilátor] (MiCloud) Encrypted request https://de.api.io.mi.com/app/miotspec/prop/set - {"params":[{"did":"496384288","siid":6,"piid":8,"value":94}]}
[8/15/2024, 1:24:15 PM] [miot] [Ventilátor] Preparing property poll!
[8/15/2024, 1:24:15 PM] [miot] [Ventilátor] Splitting properties into chunks. Number of chunks: 2. Chunk size: 14
[8/15/2024, 1:24:15 PM] [miot] [Ventilátor] Chunks:  [
 [
  "fan:on",
  "fan:fan-level",
  "fan:horizontal-swing",
  "fan:horizontal-angle",
  "fan:mode",
  "fan:off-delay",
  "fan:anion",
  "physical-controls-locked:physical-controls-locked",
  "indicator-light:brightness",
  "alarm:alarm",
  "environment:relative-humidity",
  "environment:temperature",
  "custom-service:battery-state",
  "custom-service:speed-now"
 ],
 [
  "custom-service:ac-state",
  "custom-service:speed-level"
 ]
]
[8/15/2024, 1:24:15 PM] [miot] [Ventilátor] (MiCloud) Encrypted request https://de.api.io.mi.com/app/miotspec/prop/get - {"params":[{"did":"496384288","siid":2,"piid":1},{"did":"496384288","siid":2,"piid":2},{"did":"496384288","siid":2,"piid":3},{"did":"496384288","siid":2,"piid":5},{"did":"496384288","siid":2,"piid":7},{"did":"496384288","siid":2,"piid":10},{"did":"496384288","siid":2,"piid":11},{"did":"496384288","siid":3,"piid":1},{"did":"496384288","siid":4,"piid":3},{"did":"496384288","siid":5,"piid":1},{"did":"496384288","siid":7,"piid":1},{"did":"496384288","siid":7,"piid":7},{"did":"496384288","siid":6,"piid":2},{"did":"496384288","siid":6,"piid":4}]}
[8/15/2024, 1:24:15 PM] [miot] [Ventilátor] (MiCloud) Encrypted request https://de.api.io.mi.com/app/miotspec/prop/get - {"params":[{"did":"496384288","siid":6,"piid":5},{"did":"496384288","siid":6,"piid":8}]}
[8/15/2024, 1:24:18 PM] [miot] [Ventilátor] FetchError: network timeout at: https://de.api.io.mi.com/app/miotspec/prop/set
[8/15/2024, 1:24:20 PM] [miot] [Ventilátor] Poll failed 3 times!
[8/15/2024, 1:24:20 PM] [miot] [Ventilátor] Poll failed! FetchError: network timeout at: https://de.api.io.mi.com/app/miotspec/prop/get
[8/15/2024, 1:24:45 PM] [miot] [Ventilátor] Preparing property poll!
[8/15/2024, 1:24:45 PM] [miot] [Ventilátor] Splitting properties into chunks. Number of chunks: 2. Chunk size: 14
[8/15/2024, 1:24:45 PM] [miot] [Ventilátor] Chunks:  [
 [
  "fan:on",
  "fan:fan-level",
  "fan:horizontal-swing",
  "fan:horizontal-angle",
  "fan:mode",
  "fan:off-delay",
  "fan:anion",
  "physical-controls-locked:physical-controls-locked",
  "indicator-light:brightness",
  "alarm:alarm",
  "environment:relative-humidity",
  "environment:temperature",
  "custom-service:battery-state",
  "custom-service:speed-now"
 ],
 [
  "custom-service:ac-state",
  "custom-service:speed-level"
 ]
]
[8/15/2024, 1:24:45 PM] [miot] [Ventilátor] (MiCloud) Encrypted request https://de.api.io.mi.com/app/miotspec/prop/get - {"params":[{"did":"496384288","siid":2,"piid":1},{"did":"496384288","siid":2,"piid":2},{"did":"496384288","siid":2,"piid":3},{"did":"496384288","siid":2,"piid":5},{"did":"496384288","siid":2,"piid":7},{"did":"496384288","siid":2,"piid":10},{"did":"496384288","siid":2,"piid":11},{"did":"496384288","siid":3,"piid":1},{"did":"496384288","siid":4,"piid":3},{"did":"496384288","siid":5,"piid":1},{"did":"496384288","siid":7,"piid":1},{"did":"496384288","siid":7,"piid":7},{"did":"496384288","siid":6,"piid":2},{"did":"496384288","siid":6,"piid":4}]}
[8/15/2024, 1:24:45 PM] [miot] [Ventilátor] (MiCloud) Encrypted request https://de.api.io.mi.com/app/miotspec/prop/get - {"params":[{"did":"496384288","siid":6,"piid":5},{"did":"496384288","siid":6,"piid":8}]}
[8/15/2024, 1:24:50 PM] [miot] [Ventilátor] Poll failed 4 times!
[8/15/2024, 1:24:50 PM] [miot] [Ventilátor] Poll failed 4 times in a row! Stopping polling and trying to reconnect! Reason: FetchError: network timeout at: https://de.api.io.mi.com/app/miotspec/prop/get
[8/15/2024, 1:24:50 PM] [miot] [Ventilátor] (MiCloud) Logout from MiCloud for username ***
[8/15/2024, 1:24:50 PM] [miot] [Ventilátor] Device diconnected!
[8/15/2024, 1:24:50 PM] [miot] [Ventilátor] Reconnecting and restarting polling in 60 seconds...
merdok commented 3 months ago

Hi, the issues which you are facing could have multiply reasons. For the cloud issues, it is simply that some servers at some times responds slow and there is literally nothing i can do about that. It helps to switch to a different server if possible, but in general cloud will always feel a bit slower and laggy... The slow local connection can be due the device being overwhelmed with many requests, which might not necessarily come from homebridge. Maybe you have other devices trying to ping or connect to your fan? The hardware in the fan has poor performance so it can easily get sluggish. Also slow local network can also cause such issues, so you should check that. Other then that you can try to reset the fan to factory settings and re-add it with a new token.

Smexhy commented 3 months ago

Hi, cloud is unreliable, that’s u derstandable, thanks for explanation and tips though.Regarding local connection, maybe I worded it wrong, but the issue isn’t that it’s slow, but it’s not working at all, as opposed to cloud thing which only works sometimes, but at least has signs of life. Local connection will remain unresponsive.Odoslané z iPhonuDňa 15. 8. 2024 o 18:13 užívateľ Marcin @.***> napísal: Hi, the issues which you are facing could have multiply reasons. For the cloud issues, it is simply that some servers at some times responds slow and there is literally nothing i can do about that. It helps to switch to a different server if possible, but in general cloud will always feel a bit slower and laggy... The slow local connection can be due the device being overwhelmed with many requests, which might not necessarily come from homebridge. Maybe you have other devices trying to ping or connect to your fan? The hardware in the fan has poor performance so it can easily get sluggish. Also slow local network can also cause such issues, so you should check that. Other then that you can try to reset the fan to factory settings and re-add it with a new token.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

merdok commented 3 months ago

As mentioned already, the device has a very slow hardware and when it gets overwhelmed with requests it usually stops responding and only a reset to factory helps, i remember some people already faced such issues in the past. There could be multiple devices on your network which for some reason might want to ping or connect to the device. It can also be observed when you have multiple different home automation software running which all try to pull the state of the device, that also includes connection to devices directly from xiaomi. Those devices are unfortunately not build for heavy stress from multiple different clients.

Smexhy commented 3 months ago

Understood. I factory reset it already but it didn’t seem to help, so it might be something else like you are saying.Also, wouldn’t the official app be slow as well if that was the case though (the slowness etc.)?Dňa 15. 8. 2024 o 20:58 užívateľ Marcin @.***> napísal: As mentioned already, the device has a very slow hardware and when it gets overwhelmed with requests it usually stops responding and only a reset to factory helps, i remember some people already faced such issues in the past. There could be multiple devices on your network which for some reason might want to ping or connect to the device. It can also be observed when you have multiple different home automation software running which all try to pull the state of the device, that also includes connection to devices directly from xiaomi. Those devices are unfortunately not build for heavy stress from multiple different clients.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

merdok commented 3 months ago

For me the official app is usually slower because it mostly uses the cloud as far as i know