I think I probably found something in the logs… please could you help me with this?
First thing:
JSON file not found: /usr/local/lib/python3.6/site-packages/homeassistant/components/binary_sensor/.translations/xiaomi_aqara.pl.json
second, is this… the 14charkey is from wall swtich which works fine, so not sure why it’s invalid.:
2018-10-08 14:08:18 DEBUG (SyncWorker_0) [xiaomi_gateway] _send_cmd >> b'{"cmd": "write", "sid": "14charkey", "data": {"channel_0": "on", "key": "32charkey"}}'
2018-10-08 14:08:18 DEBUG (SyncWorker_0) [xiaomi_gateway] _send_cmd resp << {'cmd': 'write_ack', 'sid': '14charkey', 'data': '{"error":"Invalid key"}'}
2018-10-08 14:08:18 DEBUG (SyncWorker_0) [xiaomi_gateway] write_ack << {'cmd': 'write_ack', 'sid': '14charkey', 'data': '{"error":"Invalid key"}'}
2018-10-08 14:08:18 ERROR (SyncWorker_0) [xiaomi_gateway] Got error element in data {"error":"Invalid key"}
third tihng is that when I turn on the aqara wall switch I can see this, and it works fine in HA:
2018-10-08 14:08:17 DEBUG (MainThread) [homeassistant.components.websocket_api] WS 140149458514104: Received {'type': 'call_service', 'domain': 'switch', 'service': 'turn_on', 'service_data': {'entity_id': 'switch.wall_switch_14charkey'}, 'id': 14}
2018-10-08 14:08:17 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=switch, service=turn_on, service_data=entity_id=switch.wall_switch_14charkey, service_call_id=32charkey>
when I turn on xiaomi gateway light, the switch in HA go to right side but in second it goes back to grey, however the light is on, and I cannot turn it off in HA, only in Mi Home app. The log is:
2018-10-08 14:08:39 DEBUG (MainThread) [homeassistant.components.websocket_api] WS 140149458514104: Received {'type': 'call_service', 'domain': 'light', 'service': 'turn_on', 'service_data': {'entity_id': 'light.gateway_light_12charkey'}, 'id': 16}
2018-10-08 14:08:39 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=light, service=turn_on, service_data=entity_id=light.gateway_light_12charkey, service_call_id=32charkey>
2018-10-08 14:08:39 DEBUG (SyncWorker_4) [xiaomi_gateway] _send_cmd >> b'{"cmd": "write", "sid": "12charkey", "data": {"rgb": 1694498815, "key": "32charkey"}}'
2018-10-08 14:08:39 DEBUG (SyncWorker_4) [xiaomi_gateway] _send_cmd resp << {'cmd': 'write_ack', 'model': 'gateway', 'sid': '12charkey', 'short_id': 0, 'data': '{"rgb":1694498815,"illumination":1292,"proto_version":"1.1.2"}'}
2018-10-08 14:08:39 DEBUG (SyncWorker_4) [xiaomi_gateway] write_ack << {'cmd': 'write_ack', 'model': 'gateway', 'sid': '12charkey', 'short_id': 0, 'data': '{"rgb":1694498815,"illumination":1292,"proto_version":"1.1.2"}'}
and this:
2018-10-08 13:52:26 DEBUG (SyncWorker_1) [homeassistant.util.json] JSON file not found: /config/.storage/core.device_registry
2018-10-08 13:52:32 DEBUG (SyncWorker_0) [homeassistant.util.json] JSON file not found: /config/.storage/cloud
2018-10-08 13:55:29 DEBUG (SyncWorker_1) [homeassistant.util.json] JSON file not found: /config/.storage/auth_module.totp