dlarrick / hass-kumo

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

Force kumo cloud to update IP? #131

Closed mxr closed 6 months ago

mxr commented 6 months ago

Since changing my subnet from 192.168.86.* to 192.168.4.* I've had instability - devices routinely go unavailable in both HA and the Kumo app. I am running with prefer_cache == false.

KumoCloud still has the old IP. Using pykumo, I can see:

>>> from pykumo import KumoCloudAccount
>>> account = KumoCloudAccount.Factory()
<... redacted ...>
>>> account.try_setup()
True
>>> j = account.get_raw_json()
>>> print(*[(d['label'], d['address'], d['mac']) for d in j[2]['children'][0]['zoneTable'].values()], sep='\n')
('Living Room', '192.168.86.47', '74:7a:90:d4:be:5c')
('Bedroom', '192.168.86.46', '74:7a:90:d1:bc:c1')
('Office', '192.168.86.34', '74:7a:90:d3:57:c3')

But on my network I have static IP's configured and can ping the devices using the right IP

> arp -a | rg 192.168.4.1[0-2]
  192.168.4.10          74-7a-90-d1-bc-c1     dynamic
  192.168.4.11          74-7a-90-d4-be-5c     dynamic
  192.168.4.12          74-7a-90-d3-57-c3     dynamic

> ping 192.168.4.10 -n 1

Pinging 192.168.4.10 with 32 bytes of data:
Reply from 192.168.4.10: bytes=32 time=6ms TTL=128

Ping statistics for 192.168.4.10:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 6ms, Maximum = 6ms, Average = 6ms

> ping 192.168.4.11 -n 1

Pinging 192.168.4.11 with 32 bytes of data:
Reply from 192.168.4.11: bytes=32 time=7ms TTL=128

Ping statistics for 192.168.4.11:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 7ms, Maximum = 7ms, Average = 7ms

> ping 192.168.4.12 -n 1

Pinging 192.168.4.12 with 32 bytes of data:
Reply from 192.168.4.12: bytes=32 time=8ms TTL=128

Ping statistics for 192.168.4.12:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 8ms, Maximum = 8ms, Average = 8ms

I have tried removing/readding the integration and even with prefer_cache == false I get a cache file with the 192.168.86.* IP's. But if I edit that file manually things seem to work to at least get the integration set up. Later, instability sets in.

In HA logs I see recurring timeouts and unavailability across various devices

2024-01-07 09:42:00.176 WARNING (SyncWorker_8) [urllib3.connectionpool] Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f8e00e350>, 'Connection to 192.168.4.10 timed out. (connect timeout=1.2)')': /api?m=<redacted>

image

I apologize in advance since I realize this is not a kumo cloud issue tracker but is there a way to force hass-kumo to refresh the IP on KumoCloud's end? Or another avenue? I configured static IP's months ago. Thanks in advance

mxr commented 6 months ago

I resigned to returning to my old subnet, and configured static IP's to match what kumo cloud returns. Hopefully that improves stability 🤞