ha版本:2023.5.2
问题:小燕网关里面有一个调光模块。第一次添加小燕组件可以正常控制,但是重启后灯光可以读取状态但是无法控制,日志为Unable to find referenced entities light.1 or it is/they are currently not available。然后删除组件,在重新添加组件,小燕网关正常添加,但是调光模块无法发现。日志为:
2023-06-15 17:10:07.027 INFO (MainThread) [custom_components.terncy.config_flow] construct Terncy obj for 1c8259900e36 192.168.2.248
2023-06-15 17:10:10.804 WARNING (MainThread) [custom_components.terncy.config_flow] request a new token form terncy box-1c-82-59-90-0e-36
2023-06-15 17:10:11.414 INFO (MainThread) [custom_components.terncy] got event message box-1c-82-59-90-0e-36 {'entities': [{'id': 'token-00000017', 'model': 'TERNCY-TOKEN', 'type': 'token'}], 'intent': 'event', 'type': 'entityAvailable'}
2023-06-15 17:10:11.415 INFO (MainThread) [custom_components.terncy] [box-1c-82-59-90-0e-36] token-00000017 is available
2023-06-15 17:10:11.418 INFO (MainThread) [custom_components.terncy] got event message box-1c-82-59-90-0e-36 {'entities': [{'id': 'token-00000017', 'model': 'TERNCY-TOKEN', 'type': 'token'}], 'intent': 'event', 'type': 'entityAvailable'}
2023-06-15 17:10:11.418 INFO (MainThread) [custom_components.terncy] [box-1c-82-59-90-0e-36] token-00000017 is available
2023-06-15 17:10:11.421 INFO (MainThread) [custom_components.terncy] got event message box-1c-82-59-90-0e-36 {'entities': [{'id': 'token-00000017', 'model': 'TERNCY-TOKEN', 'type': 'token'}], 'intent': 'event', 'type': 'entityAvailable'}
2023-06-15 17:10:11.421 INFO (MainThread) [custom_components.terncy] [box-1c-82-59-90-0e-36] token-00000017 is available
2023-06-15 17:10:11.425 INFO (MainThread) [custom_components.terncy] update or create entity {'id': 'token-00000017', 'model': 'TERNCY-TOKEN', 'type': 'token'}
2023-06-15 17:10:11.426 INFO (MainThread) [custom_components.terncy] update or create entity {'id': 'token-00000017', 'model': 'TERNCY-TOKEN', 'type': 'token'}
2023-06-15 17:10:11.427 INFO (MainThread) [custom_components.terncy] update or create entity {'id': 'token-00000017', 'model': 'TERNCY-TOKEN', 'type': 'token'}
2023-06-15 17:10:17.120 INFO (MainThread) [custom_components.terncy] got event message box-1c-82-59-90-0e-36 {'entities': [{'id': 'token-00000017', 'model': 'TERNCY-TOKEN', 'type': 'token'}], 'intent': 'event', 'type': 'entityUpdated'}
2023-06-15 17:10:17.120 INFO (MainThread) [custom_components.terncy] unsupported event type entityUpdated
2023-06-15 17:10:17.123 INFO (MainThread) [custom_components.terncy] got event message box-1c-82-59-90-0e-36 {'entities': [{'id': 'token-00000017', 'model': 'TERNCY-TOKEN', 'type': 'token'}], 'intent': 'event', 'type': 'entityUpdated'}
2023-06-15 17:10:17.123 INFO (MainThread) [custom_components.terncy] unsupported event type entityUpdated
2023-06-15 17:10:17.125 INFO (MainThread) [custom_components.terncy] got event message box-1c-82-59-90-0e-36 {'entities': [{'id': 'token-00000017', 'model': 'TERNCY-TOKEN', 'type': 'token'}], 'intent': 'event', 'type': 'entityUpdated'}
2023-06-15 17:10:17.126 INFO (MainThread) [custom_components.terncy] unsupported event type entityUpdated
2023-06-15 17:10:21.256 WARNING (MainThread) [custom_components.terncy.config_flow] token valid, create entry for box-1c-82-59-90-0e-36
2023-06-15 17:10:21.262 INFO (MainThread) [custom_components.terncy] terncy domain async_setup_entry box-1c-82-59-90-0e-36
2023-06-15 17:10:21.263 INFO (MainThread) [custom_components.terncy] start connection to box-1c-82-59-90-0e-36 192.168.2.248
2023-06-15 17:10:21.277 INFO (MainThread) [homeassistant.components.light] Setting up light.terncy
2023-06-15 17:10:21.281 INFO (MainThread) [homeassistant.components.cover] Setting up cover.terncy
2023-06-15 17:10:21.286 INFO (MainThread) [homeassistant.components.switch] Setting up switch.terncy
2023-06-15 17:10:21.291 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.terncy
2023-06-15 17:10:21.297 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.terncy
2023-06-15 17:10:21.305 INFO (MainThread) [terncy.terncy] Terncy v0.3.5 starting connection to:
2023-06-15 17:10:21.305 INFO (MainThread) [terncy.terncy] box-1c-82-59-90-0e-36 192.168.2.248:443
2023-06-15 17:10:21.311 INFO (MainThread) [custom_components.terncy.light] setup terncy light platform
2023-06-15 17:10:21.313 INFO (MainThread) [custom_components.terncy.cover] setup terncy curtain platform
2023-06-15 17:10:21.315 INFO (MainThread) [custom_components.terncy.switch] setup terncy smart plug platform
2023-06-15 17:10:21.317 INFO (MainThread) [custom_components.terncy.binary_sensor] setup terncy curtain platform
2023-06-15 17:10:21.319 INFO (MainThread) [custom_components.terncy.sensor] setup terncy curtain platform
2023-06-15 17:10:21.854 INFO (MainThread) [terncy.terncy] connected to box-1c-82-59-90-0e-36
2023-06-15 17:10:21.855 INFO (MainThread) [custom_components.terncy] got connected event box-1c-82-59-90-0e-36
2023-06-15 17:10:21.859 INFO (MainThread) [custom_components.terncy] refresh devices now
2023-06-15 17:10:21.896 INFO (MainThread) [custom_components.terncy] update or create entity {'hwVersion': 2, 'id': '8cf681fffe4fa7ac-00', 'model': 'TERNCY-ST01-CV', 'online': True, 'ota': -1, 'services': [{'attributes': [{'attr': 'hue', 'value': 246}, {'attr': 'saturation', 'value': 254}, {'attr': 'colorTemperature', 'value': 0}, {'attr': 'brightness', 'value': 0}, {'attr': 'on', 'value': 0}], 'id': '8cf681fffe4fa7ac-01', 'name': '1', 'profile': 27}], 'type': 'device', 'version': 50}
2023-06-15 17:10:21.897 INFO (MainThread) [custom_components.terncy] Updating service {'attributes': [{'attr': 'hue', 'value': 246}, {'attr': 'saturation', 'value': 254}, {'attr': 'colorTemperature', 'value': 0}, {'attr': 'brightness', 'value': 0}, {'attr': 'on', 'value': 0}], 'id': '8cf681fffe4fa7ac-01', 'name': '1', 'profile': 27}, available=True
2023-06-15 17:10:21.897 INFO (MainThread) [custom_components.terncy] need to add dev 1 27 8cf681fffe4fa7ac-01 to platform
2023-06-15 17:10:21.897 INFO (MainThread) [custom_components.terncy] add device 1 of light to light
2023-06-15 17:10:21.907 ERROR (MainThread) [homeassistant.components.light] Platform terncy does not generate unique IDs. ID 8cf681fffe4fa7ac-01 already exists - ignoring light.1
2023-06-15 17:10:21.911 INFO (MainThread) [custom_components.terncy.light] update state event to [{'attr': 'hue', 'value': 246}, {'attr': 'saturation', 'value': 254}, {'attr': 'colorTemperature', 'value': 0}, {'attr': 'brightness', 'value': 0}, {'attr': 'on', 'value': 0}]
2023-06-15 17:10:21.912 INFO (MainThread) [custom_components.terncy] update or create entity {'hwVersion': 1, 'id': '8cf681fffeba93b1-00', 'model': 'SM0202', 'online': True, 'ota': -1, 'services': [{'attributes': [{'attr': 'battery', 'value': 200}, {'attr': 'iasZoneStatus', 'value': 0}], 'id': '8cf681fffeba93b1-01', 'name': '', 'profile': 21}], 'type': 'device', 'version': 71}
2023-06-15 17:10:21.912 INFO (MainThread) [custom_components.terncy] Updating service {'attributes': [{'attr': 'battery', 'value': 200}, {'attr': 'iasZoneStatus', 'value': 0}], 'id': '8cf681fffeba93b1-01', 'name': '', 'profile': 21}, available=True
2023-06-15 17:10:21.912 INFO (MainThread) [custom_components.terncy] unsupported profile 21
2023-06-15 17:10:21.912 INFO (MainThread) [custom_components.terncy] update or create entity {'hwVersion': 1, 'id': 'box-1c-82-59-90-0e-36', 'model': 'TERNCY-GW02', 'online': True, 'ota': 30187, 'services': [{'attributes': [{'attr': 'volume', 'value': 57}, {'attr': 'playState', 'value': 0}, {'attr': 'mute', 'value': 0}], 'id': 'box-1c-82-59-90-0e-36-01', 'name': '1c8259900e36', 'profile': 16}], 'type': 'device', 'version': 30098}
2023-06-15 17:10:21.912 INFO (MainThread) [custom_components.terncy] Updating service {'attributes': [{'attr': 'volume', 'value': 57}, {'attr': 'playState', 'value': 0}, {'attr': 'mute', 'value': 0}], 'id': 'box-1c-82-59-90-0e-36-01', 'name': '1c8259900e36', 'profile': 16}, available=True
2023-06-15 17:10:21.913 INFO (MainThread) [custom_components.terncy] unsupported profile 16