AlexxIT / XiaomiGateway3

Home Assistant custom component for control Xiaomi Multimode Gateway (aka Gateway 3), Xiaomi Multimode Gateway 2, Aqara Hub E1 on default firmwares over LAN
https://github.com/AlexxIT/Blog
MIT License
2.42k stars 340 forks source link

Doesn't work with Home Assistant Core 2022.3.3 #694

Closed goxofy closed 2 years ago

goxofy commented 2 years ago

When updated to HA Core 2022.3.3, all sub devices(BLE) is unavaliable.

Mandalavandalz commented 2 years ago

Same here!

ImintA2 commented 2 years ago

My zigbee buttons (Xiaomi Button (WXKG01LM)) stop working too, and now when I try to access Xiaomi Gateway's select menu in device it'll show these errors:

2022-03-08 23:30:20 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140453662684880] argument of type 'NoneType' is not iterable
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 192, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 1636, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1673, in _execute_service
await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service
await self.hass.helpers.service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 668, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 949, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 705, in _handle_entity_call
await result
File "/usr/src/homeassistant/homeassistant/components/select/__init__.py", line 52, in async_select_option
if option not in entity.options:
TypeError: argument of type 'NoneType' is not iterable
2022-03-08 23:30:26 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140453662684880] 'CommandSelect' object has no attribute '_added'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 192, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 1636, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1673, in _execute_service
await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service
await self.hass.helpers.service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 668, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 949, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 705, in _handle_entity_call
await result
File "/usr/src/homeassistant/homeassistant/components/select/__init__.py", line 54, in async_select_option
await entity.async_select_option(option)
File "/config/custom_components/xiaomi_gateway3/select.py", line 90, in async_select_option
self.device.update({"data": command})
File "/config/custom_components/xiaomi_gateway3/core/device.py", line 397, in update
entity.async_set_state(value)
File "/config/custom_components/xiaomi_gateway3/select.py", line 157, in async_set_state
self.process_command(data)
File "/config/custom_components/xiaomi_gateway3/select.py", line 149, in process_command
self.device.update({"command": None})
File "/config/custom_components/xiaomi_gateway3/core/device.py", line 399, in update
if entity._added:
AttributeError: 'CommandSelect' object has no attribute '_added'

Do these happen to you guys too?

erikodink commented 2 years ago

same error...

ghighiu commented 2 years ago

same here

grouts112 commented 2 years ago

and me.. backed out to 2022.3.2 and working again

Nebur692 commented 2 years ago

Same error, any subdevice.

Kirmas commented 2 years ago

You can manually make changes from https://github.com/AlexxIT/XiaomiGateway3/pull/695 and that should help

csszokolai commented 2 years ago

You can manually make changes from #695 and that should help

it works for me, thank you!

peetereczek commented 2 years ago

Helped, but did not resolved. All Zigbee devices needed to be triggered to be recognized by integration

My gateway log

2022-03-08 20:19:48  DEBUG    main          SysInfo: {'installation_type': 'Home Assistant OS', 'version': '2022.3.3', 'dev': False, 'hassio': True, 'virtualenv': False, 'python_version': '3.9.9', 'docker': True, 'arch': 'armv7l', 'timezone': 'Europe/Warsaw', 'os_name': 'Linux', 'os_version': '5.10.92-v7l', 'user': 'root', 'supervisor': '2022.01.1', 'host_os': 'Home Assistant OS 7.4', 'docker_version': '20.10.9', 'chassis': 'embedded'}
2022-03-08 20:19:50  DEBUG    main          Loaded from MiCloud 11 devices
2022-03-08 20:20:22  DEBUG    base          192.168.50.89 [MQTT] gw/588E81FFFEF9CCE4/heartbeat b'{"networkUp":true,"networkPanId":"0x5B22","radioTxPower":7,"radioChannel":15}'
2022-03-08 20:20:24  DEBUG    base          192.168.50.89 [MQTT] log/miio b'\x1b[0;32m2022:03:09:03:20:23.436 [D] miio_client_func: ot_agent_recv_handler_one(): fd:9, msg:{"method":"event.gw.heartbeat","params":[{"free_mem":4000,"ip":"192.168.50.89","load_avg":"2.31|2.23|1.55|2\\/90|15660","rssi":48,"run_time":1143,"setupcode":"842-62-159","ssid":"SkipperNet","tz":"GMT1"}],"id":224} length:213 bytes\x1b[0m'
2022-03-08 20:20:29  DEBUG    base          192.168.50.89 [MQTT] gw/588E81FFFEF9CCE4/commands b'{"commands":[{"commandcli":"debugprint all_on"},{"commandcli":"plugin device-table print"},{"commandcli":"plugin stack-diagnostics child-table"},{"commandcli":"plugin stack-diagnostics neighbor-table"},{"commandcli":"plugin concentrator print-table"},{"commandcli":"debugprint all_off"}]}'
2022-03-08 20:20:29  DEBUG    base          192.168.50.89 [MQTT] gw/588E81FFFEF9CCE4/executed b'{"command":"debugprint all_on"}'
2022-03-08 20:20:29  DEBUG    base          192.168.50.89 [MQTT] log/z3 b''
2022-03-08 20:20:29  DEBUG    base          192.168.50.89 [MQTT] gw/588E81FFFEF9CCE4/executed b'{"command":"plugin device-table print"}'
2022-03-08 20:20:29  DEBUG    base          192.168.50.89 [MQTT] log/z3 b'=============================='
2022-03-08 20:20:29  DEBUG    base          192.168.50.89 [MQTT] log/z3 b'Current Working Directory: /'
2022-03-08 20:20:29  DEBUG    base          192.168.50.89 [MQTT] log/z3 b''
2022-03-08 20:20:29  DEBUG    base          192.168.50.89 [MQTT] log/z3 b'=============================='
2022-03-08 20:20:29  DEBUG    base          192.168.50.89 [MQTT] log/z3 b'Found 0 files'
2022-03-08 20:20:29  DEBUG    base          192.168.50.89 [MQTT] log/z3 b''
2022-03-08 20:20:29  DEBUG    base          192.168.50.89 [MQTT] log/z3 b'CLI command executed: debugprint all_on\r'
2022-03-08 20:20:29  DEBUG    base          192.168.50.89 [MQTT] log/z3 b'0 E2A3:  00158D0005890DBF 0  JOINED 609\r'
2022-03-08 20:20:29  DEBUG    base          192.168.50.89 [MQTT] log/z3 b'1 AB59:  00158D00062F8D04 0  JOINED 609\r'
2022-03-08 20:20:29  DEBUG    base          192.168.50.89 [MQTT] log/z3 b'2 A3E2:  00158D000580336B 0  JOINED 609\r'
2022-03-08 20:20:29  DEBUG    base          192.168.50.89 [MQTT] log/z3 b'3 BC8D:  00158D00070B060E 0  JOINED 609\r'
2022-03-08 20:20:29  DEBUG    base          192.168.50.89 [MQTT] log/z3 b'4 2AF9:  00158D00070B0D48 0  JOINED 609\r'
2022-03-08 20:20:29  DEBUG    base          192.168.50.89 [MQTT] log/z3 b'5 B635:  00158D00071172C2 0  JOINED 609\r'
2022-03-08 20:20:29  DEBUG    base          192.168.50.89 [MQTT] log/z3 b'6 2C5F:  00158D0006F0B4E6 0  JOINED 607\r'
2022-03-08 20:20:29  DEBUG    base          192.168.50.89 [MQTT] log/z3 b'Total Devices 7\r'
2022-03-08 20:20:29  DEBUG    base          192.168.50.89 [MQTT] log/z3 b'CLI command executed: plugin device-table print\r'
2022-03-08 20:20:29  DEBUG    base          192.168.50.89 [MQTT] log/z3 b'\r'
2022-03-08 20:20:29  DEBUG    base          192.168.50.89 [MQTT] log/z3 b'#  type    id     eui64               timeout\r'
2022-03-08 20:20:29  DEBUG    base          192.168.50.89 [MQTT] log/z3 b'0: Sleepy  0xE2A3 (>)00158D0005890DBF 512 min     debug timeout:9\r'
2022-03-08 20:20:29  DEBUG    base          192.168.50.89 [MQTT] log/z3 b'1: Sleepy  0xAB59 (>)00158D00062F8D04 512 min     debug timeout:9\r'
2022-03-08 20:20:29  DEBUG    base          192.168.50.89 [MQTT] log/z3 b'2: Sleepy  0xA3E2 (>)00158D000580336B 512 min     debug timeout:9\r'
2022-03-08 20:20:29  DEBUG    base          192.168.50.89 [MQTT] log/z3 b'3: Sleepy  0xBC8D (>)00158D00070B060E 512 min     debug timeout:9\r'
2022-03-08 20:20:29  DEBUG    base          192.168.50.89 [MQTT] log/z3 b'4: Sleepy  0x2AF9 (>)00158D00070B0D48 512 min     debug timeout:9\r'
2022-03-08 20:20:29  DEBUG    base          192.168.50.89 [MQTT] log/z3 b'5: Sleepy  0xB635 (>)00158D00071172C2 512 min     debug timeout:9\r'
2022-03-08 20:20:29  DEBUG    base          192.168.50.89 [MQTT] log/z3 b'6: Sleepy  0x2C5F (>)00158D0006F0B4E6 512 min     debug timeout:249\r'
2022-03-08 20:20:29  DEBUG    base          192.168.50.89 [MQTT] log/z3 b''
2022-03-08 20:20:29  DEBUG    base          192.168.50.89 [MQTT] log/z3 b'7 of 32 entries used.\r'
2022-03-08 20:20:29  DEBUG    base          192.168.50.89 [MQTT] log/z3 b'CLI command executed: plugin stack-diagnostics child-table\r'
2022-03-08 20:20:29  DEBUG    base          192.168.50.89 [MQTT] log/z3 b''
2022-03-08 20:20:29  DEBUG    base          192.168.50.89 [MQTT] log/z3 b'#  id     lqi  in  out  age  eui\r'
2022-03-08 20:20:29  DEBUG    base          192.168.50.89 [MQTT] gw/588E81FFFEF9CCE4/executed b'{"command":"plugin stack-diagnostics child-table"}'
2022-03-08 20:20:29  DEBUG    base          192.168.50.89 [MQTT] log/z3 b''
2022-03-08 20:20:29  DEBUG    base          192.168.50.89 [MQTT] log/z3 b'0 of 26 entries used.\r'
2022-03-08 20:20:29  DEBUG    base          192.168.50.89 [MQTT] gw/588E81FFFEF9CCE4/executed b'{"command":"plugin stack-diagnostics neighbor-table"}'
2022-03-08 20:20:29  DEBUG    base          192.168.50.89 [MQTT] log/z3 b'CLI command executed: plugin stack-diagnostics neighbor-table\r'
2022-03-08 20:20:29  DEBUG    base          192.168.50.89 [MQTT] log/z3 b'0 of 255 total entries.\r'
2022-03-08 20:20:29  DEBUG    base          192.168.50.89 [MQTT] gw/588E81FFFEF9CCE4/executed b'{"command":"plugin concentrator print-table"}'
2022-03-08 20:20:29  DEBUG    base          192.168.50.89 [MQTT] log/z3 b'CLI command executed: plugin concentrator print-table\r'
2022-03-08 20:20:29  DEBUG    base          192.168.50.89 [MQTT] gw/588E81FFFEF9CCE4/executed b'{"command":"debugprint all_off"}'
2022-03-08 20:20:47  DEBUG    base          192.168.50.89 [MQTT] log/ble b'{"did":"blt.3.15chf3d5klk00","eid":4102,"edata":"4c01","pdid":426,"seq":198}'
2022-03-08 20:20:51  DEBUG    base          192.168.50.89 [MQTT] log/miio b'\x1b[0;32m2022:03:09:03:20:41.814 [D] miio_client_func: ot_agent_recv_handler_one(): fd:9, msg:{"method":"_async.ble_event","params":{"dev":{"did":"blt.3.15chf3d5klk00","mac":"58:2D:34:38:8E:86","pdid":426},"evt":[{"eid":4102,"edata":"4c01"}],"frmCnt":198,"gwts":1646767240},"id":228} length:189 bytes\x1b[0m'
2022-03-08 20:20:51  DEBUG    base          192.168.50.89 [MQTT] log/ble b'{"did":"blt.3.15chf3d5klk00","eid":4109,"edata":"da004a01","pdid":426,"seq":199}'
2022-03-08 20:21:20  DEBUG    base          192.168.50.89 [MQTT] gw/588E81FFFEF9CCE4/heartbeat b'{"networkUp":true,"networkPanId":"0x5B22","radioTxPower":7,"radioChannel":15}'
2022-03-08 20:21:23  DEBUG    base          192.168.50.89 [MQTT] log/ble b'{"did":"blt.3.15chc397kek00","eid":4102,"edata":"7201","pdid":1371,"seq":82}'
2022-03-08 20:21:24  DEBUG    base          192.168.50.89 [MQTT] log/miio b'\x1b[0;32m2022:03:09:03:21:23.634 [D] miio_client_func: ot_agent_recv_handler_one(): fd:9, msg:{"method":"_async.ble_event","params":{"dev":{"did":"blt.3.15chc397kek00","mac":"A4:C1:38:47:06:3C","pdid":1371},"evt":[{"eid":4102,"edata":"7201"}],"frmCnt":82,"gwts":1646767282},"id":235} length:189 bytes\x1b[0m'
2022-03-08 20:22:14  DEBUG    base          192.168.50.89 [MQTT] gw/588E81FFFEF9CCE4/MessageReceived b'{"sourceAddress":"0xE2A3","eui64":"0x00158D0005890DBF","destinationEndpoint":"0x01","clusterId":"0x0406","profileId":"0x0104","sourceEndpoint":"0x01","APSCounter":"0x94","APSPlayload":"0x18B70A00001801","rssi":-50,"linkQuality":200}'
2022-03-08 20:22:14  DEBUG    base          192.168.50.89 [ZIGB] 0x00158d0005890dbf (0xe2a3) recv {'endpoint': 1, 'seq': 183, 'cluster': 'occupancy', 'command': 'Command.Report_Attributes', 'occupancy': 1}
2022-03-08 20:22:14  DEBUG    base          192.168.50.89 [MQTT] zigbee/send b'{"cmd":"report","id":2000000017,"did":"lumi.158d0005890dbf","time":1646767333364,"rssi":-50,"zseq":183,"params":[{"res_name":"3.1.85","value":1}],"dev_src":"0"}'
2022-03-08 20:22:20  DEBUG    base          192.168.50.89 [MQTT] gw/588E81FFFEF9CCE4/heartbeat b'{"networkUp":true,"networkPanId":"0x5B22","radioTxPower":7,"radioChannel":15}'
2022-03-08 20:22:24  DEBUG    base          192.168.50.89 [MQTT] log/ble b'{"did":"blt.3.15chc397kek00","eid":4100,"edata":"d800","pdid":1371,"seq":84}'
2022-03-08 20:22:25  DEBUG    base          192.168.50.89 [MQTT] log/miio b'\x1b[0;32m2022:03:09:03:22:23.324 [D] miio_client_func: ot_agent_recv_handler_one(): fd:9, msg:{"method":"_async.ble_event","params":{"dev":{"did":"blt.3.15chc397kek00","mac":"A4:C1:38:47:06:3C","pdid":1371},"evt":[{"eid":4100,"edata":"d800"}],"frmCnt":84,"gwts":1646767343},"id":248} length:189 bytes\x1b[0m'
2022-03-08 20:23:04  DEBUG    base          192.168.50.89 [MQTT] log/ble b'{"did":"blt.3.15chf3d5klk00","eid":4109,"edata":"db004a01","pdid":426,"seq":12}'
2022-03-08 20:23:20  DEBUG    base          192.168.50.89 [MQTT] gw/588E81FFFEF9CCE4/heartbeat b'{"networkUp":true,"networkPanId":"0x5B22","radioTxPower":7,"radioChannel":15}'
2022-03-08 20:23:42  DEBUG    base          192.168.50.89 [MQTT] gw/588E81FFFEF9CCE4/MessageReceived b'{"sourceAddress":"0xE2A3","eui64":"0x00158D0005890DBF","destinationEndpoint":"0x01","clusterId":"0x0406","profileId":"0x0104","sourceEndpoint":"0x01","APSCounter":"0x95","APSPlayload":"0x18B80A00001801","rssi":-51,"linkQuality":196}'
2022-03-08 20:23:42  DEBUG    base          192.168.50.89 [ZIGB] 0x00158d0005890dbf (0xe2a3) recv {'endpoint': 1, 'seq': 184, 'cluster': 'occupancy', 'command': 'Command.Report_Attributes', 'occupancy': 1}
2022-03-08 20:23:43  DEBUG    base          192.168.50.89 [MQTT] zigbee/send b'{"cmd":"report","id":2000000018,"did":"lumi.158d0005890dbf","time":1646767421774,"rssi":-51,"zseq":184,"params":[{"res_name":"3.1.85","value":1}],"dev_src":"0"}'
2022-03-08 20:23:50  DEBUG    base          192.168.50.89 [MQTT] log/ble b'{"did":"blt.3.15jhfp4as5o00","eid":4109,"edata":"33009e02","pdid":426,"seq":166}'
2022-03-08 20:23:50  DEBUG    base          192.168.50.89 [MQTT] log/miio b'\x1b[0;32m2022:03:09:03:23:49.494 [D] miio_client_func: ot_agent_recv_handler_one(): fd:9, msg:{"method":"_async.ble_event","params":{"dev":{"did":"blt.3.15jhfp4as5o00","mac":"58:2D:34:38:8D:0F","pdid":426},"evt":[{"eid":4109,"edata":"33009e02"}],"frmCnt":166,"gwts":1646767428},"id":265} length:193 bytes\x1b[0m'
2022-03-08 20:23:50  DEBUG    base          192.168.50.89 [MQTT] gw/588E81FFFEF9CCE4/MessageReceived b'{"sourceAddress":"0xAB59","eui64":"0x00158D00062F8D04","destinationEndpoint":"0x01","clusterId":"0x0406","profileId":"0x0104","sourceEndpoint":"0x01","APSCounter":"0x3D","APSPlayload":"0x180B0A00001801","rssi":-36,"linkQuality":255}'
2022-03-08 20:23:50  DEBUG    base          192.168.50.89 [ZIGB] 0x00158d00062f8d04 (0xab59) recv {'endpoint': 1, 'seq': 11, 'cluster': 'occupancy', 'command': 'Command.Report_Attributes', 'occupancy': 1}
2022-03-08 20:23:50  DEBUG    base          192.168.50.89 [MQTT] zigbee/send b'{"cmd":"report","id":2000000019,"did":"lumi.158d00062f8d04","time":1646767429524,"rssi":-36,"zseq":11,"params":[{"res_name":"3.1.85","value":1}],"dev_src":"0"}'
2022-03-08 20:23:52  DEBUG    base          192.168.50.89 [MQTT] gw/588E81FFFEF9CCE4/MessageReceived b'{"sourceAddress":"0x2C5F","eui64":"0x00158D0006F0B4E6","destinationEndpoint":"0x01","clusterId":"0x0400","profileId":"0x0104","sourceEndpoint":"0x01","APSCounter":"0x2B","APSPlayload":"0x18DE0A0000210600","rssi":-56,"linkQuality":176}'
2022-03-08 20:23:52  DEBUG    base          192.168.50.89 [ZIGB] 0x00158d0006f0b4e6 (0x2c5f) recv {'endpoint': 1, 'seq': 222, 'cluster': 'illuminance', 'command': 'Command.Report_Attributes', 'measured_value': 6}
2022-03-08 20:23:52  DEBUG    base          192.168.50.89 [MQTT] gw/588E81FFFEF9CCE4/MessageReceived b'{"sourceAddress":"0x2C5F","eui64":"0x00158D0006F0B4E6","destinationEndpoint":"0x01","clusterId":"0x0406","profileId":"0x0104","sourceEndpoint":"0x01","APSCounter":"0x2C","APSPlayload":"0x18DF0A00001801","rssi":-55,"linkQuality":180}'
2022-03-08 20:23:52  DEBUG    base          192.168.50.89 [ZIGB] 0x00158d0006f0b4e6 (0x2c5f) recv {'endpoint': 1, 'seq': 223, 'cluster': 'occupancy', 'command': 'Command.Report_Attributes', 'occupancy': 1}
2022-03-08 20:23:52  DEBUG    base          192.168.50.89 [MQTT] zigbee/send b'{"cmd":"report","id":2000000020,"did":"lumi.158d0006f0b4e6","time":1646767431344,"rssi":-56,"zseq":222,"params":[{"res_name":"0.3.85","value":6},{"res_name":"0.4.85","value":6},{"res_name":"3.1.85","value":1}],"dev_src":"0"}'
2022-03-08 20:24:00  DEBUG    base          192.168.50.89 [MQTT] log/ble b'{"did":"blt.3.15jhfp4as5o00","eid":4109,"edata":"31009e02","pdid":426,"seq":171}'
2022-03-08 20:24:07  DEBUG    base          192.168.50.89 [MQTT] gw/588E81FFFEF9CCE4/MessageReceived b'{"sourceAddress":"0xA3E2","eui64":"0x00158D000580336B","destinationEndpoint":"0x01","clusterId":"0x0006","profileId":"0x0104","sourceEndpoint":"0x01","APSCounter":"0xF8","APSPlayload":"0x18CE0A00001001","rssi":-47,"linkQuality":212}'
2022-03-08 20:24:07  DEBUG    base          192.168.50.89 [ZIGB] 0x00158d000580336b (0xa3e2) recv {'endpoint': 1, 'seq': 206, 'cluster': 'on_off', 'command': 'Command.Report_Attributes', 'on_off': 1}
2022-03-08 20:24:07  DEBUG    base          192.168.50.89 [MQTT] zigbee/send b'{"cmd":"report","id":2000000021,"did":"lumi.158d000580336b","time":1646767446664,"rssi":-47,"zseq":206,"params":[{"res_name":"3.1.85","value":1}],"dev_src":"0"}'
2022-03-08 20:24:09  DEBUG    base          192.168.50.89 [MQTT] gw/588E81FFFEF9CCE4/MessageReceived b'{"sourceAddress":"0xA3E2","eui64":"0x00158D000580336B","destinationEndpoint":"0x01","clusterId":"0x0006","profileId":"0x0104","sourceEndpoint":"0x01","APSCounter":"0xF9","APSPlayload":"0x18CF0A00001000","rssi":-46,"linkQuality":216}'
2022-03-08 20:24:09  DEBUG    base          192.168.50.89 [ZIGB] 0x00158d000580336b (0xa3e2) recv {'endpoint': 1, 'seq': 207, 'cluster': 'on_off', 'command': 'Command.Report_Attributes', 'on_off': 0}
2022-03-08 20:24:09  DEBUG    base          192.168.50.89 [MQTT] zigbee/send b'{"cmd":"report","id":2000000022,"did":"lumi.158d000580336b","time":1646767448064,"rssi":-46,"zseq":207,"params":[{"res_name":"3.1.85","value":0}],"dev_src":"0"}'
2022-03-08 20:24:16  DEBUG    base          192.168.50.89 [MQTT] gw/588E81FFFEF9CCE4/MessageReceived b'{"sourceAddress":"0x2AF9","eui64":"0x00158D00070B0D48","destinationEndpoint":"0x01","clusterId":"0x0006","profileId":"0x0104","sourceEndpoint":"0x01","APSCounter":"0xB8","APSPlayload":"0x18710A00001001","rssi":-41,"linkQuality":236}'
2022-03-08 20:24:16  DEBUG    base          192.168.50.89 [ZIGB] 0x00158d00070b0d48 (0x2af9) recv {'endpoint': 1, 'seq': 113, 'cluster': 'on_off', 'command': 'Command.Report_Attributes', 'on_off': 1}
2022-03-08 20:24:16  DEBUG    base          192.168.50.89 [MQTT] zigbee/send b'{"cmd":"report","id":2000000023,"did":"lumi.158d00070b0d48","time":1646767455644,"rssi":-41,"zseq":113,"params":[{"res_name":"3.1.85","value":1}],"dev_src":"0"}'
2022-03-08 20:24:17  DEBUG    base          192.168.50.89 [MQTT] gw/588E81FFFEF9CCE4/MessageReceived b'{"sourceAddress":"0x2AF9","eui64":"0x00158D00070B0D48","destinationEndpoint":"0x01","clusterId":"0x0006","profileId":"0x0104","sourceEndpoint":"0x01","APSCounter":"0xB9","APSPlayload":"0x18720A00001000","rssi":-40,"linkQuality":240}'
2022-03-08 20:24:17  DEBUG    base          192.168.50.89 [ZIGB] 0x00158d00070b0d48 (0x2af9) recv {'endpoint': 1, 'seq': 114, 'cluster': 'on_off', 'command': 'Command.Report_Attributes', 'on_off': 0}
2022-03-08 20:24:17  DEBUG    base          192.168.50.89 [MQTT] zigbee/send b'{"cmd":"report","id":2000000024,"did":"lumi.158d00070b0d48","time":1646767456564,"rssi":-40,"zseq":114,"params":[{"res_name":"3.1.85","value":0}],"dev_src":"0"}'
2022-03-08 20:24:20  DEBUG    base          192.168.50.89 [MQTT] gw/588E81FFFEF9CCE4/heartbeat b'{"networkUp":true,"networkPanId":"0x5B22","radioTxPower":7,"radioChannel":15}'
2022-03-08 20:24:27  DEBUG    base          192.168.50.89 [MQTT] gw/588E81FFFEF9CCE4/MessageReceived b'{"sourceAddress":"0xB635","eui64":"0x00158D00071172C2","destinationEndpoint":"0x01","clusterId":"0x0006","profileId":"0x0104","sourceEndpoint":"0x01","APSCounter":"0x02","APSPlayload":"0x182D0A00001001","rssi":-44,"linkQuality":224}'
2022-03-08 20:24:27  DEBUG    base          192.168.50.89 [ZIGB] 0x00158d00071172c2 (0xb635) recv {'endpoint': 1, 'seq': 45, 'cluster': 'on_off', 'command': 'Command.Report_Attributes', 'on_off': 1}
2022-03-08 20:24:27  DEBUG    base          192.168.50.89 [MQTT] zigbee/send b'{"cmd":"report","id":2000000025,"did":"lumi.158d00071172c2","time":1646767465994,"rssi":-44,"zseq":45,"params":[{"res_name":"3.1.85","value":1}],"dev_src":"0"}'
2022-03-08 20:24:27  DEBUG    base          192.168.50.89 [MQTT] gw/588E81FFFEF9CCE4/MessageReceived b'{"sourceAddress":"0xB635","eui64":"0x00158D00071172C2","destinationEndpoint":"0x01","clusterId":"0x0006","profileId":"0x0104","sourceEndpoint":"0x01","APSCounter":"0x03","APSPlayload":"0x182E0A00001000","rssi":-43,"linkQuality":228}'
2022-03-08 20:24:27  DEBUG    base          192.168.50.89 [ZIGB] 0x00158d00071172c2 (0xb635) recv {'endpoint': 1, 'seq': 46, 'cluster': 'on_off', 'command': 'Command.Report_Attributes', 'on_off': 0}
2022-03-08 20:24:27  DEBUG    base          192.168.50.89 [MQTT] zigbee/send b'{"cmd":"report","id":2000000026,"did":"lumi.158d00071172c2","time":1646767466754,"rssi":-43,"zseq":46,"params":[{"res_name":"3.1.85","value":0}],"dev_src":"0"}'
2022-03-08 20:24:34  DEBUG    base          192.168.50.89 [MQTT] log/ble b'{"did":"blt.3.15chf3d5klk00","eid":4109,"edata":"db004a01","pdid":426,"seq":54}'
2022-03-08 20:24:36  DEBUG    base          192.168.50.89 [MQTT] gw/588E81FFFEF9CCE4/MessageReceived b'{"sourceAddress":"0xBC8D","eui64":"0x00158D00070B060E","destinationEndpoint":"0x01","clusterId":"0x0006","profileId":"0x0104","sourceEndpoint":"0x01","APSCounter":"0x02","APSPlayload":"0x18590A00001001","rssi":-67,"linkQuality":132}'
2022-03-08 20:24:36  DEBUG    base          192.168.50.89 [ZIGB] 0x00158d00070b060e (0xbc8d) recv {'endpoint': 1, 'seq': 89, 'cluster': 'on_off', 'command': 'Command.Report_Attributes', 'on_off': 1}
2022-03-08 20:24:36  DEBUG    base          192.168.50.89 [MQTT] zigbee/send b'{"cmd":"report","id":2000000027,"did":"lumi.158d00070b060e","time":1646767475704,"rssi":-67,"zseq":89,"params":[{"res_name":"3.1.85","value":1}],"dev_src":"0"}'
2022-03-08 20:24:37  DEBUG    base          192.168.50.89 [MQTT] gw/588E81FFFEF9CCE4/MessageReceived b'{"sourceAddress":"0xBC8D","eui64":"0x00158D00070B060E","destinationEndpoint":"0x01","clusterId":"0x0006","profileId":"0x0104","sourceEndpoint":"0x01","APSCounter":"0x03","APSPlayload":"0x185A0A00001000","rssi":-67,"linkQuality":132}'
2022-03-08 20:24:37  DEBUG    base          192.168.50.89 [ZIGB] 0x00158d00070b060e (0xbc8d) recv {'endpoint': 1, 'seq': 90, 'cluster': 'on_off', 'command': 'Command.Report_Attributes', 'on_off': 0}
2022-03-08 20:24:37  DEBUG    base          192.168.50.89 [MQTT] zigbee/send b'{"cmd":"report","id":2000000028,"did":"lumi.158d00070b060e","time":1646767476464,"rssi":-67,"zseq":90,"params":[{"res_name":"3.1.85","value":0}],"dev_src":"0"}'
2022-03-08 20:24:42  DEBUG    base          192.168.50.89 [MQTT] log/ble b'{"did":"blt.3.15chf3d5klk00","eid":4109,"edata":"db004a01","pdid":426,"seq":58}'
2022-03-08 20:25:14  DEBUG    base          192.168.50.89 [MQTT] log/ble b'{"did":"blt.3.15jhfp4as5o00","eid":4109,"edata":"32009c02","pdid":426,"seq":208}'
2022-03-08 20:25:20  DEBUG    base          192.168.50.89 [MQTT] gw/588E81FFFEF9CCE4/heartbeat b'{"networkUp":true,"networkPanId":"0x5B22","radioTxPower":7,"radioChannel":15}'
2022-03-08 20:25:23  DEBUG    base          192.168.50.89 [MQTT] log/miio b'\x1b[0;32m2022:03:09:03:25:21.436 [D] miio_client_func: ot_agent_recv_handler_one(): fd:9, msg:{"method":"event.gw.heartbeat","params":[{"free_mem":4016,"ip":"192.168.50.89","load_avg":"2.40|2.35|1.80|3\\/90|19354","rssi":48,"run_time":1443,"setupcode":"842-62-159","ssid":"SkipperNet","tz":"GMT1"}],"id":327} length:213 bytes\x1b[0m'
2022-03-08 20:26:20  DEBUG    base          192.168.50.89 [MQTT] gw/588E81FFFEF9CCE4/heartbeat b'{"networkUp":true,"networkPanId":"0x5B22","radioTxPower":7,"radioChannel":15}'
rzv-trsc commented 2 years ago

Also BLE unavailable. Also ZNCZ04LM (lumi.plug.mmeu01) unavailable after updating to 2022.3.3

jeremysherriff commented 2 years ago

yeah some BLE devices still unavailable, it's fixed enough that I won't roll back to 2022.3.2 but it's definitely still a problem even with this commit merged in manually.

Stooovie commented 2 years ago

Same. Yeelight M2 BT Mesh bulbs all unavailable.

Kirmas commented 2 years ago

I don't have a BLE device, only ZigBee and I can't debug what's wrong. If anyone else wants to look at it, then only https://github.com/home-assistant/core/pull/67750/files changes something globally between 2022.3.2 and 2022.3.3.

jeremysherriff commented 2 years ago

I thought it would be the bump to python-miio 0.5.11 (link). Is there something that makes you think the issue is with this other PR? Or did you mean the 2022.3.3 release in general?

Edit; as mentioned over on your PR, enabling debug has revealed absolutely nothing so I have no idea how to proceed with debugging further. Needs someone with a dev setup I would suggest.

batcatsaga commented 2 years ago

You can manually make changes from #695 and that should help

Works for buttons and cube. But no more battery info.

jeremysherriff commented 2 years ago

@batcatsaga are your buttons and cube using BLE or zigbee? I know the cube is available in both models, not sure about the buttons.

Kirmas commented 2 years ago

I thought it would be the bump to python-miio 0.5.11 (link). Is there something that makes you think the issue is with this other PR? Or did you mean the 2022.3.3 release in general?

As i know @AlexxIT don't use python-miio in this integration at all. Looks to requirements (I mean in general all other PR in release related with integrations)

Edit; as mentioned over on your PR, enabling debug has revealed absolutely nothing so I have no idea how to proceed with debugging further. Needs someone with a dev setup I would suggest.

I've been adding logs to find what's wrong with the Zigbee part in places that seem to be related.

Stooovie commented 2 years ago

I can confirm that the manual PR does fix the Yeelight M2 BT Mesh bulbs. The BT Diagnostic entity of them is Unavailable but I don't recall if they worked before this bug. The bulbs work in every case though.

matteos1 commented 2 years ago

same issue here. is it possible an update on HACS?

batcatsaga commented 2 years ago

@batcatsaga are your buttons and cube using BLE or zigbee? I know the cube is available in both models, not sure about the buttons.

I don't know. How do i check that? But i believe they're all zigbee.

marcomilani commented 2 years ago

Same here. Neither zigbee nor ble

niceboygithub commented 2 years ago

fix core/device.py

add

from homeassistant.helpers.entity import EntityPlatformState

change line 399 and 406.

if entity._platform_state is EntityPlatformState.ADDED:
chenquanhao commented 2 years ago

Same here!

olujicz commented 2 years ago

@niceboygithub Yes I can confirm that fix. It is working when I import EntityPlatformState and change lines 399 and 406.

Sam2567 commented 2 years ago

fix core/device.py

add

from homeassistant.helpers.entity import EntityPlatformState

change line 399 and 406.

if entity._platform_state is EntityPlatformState.ADDED:

This should work. I was about to launch a pull request then realized this gentleman found a solution 4 hours ahead of me......

rzv-trsc commented 2 years ago

can also confirm that this fixes the issue:

niceboygithub commented 2 years ago

fix core/device.py add

from homeassistant.helpers.entity import EntityPlatformState

change line 399 and 406.

if entity._platform_state is EntityPlatformState.ADDED:

This should work. I was about to launch a pull request then realized this gentleman found a solution 4 hours ahead of me......

XD, actually I fixed it yesterday and already told AlexxIT. But he is busy and no time to fix it.

jeremysherriff commented 2 years ago

@batcatsaga are your buttons and cube using BLE or zigbee? I know the cube is available in both models, not sure about the buttons.

I don't know. How do i check that? But i believe they're all zigbee.

@batcatsaga the easiest way to confirm is via the Mi Home app. Go to your Gateway device, scroll down, and check whether your devices with problems are listed in the Zigbee Child Devices section, or in the Bluetooth Child Devices section.

Please also confirm 100% that you have integrated the files/changes from PR #695 and are still having these problems.

batcatsaga commented 2 years ago

@batcatsaga are your buttons and cube using BLE or zigbee? I know the cube is available in both models, not sure about the buttons.

I don't know. How do i check that? But i believe they're all zigbee.

@batcatsaga the easiest way to confirm is via the Mi Home app. Go to your Gateway device, scroll down, and check whether your devices with problems are listed in the Zigbee Child Devices section, or in the Bluetooth Child Devices section.

Please also confirm 100% that you have integrated the files/changes from PR #695 and are still having these problems.

Yep, all zigbee. And battery states are back. So all is working well again.

dblueone commented 2 years ago

Fix was a no go for me, still having problems with BLE and Zigbee devices :(

jeremysherriff commented 2 years ago

@dblueone it looks like things all work successfully for me if I remove the device from the Mi Home app, and then re-pair the device in the Mi Home app. After 20-30 minutes the device states become current again in Home Assistant, and so far I have not needed to change any HA configuration for those devices in order to get things back working again - ie I can use the same name or a different name in the Mi Home app, and the device is still the same device in HA. This is with the PR #695 edits in place, so what I'm saying is, some devices need manual intervention to return to a working state.

I believe the update to 2022.3.3 should be considered a breaking change for this Gateway3 integration; there are manual steps required to recover devices that stop working, but there is (currently) no way to avoid breaking those devices during the upgrade itself.

dblueone commented 2 years ago

@dblueone it looks like things all work successfully for me if I remove the device from the Mi Home app, and then re-pair the device in the Mi Home app. After 20-30 minutes the device states become current again in Home Assistant, and so far I have not needed to change any HA configuration for those devices in order to get things back working again - ie I can use the same name or a different name in the Mi Home app, and the device is still the same device in HA. This is with the PR #695 edits in place, so what I'm saying is, some devices need manual intervention to return to a working state.

I believe the update to 2022.3.3 should be considered a breaking change for this Gateway3 integration; there are manual steps required to recover devices that stop working, but there is (currently) no way to avoid breaking those devices during the upgrade itself.

I was about to edit, after 30 minutes everything woke up like magic, the fix worked :)

jeremysherriff commented 2 years ago

I was about to edit, after 30 minutes everything woke up like magic, the fix worked :)

Interesting, I did not have that experience and nor did my colleague. I'm keen to hear from others, so that people affected in the future know what to expect.

olujicz commented 2 years ago

I was about to edit, after 30 minutes everything woke up like magic, the fix worked :)

Interesting, I did not have that experience and nor did my colleague. I'm keen to hear from others, so that people affected in the future know what to expect.

I can confirm this behavior for mine bluetooth temperature and humidity sensor. Data appeared after some ~20min. Everything else worked right after the fixed was applied.

AlexxIT commented 2 years ago

Thanks @Kirmas for fix. Will be in next release

antstyl commented 2 years ago

Managed to fix the "unavailable" status with the above mentioned fix BUT in automations, when setting a zigbee device as a trigger it has only battery's level change and not all the other it had in the past i.e. click, single, doulble etc

Am I missing something?

Rhylthus commented 2 years ago

Above fix does not work (even waiting after few hours). My gateway is still unavailable. Revert back to older 2022.3.1 and everything is working again.

MarcinKnD commented 2 years ago

where add this line in file?

add

from homeassistant.helpers.entity import EntityPlatformState
rzv-trsc commented 2 years ago

where add this line in file?

add
from homeassistant.helpers.entity import EntityPlatformState

@MarcinKnD check this.

MarcinKnD commented 2 years ago

File Updated. still no data from sensors

rzv-trsc commented 2 years ago

File Updated. still no data from sensors

@MarcinKnD reboot HA. Then wait a couple of minutes, some sensors take a while to update. Some should already be online. As a rule, battery operated devices update when they usually reconnect / resend BLE/mqtt data (in my case, took about 20 minutes) while plugs (powered from grid) updated in less than a minute. Buttons needed to be clicked. Door/window sensors needed open/close. full list of my sensors here

Zewe77 commented 2 years ago

You can manually make changes from #695 and that should help

I have tried this and waited but it did not solve any of my issues. Still, no comm with the HUB, double-checked and running supported firmware

Arching-Noradan commented 2 years ago

Still have no "click" triggers on any switch, buttons, etc. This fix didn't help

djk314 commented 2 years ago

Still have some parts of sensors working with Firmware: 1.4.7_0115 gw3 , fix doesn't help. No triggers switch too Edit : rebooted gateway and now i have some entity's working but missing battery.

vturekhanov commented 2 years ago

Still have some parts of sensors working with Firmware: 1.4.7_0115 gw3 , fix doesn't help. No triggers switch too

Why don't you use firmware v1.5.0_0102? This is the one and only recommended firmware version.

Arching-Noradan commented 2 years ago

Why don't you use firmware v1.5.0_0102? This is the one and only recommended firmware version.

I'm using 1.5.0_0102 and have same problems.

Too51oll commented 2 years ago

Still have no "click" triggers on any switch, buttons, etc. This fix didn't help

Same here. Doesn't really fix much. It breaks automations based on buttons as they're not visible to HA.

Invalid config for [automation]: Integration 'xiaomi_gateway3' does not support device automation triggers.

Too51oll commented 2 years ago

Going back to repo 2.0.2 fixes everything for me as mentioned in #695 by gladiangel. Hope that helps.

djk314 commented 2 years ago

Still have some parts of sensors working with Firmware: 1.4.7_0115 gw3 , fix doesn't help. No triggers switch too

Why don't you use firmware v1.5.0_0102? This is the one and only recommended firmware version.

Never updated, it worked well. Do i need soldering or an OTA ? Edit Done !

Nebur692 commented 2 years ago

Make v2.0.7?