XiaomiGateway3
                                
                                
                                
                                    XiaomiGateway3 copied to clipboard
                            
                            
                            
                        Question: Downlight “090615.light.mlig02”response too slowly
- 
I bought a downlight,and I found that the light name is "090615.light.mlig02" displayed in "Xiaomi Miot Auto".and it shows the information below:
090615.light.mlig02 manufacturer:090615 firmware:2.1.1_1200
 - 
in xiaomi gateway 3,this light is just been recongized as a unkown mesh device,but I can turn it on and off normally ,and it respose normally with low latency.
 - 
I found a mesh downlight named “[090615.light.mlig01](https://home.miot-spec.com/s/3416)” in the xiaomigateway3 [homepage](https://github.com/AlexxIT/XiaomiGateway3). So I decided to find the right place of this device in the code.
 - 
I found the [090615.light.mlig01](https://home.miot-spec.com/s/3416) light in **[devices.py](https://github.com/AlexxIT/XiaomiGateway3/blob/master/custom_components/xiaomi_gateway3/core/converters/devices.py) :
3416: ["PTX", "Mesh Downlight", "090615.light.mlig01"], "spec": [ Converter("light", "light", mi="2.p.1"), BrightnessConv("brightness", mi="2.p.2", parent="light", max=100), ColorTempKelvin("color_temp", mi="2.p.3", parent="light"), ] - 
I turned on the debug log ,and I found that the pdid (number (pdid) for BLE and Mesh devices) in xiaomi_gateway3_2.log is 4924.
2022-08-08 23:25:02,909 SysInfo: {'installation_type': 'Home Assistant Container', 'version': '2022.9.0.dev20220805', 'dev': True, 'hassio': False, 'virtualenv': False, 'python_version': '3.10.5', 'docker': True, 'arch': 'x86_64', 'timezone': 'Asia/Shanghai', 'os_name': 'Linux', 'os_version': '4.4.59+', 'user': 'root'} 2022-08-08 23:25:03,358 192.168.x.xxx [BASE] Start main loop 2022-08-08 23:25:04,731 192.168.x.xxx [BASE] Prepare gateway gw3 with fw 1.5.0_0026 2022-08-08 23:25:04,947 192.168.x.xxx [BASE] 54ef443d756e (lumi.gateway.mgl03) setup gateway ZNDMWG03LM ZNDMWG02LM: alarm, command, data, cloud_link, led, gateway 2022-08-08 23:25:04,950 192.168.x.xxx [MIOT] 54ef443d756e (lumi.gateway.mgl03) read {'mi_spec': [{'siid': 3, 'piid': 1}, {'siid': 3, 'piid': 22}]} 2022-08-08 23:25:05,261 192.168.x.xxx [BASE] ccb5d1ae2dce (4924) setup mesh (4924): switch 2022-08-08 23:25:05,363 192.168.x.xxx [BASE] Patch Bluetooth 2022-08-08 23:25:05,363 192.168.x.xxx [BASE] Applied 0 patches to daemons 2022-08-08 23:25:05,369 192.168.x.xxx [BASE] MQTT connected 2022-08-08 23:25:32,875 192.168.x.xxx [MIOT] ccb5d1ae2dce (4924) send {'mi_spec': [{'siid': 2, 'piid': 1, 'value': True}]} 2022-08-08 23:25:33,477 192.168.x.xxx [MQTT] log/miio b'\x1b[0;32m2022:08:08:23:25:32.727 [D] miio_client_func: ot_agent_recv_handler_one(): fd:9, msg:{"method":"properties_changed","params":[{"did":"1001062945","siid":2,"piid":1,"value":true}],"id":5063} length:104 bytes\x1b[0m' 2022-08-08 23:25:33,505 192.168.x.xxx [MIOT] ccb5d1ae2dce (4924) read {'mi_spec': [{'siid': 2, 'piid': 1}]} 2022-08-08 23:25:33,994 192.168.x.xxx [MIOT] ccb5d1ae2dce (4924) send {'mi_spec': [{'siid': 2, 'piid': 1, 'value': False}]} 2022-08-08 23:25:34,577 192.168.x.xxx [MQTT] log/miio b'\x1b[0;32m2022:08:08:23:25:33.827 [D] miio_client_func: ot_agent_recv_handler_one(): fd:9, msg:{"method":"properties_changed","params":[{"did":"1001062945","siid":2,"piid":1,"value":false}],"id":5064} length:105 bytes\x1b[0m' 2022-08-08 23:25:34,719 192.168.x.xxx [MIOT] ccb5d1ae2dce (4924) read {'mi_spec': [{'siid': 2, 'piid': 1}]} 2022-08-08 23:25:57,710 192.168.x.xxx [MQTT] log/miio b'\x1b[0;32m2022:08:08:23:25:56.958 [D] miio_client_func: ot_agent_recv_handler_one(): fd:9, msg:{"method":"event.gw.heartbeat","params":[{"free_mem":3104,"ip":"192.168.x.xxx","load_avg":"2.28|2.26|2.05|4\\/85|8112","rssi":51,"run_time":29041,"setupcode":"304-12-098","ssid":"TP-LINK_C863","tz":"GMT8"}],"id":5069} length:216 bytes\x1b[0m' 2022-08-08 23:25:57,714 192.168.x.xxx [BASE] Gateway time offset: -0.7083353996276855 - 
So, I tried to modify the [devices.py](http://devices.py) below and restarted the homeassistant.
4924: ["PTX", "Mesh Downlight", "090615.light.mlig02"], "spec": [ Converter("light", "light", mi="2.p.1"), BrightnessConv("brightness", mi="2.p.2", parent="light", max=100), ColorTempKelvin("color_temp", mi="2.p.3", parent="light"), ] - 
After restarted , this downlight can be recongnized correctly ,and it can be turned on/off, brightness and color_temp also can be changed.But it responsed very slowly!
 - 
I decided to look up the xiaomi_gateway3_2.log again,It shows below:
2022-08-08 23:57:33,670 192.168.x.xxx [MIOT] ccb5d1ae2dce (4924) read {'mi_spec': [{'siid': 2, 'piid': 1, 'did': '1001062945'}, {'siid': 2, 'piid': 2, 'did': '1001062945'}, {'siid': 2, 'piid': 3, 'did': '1001062945'}]} 2022-08-08 23:57:34,279 192.168.x.xxx [MQTT] log/miio b'\x1b[0;32m2022:08:08:23:57:34.527 [D] miio_client_func: ot_agent_recv_handler_one(): fd:9, msg:{"method":"properties_changed","params":[{"did":"1001062945","siid":2,"piid":1,"value":true},{"did":"1001062945","siid":2,"piid":3,"value":4081}],"id":5384} length:156 bytes\x1b[0m' 2022-08-08 23:57:38,679 192.168.x.xxx [MQTT] log/miio b'\x1b[0;32m2022:08:08:23:57:38.927 [D] miio_client_func: ot_agent_recv_handler_one(): fd:9, msg:{"method":"properties_changed","params":[{"did":"1001062945","siid":2,"piid":1,"value":true},{"did":"1001062945","siid":2,"piid":3,"value":4081}],"id":5386} length:156 bytes\x1b[0m' 2022-08-08 23:57:43,079 192.168.x.xxx [MQTT] log/miio b'\x1b[0;32m2022:08:08:23:57:43.327 [D] miio_client_func: ot_agent_recv_handler_one(): fd:9, msg:{"method":"properties_changed","params":[{"did":"1001062945","siid":2,"piid":1,"value":true},{"did":"1001062945","siid":2,"piid":3,"value":4081}],"id":5387} length:156 bytes\x1b[0m' 2022-08-08 23:57:47,479 192.168.x.xxx [MQTT] log/miio b'\x1b[0;32m2022:08:08:23:57:47.727 [D] miio_client_func: ot_agent_recv_handler_one(): fd:9, msg:{"method":"properties_changed","params":[{"did":"1001062945","siid":2,"piid":1,"value":true},{"did":"1001062945","siid":2,"piid":3,"value":4081}],"id":5389} length:156 bytes\x1b[0m' 2022-08-08 23:57:47,703 192.168.x.xxx [MQTT] zigbee/recv b'{"cmd":"write","did":"lumi.0","id":3,"params":[{"res_name":"8.0.2155","value":"{\\"cloud_link\\":0,\\"tz_updated\\":\\"GMT8\\"}"}],"source":"","time":1659974267940}' 2022-08-08 23:57:47,718 192.168.x.xxx [MQTT] gw/2C1165FFFEE7A9D3/commands b'{"commands":[{"command":"lumi set-UTC-time 0x62f1a2fb","postDelayMs":0}]}' 2022-08-08 23:57:47,757 192.168.x.xxx [MQTT] zigbee/send b'{"cmd":"write_rsp","id":3,"time":1659974267955,"did":"lumi.0","zseq":0,"results":[{"res_name":"8.0.2155","value":"{\\"cloud_link\\":0,\\"tz_updated\\":\\"GMT8\\"}","error_code":0}]}' 2022-08-08 23:57:47,757 192.168.x.xxx [LUMI] 54ef443d756e (lumi.gateway.mgl03) recv {'cloud_link': False} 2022-08-08 23:58:00,763 192.168.x.xxx [MIOT] ccb5d1ae2dce (4924) send {'mi_spec': [{'siid': 2, 'piid': 1, 'value': False}]} 2022-08-08 23:58:02,499 192.168.x.xxx [MIOT] ccb5d1ae2dce (4924) send {'mi_spec': [{'siid': 2, 'piid': 1, 'value': True}]} 2022-08-08 23:58:08,820 192.168.x.xxx [MIOT] ccb5d1ae2dce (4924) send {'mi_spec': [{'siid': 2, 'piid': 2, 'value': 16}, {'siid': 2, 'piid': 1, 'value': True}]} 2022-08-08 23:58:09,850 192.168.x.xxx | No answer on set_properties [{'siid': 2, 'piid': 1, 'value': False, 'did': '1001062945'}] 2022-08-08 23:58:11,608 192.168.x.xxx | No answer on set_properties [{'siid': 2, 'piid': 1, 'value': True, 'did': '1001062945'}] 2022-08-08 23:58:12,344 192.168.x.xxx [MIOT] ccb5d1ae2dce (4924) send {'mi_spec': [{'siid': 2, 'piid': 2, 'value': 9}, {'siid': 2, 'piid': 1, 'value': True}]} 2022-08-08 23:58:17,878 192.168.x.xxx | No answer on set_properties [{'siid': 2, 'piid': 2, 'value': 16, 'did': '1001062945'}, {'siid': 2, 'piid': 1, 'value': True, 'did': '1001062945'}] 2022-08-08 23:58:21,428 192.168.x.xxx | No answer on set_properties [{'siid': 2, 'piid': 2, 'value': 9, 'did': '1001062945'}, {'siid': 2, 'piid': 1, 'value': True, 'did': '1001062945'}] 2022-08-08 23:58:22,619 192.168.x.xxx [MIOT] ccb5d1ae2dce (4924) send {'mi_spec': [{'siid': 2, 'piid': 2, 'value': 16}, {'siid': 2, 'piid': 1, 'value': True}]} 2022-08-08 23:58:23,882 192.168.x.xxx [MIOT] ccb5d1ae2dce (4924) send {'mi_spec': [{'siid': 2, 'piid': 2, 'value': 35}, {'siid': 2, 'piid': 1, 'value': True}]} 2022-08-08 23:58:27,983 192.168.x.xxx [MIOT] ccb5d1ae2dce (4924) send {'mi_spec': [{'siid': 2, 'piid': 2, 'value': 59}, {'siid': 2, 'piid': 1, 'value': True}]} 2022-08-08 23:58:31,633 192.168.x.xxx | No answer on set_properties [{'siid': 2, 'piid': 2, 'value': 16, 'did': '1001062945'}, {'siid': 2, 'piid': 1, 'value': True, 'did': '1001062945'}] 2022-08-08 23:58:32,952 192.168.x.xxx | No answer on set_properties [{'siid': 2, 'piid': 2, 'value': 35, 'did': '1001062945'}, {'siid': 2, 'piid': 1, 'value': True, 'did': '1001062945'}] 2022-08-08 23:58:37,128 192.168.x.xxx | No answer on set_properties [{'siid': 2, 'piid': 2, 'value': 59, 'did': '1001062945'}, {'siid': 2, 'piid': 1, 'value': True, 'did': '1001062945'}] 2022-08-08 23:58:42,909 192.168.x.xxx [MIOT] ccb5d1ae2dce (4924) send {'mi_spec': [{'siid': 2, 'piid': 2, 'value': 26}, {'siid': 2, 'piid': 1, 'value': True}]} 2022-08-08 23:58:44,904 192.168.x.xxx [MIOT] ccb5d1ae2dce (4924) send {'mi_spec': [{'siid': 2, 'piid': 2, 'value': 37}, {'siid': 2, 'piid': 1, 'value': True}]} 2022-08-08 23:58:48,025 192.168.x.xxx [MIOT] ccb5d1ae2dce (4924) send {'mi_spec': [{'siid': 2, 'piid': 2, 'value': 56}, {'siid': 2, 'piid': 1, 'value': True}]} 2022-08-08 23:58:50,197 192.168.x.xxx [MIOT] ccb5d1ae2dce (4924) send {'mi_spec': [{'siid': 2, 'piid': 2, 'value': 74}, {'siid': 2, 'piid': 1, 'value': True}]} 2022-08-08 23:58:51,939 192.168.x.xxx | No answer on set_properties [{'siid': 2, 'piid': 2, 'value': 26, 'did': '1001062945'}, {'siid': 2, 'piid': 1, 'value': True, 'did': '1001062945'}] 2022-08-08 23:58:54,030 192.168.x.xxx | No answer on set_properties [{'siid': 2, 'piid': 2, 'value': 37, 'did': '1001062945'}, {'siid': 2, 'piid': 1, 'value': True, 'did': '1001062945'}] 2022-08-08 23:58:55,433 192.168.x.xxx [MIOT] ccb5d1ae2dce (4924) send {'mi_spec': [{'siid': 2, 'piid': 2, 'value': 85}, {'siid': 2, 'piid': 1, 'value': True}]} 2022-08-08 23:58:57,328 192.168.x.xxx | No answer on set_properties [{'siid': 2, 'piid': 2, 'value': 56, 'did': '1001062945'}, {'siid': 2, 'piid': 1, 'value': True, 'did': '1001062945'}] 2022-08-08 23:58:57,584 192.168.x.xxx [MIOT] ccb5d1ae2dce (4924) send {'mi_spec': [{'siid': 2, 'piid': 3, 'value': 4694}, {'siid': 2, 'piid': 1, 'value': True}]} 2022-08-08 23:58:58,927 192.168.x.xxx [MIOT] ccb5d1ae2dce (4924) send {'mi_spec': [{'siid': 2, 'piid': 3, 'value': 5494}, {'siid': 2, 'piid': 1, 'value': True}]} 2022-08-08 23:58:59,234 192.168.x.xxx | No answer on set_properties [{'siid': 2, 'piid': 2, 'value': 74, 'did': '1001062945'}, {'siid': 2, 'piid': 1, 'value': True, 'did': '1001062945'}] 2022-08-08 23:59:03,558 192.168.x.xxx [MIOT] ccb5d1ae2dce (4924) send {'mi_spec': [{'siid': 2, 'piid': 3, 'value': 4545}, {'siid': 2, 'piid': 1, 'value': True}]} 2022-08-08 23:59:04,480 192.168.x.xxx | No answer on set_properties [{'siid': 2, 'piid': 2, 'value': 85, 'did': '1001062945'}, {'siid': 2, 'piid': 1, 'value': True, 'did': '1001062945'}] 2022-08-08 23:59:05,161 192.168.x.xxx [MIOT] ccb5d1ae2dce (4924) send {'mi_spec': [{'siid': 2, 'piid': 3, 'value': 3690}, {'siid': 2, 'piid': 1, 'value': True}]} 2022-08-08 23:59:06,678 192.168.x.xxx | No answer on set_properties [{'siid': 2, 'piid': 3, 'value': 4694, 'did': '1001062945'}, {'siid': 2, 'piid': 1, 'value': True, 'did': '1001062945'}] 2022-08-08 23:59:07,998 192.168.x.xxx | No answer on set_properties [{'siid': 2, 'piid': 3, 'value': 5494, 'did': '1001062945'}, {'siid': 2, 'piid': 1, 'value': True, 'did': '1001062945'}] 2022-08-08 23:59:08,869 192.168.x.xxx [MIOT] ccb5d1ae2dce (4924) send {'mi_spec': [{'siid': 2, 'piid': 3, 'value': 3095}, {'siid': 2, 'piid': 1, 'value': True}]} 2022-08-08 23:59:09,757 192.168.x.xxx [MIOT] ccb5d1ae2dce (4924) send {'mi_spec': [{'siid': 2, 'piid': 3, 'value': 2832}, {'siid': 2, 'piid': 1, 'value': True}]} 2022-08-08 23:59:12,655 192.168.x.xxx | No answer on set_properties [{'siid': 2, 'piid': 3, 'value': 4545, 'did': '1001062945'}, {'siid': 2, 'piid': 1, 'value': True, 'did': '1001062945'}] 2022-08-08 23:59:14,193 192.168.x.xxx | No answer on set_properties [{'siid': 2, 'piid': 3, 'value': 3690, 'did': '1001062945'}, {'siid': 2, 'piid': 1, 'value': True, 'did': '1001062945'}] 2022-08-08 23:59:17,881 192.168.x.xxx | No answer on set_properties [{'siid': 2, 'piid': 3, 'value': 3095, 'did': '1001062945'}, {'siid': 2, 'piid': 1, 'value': True, 'did': '1001062945'}] 2022-08-08 23:59:18,979 192.168.x.xxx | No answer on set_properties [{'siid': 2, 'piid': 3, 'value': 2832, 'did': '1001062945'}, {'siid': 2, 'piid': 1, 'value': True, 'did': '1001062945'}] 2022-08-08 23:59:45,393 192.168.x.xxx [MIOT] ccb5d1ae2dce (4924) send {'mi_spec': [{'siid': 2, 'piid': 1, 'value': False}]} 2022-08-08 23:59:48,110 192.168.x.xxx [MIOT] ccb5d1ae2dce (4924) send {'mi_spec': [{'siid': 2, 'piid': 1, 'value': True}]} 2022-08-08 23:59:53,146 192.168.x.xxx [MIOT] ccb5d1ae2dce (4924) send {'mi_spec': [{'siid': 2, 'piid': 2, 'value': 9}, {'siid': 2, 'piid': 1, 'value': True}]} 2022-08-08 23:59:54,558 192.168.x.xxx | **No answer on set_properties** [{'siid': 2, 'piid': 1, 'value': False, 'did': '1001062945'}] 2022-08-08 23:59:57,139 192.168.x.xxx | **No answer on set_properties** [{'siid': 2, 'piid': 1, 'value': True, 'did': '1001062945'}] 2022-08-08 23:59:58,977 192.168.x.xxx [MIOT] ccb5d1ae2dce (4924) send {'mi_spec': [{'siid': 2, 'piid': 2, 'value': 71}, {'siid': 2, 'piid': 1, 'value': True}]} 2022-08-09 00:00:02,197 192.168.x.xxx | No answer on set_properties [{'siid': 2, 'piid': 2, 'value': 9, 'did': '1001062945'}, {'siid': 2, 'piid': 1, 'value': True, 'did': '1001062945'}] 2022-08-09 00:00:02,947 192.168.x.xxx [MIOT] ccb5d1ae2dce (4924) send {'mi_spec': [{'siid': 2, 'piid': 3, 'value': 3194}, {'siid': 2, 'piid': 1, 'value': True}]} 2022-08-09 00:00:06,878 192.168.x.xxx [MIOT] ccb5d1ae2dce (4924) send {'mi_spec': [{'siid': 2, 'piid': 3, 'value': 5291}, {'siid': 2, 'piid': 1, 'value': True}]} 2022-08-09 00:00:08,159 192.168.x.xxx | No answer on set_properties [{'siid': 2, 'piid': 2, 'value': 71, 'did': '1001062945'}, {'siid': 2, 'piid': 1, 'value': True, 'did': '1001062945'}] 2022-08-09 00:00:12,043 192.168.x.xxx | No answer on set_properties [{'siid': 2, 'piid': 3, 'value': 3194, 'did': '1001062945'}, {'siid': 2, 'piid': 1, 'value': True, 'did': '1001062945'}] 2022-08-09 00:00:15,999 192.168.x.xxx | No answer on set_properties [{'siid': 2, 'piid': 3, 'value': 5291, 'did': '1001062945'}, {'siid': 2, 'piid': 1, 'value': True, 'did': '1001062945'}] 2022-08-09 00:00:30,060 192.168.x.xxx [MIOT] ccb5d1ae2dce (4924) send {'mi_spec': [{'siid': 2, 'piid': 1, 'value': False}]} 2022-08-09 00:00:39,228 192.168.x.xxx | No answer on set_properties [{'siid': 2, 'piid': 1, 'value': False, 'did': '1001062945'}] - 
I found many warnnings:No answer on set_properties . this is diffrent from the log content before I changged the file devices.py
 - 
I don’t kown how to fix it, please help me. Thank you very much!
 
I don't know. You have done everything right. Try to reboot the gateway.
I don't know. You have done everything right. Try to reboot the gateway.
Thank you.I've rebooted for many times.But the problem still exists.
Maybe you using custom gateway firmware with wrong token?
Looks like we had the same problem. Did you solve it?