dlarrick / hass-kumo

Home Assistant module interfacing with Mitsubishi mini-split units
MIT License
97 stars 21 forks source link

Home Assistant Won't Startup After Kumo Unit IP Change #33

Closed barndawgie closed 3 years ago

barndawgie commented 4 years ago

I updated the IP's for my Kumo units to make them static. Then, I couldn't get my Home Assistant Docker image to start: The logs are just filled with message like the below over and over.

While failure to connect may be expected, I would hope this wouldn't block Home Assistant startup.

6/24/2020 4:17 stderr 2020-06-24 14:17:13 WARNING (SyncWorker_9) [urllib3.connectionpool] Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f1ec2085610>, 'Connection to 192.168.1.140 timed out. (connect timeout=1.2)')': /api?m=7407cb6ea62a45536c0e5ce78afecfd6da52070ec008ce410a5f509d8c6dc050
6/24/2020 4:17 stderr 2020-06-24 14:17:12 WARNING (SyncWorker_9) [urllib3.connectionpool] Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f1eba5c4e10>, 'Connection to 192.168.1.140 timed out. (connect timeout=1.2)')': /api?m=7407cb6ea62a45536c0e5ce78afecfd6da52070ec008ce410a5f509d8c6dc050
6/24/2020 4:17 stderr 2020-06-24 14:17:11 WARNING (SyncWorker_9) [pykumo.pykumo] Error retrieving adapter profile
     
6/24/2020 4:17 stderr 2020-06-24 14:17:11 WARNING (SyncWorker_9) [pykumo.pykumo] Timeout issuing request http://192.168.1.140/api: HTTPConnectionPool(host='192.168.1.140', port=80): Max retries exceeded with url: /api?m=3f2dfd3c4360e95269b11adefa67c2835140b764a92b32c2f83bbaadaf3fbc76 (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f1eba5c0850>, 'Connection to 192.168.1.140 timed out. (connect timeout=1.2)'))
6/24/2020 4:17 stderr 2020-06-24 14:17:10 WARNING (SyncWorker_9) [urllib3.connectionpool] Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f1ebbf5c6d0>, 'Connection to 192.168.1.140 timed out. (connect timeout=1.2)')': /api?m=3f2dfd3c4360e95269b11adefa67c2835140b764a92b32c2f83bbaadaf3fbc76
6/24/2020 4:17 stderr 2020-06-24 14:17:08 WARNING (SyncWorker_9) [urllib3.connectionpool] Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f1eba5ab9d0>, 'Connection to 192.168.1.140 timed out. (connect timeout=1.2)')': /api?m=3f2dfd3c4360e95269b11adefa67c2835140b764a92b32c2f83bbaadaf3fbc76
6/24/2020 4:17 stderr 2020-06-24 14:17:07 WARNING (SyncWorker_9) [urllib3.connectionpool] Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f1eb9f61c90>, 'Connection to 192.168.1.140 timed out. (connect timeout=1.2)')': /api?m=3f2dfd3c4360e95269b11adefa67c2835140b764a92b32c2f83bbaadaf3fbc76
6/24/2020 4:17 stderr 2020-06-24 14:17:06 WARNING (SyncWorker_9) [pykumo.pykumo] Error retrieving profile
     
6/24/2020 4:17 stderr 2020-06-24 14:17:06 WARNING (SyncWorker_9) [pykumo.pykumo] Timeout issuing request http://192.168.1.140/api: HTTPConnectionPool(host='192.168.1.140', port=80): Max retries exceeded with url: /api?m=203b53807508d148353a8baa4af94b9df531367c3efbb13fcc1f013c53155a95 (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f1ebbeffb50>, 'Connection to 192.168.1.140 timed out. (connect timeout=1.2)'))
6/24/2020 4:17 stderr 2020-06-24 14:17:05 WARNING (SyncWorker_9) [urllib3.connectionpool] Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f1ebbeff310>, 'Connection to 192.168.1.140 timed out. (connect timeout=1.2)')': /api?m=203b53807508d148353a8baa4af94b9df531367c3efbb13fcc1f013c53155a95
6/24/2020 4:17 stderr 2020-06-24 14:17:04 WARNING (SyncWorker_9) [urllib3.connectionpool] Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f1ebbeff090>, 'Connection to 192.168.1.140 timed out. (connect timeout=1.2)')': /api?m=203b53807508d148353a8baa4af94b9df531367c3efbb13fcc1f013c53155a95
6/24/2020 4:17 stderr 2020-06-24 14:17:02 WARNING (SyncWorker_9) [urllib3.connectionpool] Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f1ebbefb0d0>, 'Connection to 192.168.1.140 timed out. (connect timeout=1.2)')': /api?m=203b53807508d148353a8baa4af94b9df531367c3efbb13fcc1f013c53155a95
6/24/2020 4:17 stderr 2020-06-24 14:17:01 WARNING (SyncWorker_9) [pykumo.pykumo] Error retrieving sensors
     
6/24/2020 4:17 stderr 2020-06-24 14:17:01 WARNING (SyncWorker_9) [pykumo.pykumo] Timeout issuing request http://192.168.1.140/api: HTTPConnectionPool(host='192.168.1.140', port=80): Max retries exceeded with url: /api?m=3c06b98e0541fddff2ad602a44de93cb92c3fbe049e4b2aa9d382b1a55731260 (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f1ebbf77410>, 'Connection to 192.168.1.140 timed out. (connect timeout=1.2)'))
6/24/2020 4:17 stderr 2020-06-24 14:17:00 WARNING (SyncWorker_9) [urllib3.connectionpool] Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f1ebbf5f750>, 'Connection to 192.168.1.140 timed out. (connect timeout=1.2)')': /api?m=3c06b98e0541fddff2ad602a44de93cb92c3fbe049e4b2aa9d382b1a55731260
6/24/2020 4:16 stderr 2020-06-24 14:16:59 WARNING (SyncWorker_9) [urllib3.connectionpool] Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f1ebbf5ffd0>, 'Connection to 192.168.1.140 timed out. (connect timeout=1.2)')': /api?m=3c06b98e0541fddff2ad602a44de93cb92c3fbe049e4b2aa9d382b1a55731260
6/24/2020 4:16 stderr 2020-06-24 14:16:58 WARNING (SyncWorker_9) [urllib3.connectionpool] Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f1ebcad7210>, 'Connection to 192.168.1.140 timed out. (connect timeout=1.2)')': /api?m=3c06b98e0541fddff2ad602a44de93cb92c3fbe049e4b2aa9d382b1a55731260
6/24/2020 4:16 stderr 2020-06-24 14:16:56 WARNING (SyncWorker_9) [pykumo.pykumo] Error retrieving status
barndawgie commented 4 years ago

I think I was able to resolve this by deleting my kurmo cache kumo_cache.json file, connecting from my Kumo Cloud iPhone app, and then restarting Home Assistant.

dlarrick commented 4 years ago

Yes, you need to delete your kumo_cache.json (or switch away from "prefer cache" mode) whenever your units' IP address changes. If they change frequently, don't use "prefer cache". This behavior is fully expected.

barndawgie commented 4 years ago

I did not have prefer-cache set. Forcing it to false via the configuration did not resolve the issue.

Main concern I had was that it shouldn't have blocked Home Assistant startup - I couldn't get my HA docker container to load.

dlarrick commented 4 years ago

What version of HomeAssistant are you running? 0.111 made changes in HA startup to allow the core to start up independent of integrations.

Unfortunately your logs above are missing the lines dealing with the kumo_cache file and so aren't much help. All we know is it can't talk to the indoor units, for which the reason is clear.

I suspect that, without prefer_cache on, if you had simply opened the KumoCloud app (or waited some indeterminate amount of time), it would have updated the KumoCloud service's record of your IP addresses and it would have worked OK even without deleting kumo_cache.

In any case, we should probably update the documentation to state more clearly that it doesn't deal well if the IP addresses change. The logic to deal with this is, in fact, not well tested because my setup uses statically-assigned DHCP. I'll re-open this ticket as a placeholder; I'm unable to debug it myself but if anybody figures out a concrete solution (can point out a flaw in the code or produce a patch), please put it here.

barndawgie commented 4 years ago

I'm running Home Assistannt 0.111.4.

There is nothing in my logs referencing kumo_cache - I can try to search for some specific string but nothing stands out looking for kumo or pykumo in the logs. There are a lot of [pykumo.pykumo] Error retrieving profile WARNINGS but I don't see any other details in them.

Opening the Kumo Cloud App did seem to resolve the issue - does that force the Kumo Clouud service to update it's IP information? If so, that could explain why even setting prefer-cache=false didn't resolve the issue since the Kumo Cloud service would've still had stale IP data.

dlarrick commented 4 years ago

does that force the Kumo Clouud service to update it's IP information?

That's my guess, yes. Unfortunately the app's traffic to the KumoCloud server is https (encrypyted) or we could possibly figure out what it's doing and do the same thing before fetching the cache file. There are ways to snoop on encrypted traffic on a phone, but that's more reverse engineering than I'm willing to do, especially since (1) I don't see this problem (static IPs), and (2) there's a workaround (fire up the KumoCloud app).

dlarrick commented 4 years ago

I think I see a way to fix at least the HA not starting part. I can't test until Boston is out of this heat wave though.

dlarrick commented 3 years ago

I've pushed a beta which should improve this situation, v0.2.3-beta.

dlarrick commented 3 years ago

I am closing this issue, since it should be fixed in 0.2.3 (and 0.2.4). Feel free to reopen with updated info if needed.