deiger/AirCon

KeyError in query_handlers key_exchange_handler

Opened this issue · 1 comments

I am getting KeyError: '192.168.1.1' when using the addon.

Here's what I see in DEBUG logs:

D1128 22:40:49.036  notifier.py:112] [KeepAlive] Sending PUT http://192.168.40.20/local_reg.json {"local_reg": {"ip": "192.168.1.32", "notify": 1, "port": 8765, "uri": "/local_lan"}}
E1128 22:40:50.068  web_protocol.py:403] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/aiohttp-3.8.5-py3.10-linux-armv7l.egg/aiohttp/web_protocol.py", line 433, in _handle_request
    resp = await request_handler(request)
  File "/usr/local/lib/python3.10/site-packages/aiohttp-3.8.5-py3.10-linux-armv7l.egg/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
  File "/app/aircon/query_handlers.py", line 42, in key_exchange_handler
    updated_keys = self._devices_map[request.remote].update_key(key)
KeyError: '192.168.1.1'

FWIW 192.168.1.1 is an IP of my router. My IOT devices are in the 192.168.40.0/24 subnet. My HASS is 192.168.1.32.

The server is launches as

   27 ?        Sl     0:15 python -m aircon --log_level DEBUG run --port 8765 --mqtt_host core-mosquitto --mqtt_port 1883 --mqtt_user hisense:redacted --local_ip 192.168.1.32 --config /config/hisense/config_bedroomac.json --type ac

My configuration is:

{"name": "Bedroom AC", "app": "hisense-eu", "model": "Smart-1-70-eu", "sw_version": "ADA 1.4.3-beta ameba 2018-03-28 19:20:06 8f4xxxxxx", "dsn": "AC000W0xxxxxxxxx", "temp_type": "C", "mac_address": "ca2c4xxxxxxx", "ip_address": "192.168.40.20", "lanip_key": "K5YRppSrYxxxREDACTED", "lanip_key_id": 4NNNN}

Any ideas what might be happening? I am willing to debug this in-depth with guidance as I am a SWE myself

Hi
Did you manage to solve the problem?
I have the same one, the add-on has started but the logs are screaming
I0703 06:51:50.432 web_log.py:206] 192.168.87.1 [03/Jul/2024:04:51:50 +0000] "POST /local_lan/key_exchange.json HTTP/1.1" 500 245 "-" "-" E0703 06:51:50.665 web_protocol.py:403] Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/aiohttp-3.8.5-py3.10-linux-x86_64.egg/aiohttp/web_protocol.py", line 433, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.10/site-packages/aiohttp-3.8.5-py3.10-linux-x86_64.egg/aiohttp/web_app.py", line 504, in _handle resp = await handler(request) File "/app/aircon/query_handlers.py", line 42, in key_exchange_handler updated_keys = self._devices_map[request.remote].update_key(key) KeyError: '192.168.87.1' I0703 06:51:50.666 web_log.py:206] 192.168.87.1 [03/Jul/2024:04:51:50 +0000] "POST /local_lan/key_exchange.json HTTP/1.1" 500 245 "-" "-"
and I don't know what the problem is and how to solve it....