dlarrick / hass-kumo

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

after new update unavailable #151

Open mike19home opened 3 months ago

mike19home commented 3 months ago

After an auto update, all my kumo cloud went unavailable I restore to an older backup, and everything went back to normal. Then, when I updated again, everything went to unavailable.

dlarrick commented 3 months ago

You're going to have to look in your logs and see what it's complaining about. There's something different about your setup that's making it unhappy. Also make sure your base HomeAssistant is up to date. There were changes in this release to accommodate some renamed constants from the main project.

cfurrow commented 3 months ago

I also received "unavailable" recently. So far, what I see are timeout issues, and the IP does not seem correct.

2024-07-04 15:02:36.016 WARNING (SyncWorker_18) [pykumo.py_kumo_base] Timeout issuing request http://192.168.1.100/api: HTTPConnectionPool(host='192.168.1.100', port=80): Max retries exceeded with url: /api?m=xxxSNIPxxx (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x14e22c0ad850>, 'Connection to 192.168.1.100 timed out. (connect timeout=1.2)'))
2024-07-04 15:02:36.016 WARNING (SyncWorker_18) [pykumo.py_kumo] Ceiling Unit: Did not get defrost from b'{"c":{"indoorUnit":{"status":{"defrost":{}}}}}': {}
2024-07-04 15:02:36.016 WARNING (SyncWorker_18) [pykumo.py_kumo] Ceiling Unit: Error retrieving status from {}: 'r'
2024-07-04 15:02:36.017 WARNING (SyncWorker_1) [pykumo.py_kumo_base] Timeout issuing request http://192.168.1.105/api: HTTPConnectionPool(host='192.168.1.105', port=80): Max retries exceeded with url: /api?m=xxxSNIPxxx (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x14e223200a40>, 'Connection to 192.168.1.105 timed out. (connect timeout=1.2)'))
2024-07-04 15:02:36.017 WARNING (SyncWorker_1) [pykumo.py_kumo] Wall Unit: Did not get defrost from b'{"c":{"indoorUnit":{"status":{"defrost":{}}}}}': {}

I'm not familiar what IP I should see there, but, those IP addresses do not match any related Kumo device. Not sure what is supposed to be listening on 192.168.1.105 and 192.168.1.100.

I removed the devices within Home Assistant, and then re-added them via signing into Kumo again, but have the same error. I'll try and debug some more and will report back.

Update: As the logs show, this may be an issue with the underlying pykumo library. It seems to believe its address is one of 192.168.1.105 or 192.168.1.100. I don't think that's correct, and I am trying to figure out what may be giving it that address

https://github.com/dlarrick/pykumo/blob/master/pykumo/py_kumo_base.py

    def __init__(self, name, addr, cfg_json, timeouts=None, serial=None):
        """ Constructor
        """
        self._name = name
        self._address = addr
        #...snipped

    def _request(self, post_data):
        """ Send request to configured unit and return response dict
        """
        if not self._address:
            _LOGGER.warning("Unit %s address not set", self._name)
            return {}
        url = "http://" + self._address + "/api"
        token = self._token(post_data)
        headers = {'Accept': 'application/json, text/plain, */*',
                   'Content-Type': 'application/json'}
        token_param = {'m': token}
        #...snipped

Update 2: I installed pykumo locally, and opened up a python shell to see if I could debug from there:

import pykumo
account = pykumo.KumoCloudAccount.Factory()
account.get_indoor_units() #=> ['xxxUnit1xxx', 'xxxUnit2xxx']

kumos = account.make_pykumos()

Error issuing request http://192.168.1.105/api: HTTPConnectionPool(host='192.168.1.105', port=80): Max retries exceeded with url: /api?m=4f78e315ec6ed01659a5b21179b30a7a739d5dbfb79622dc30ceeb384b2adbdf (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x108019a30>: Failed to establish a new connection: [Errno 64] Host is down'))
Error issuing request http://192.168.1.105/api: HTTPConnectionPool(host='192.168.1.105', port=80): Max retries exceeded with url: /api?m=eb58ca6d4f4ef611309839f2143608f733edd65c7c432a47d401ccacc133df09 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x10801a840>: Failed to establish a new connection: [Errno 64] Host is down'))

#...snipped

That's the same issue I was seeing in the Home Assistant logs. Not sure what it means yet, but I can try to poke at it some more.

Update 3: I used pykumo to dump the raw JSON details from my indoor units:

account.get_raw_json()

And that's where I saw those two IPs being used, which are incorrect: 192.168.1.100 and 192.168.1.105. Those must be "old" IPs of the units, their new IPs are in the 192.168.7.xxx range. I do not know how this disconnect happened. My router will assign IPs from 192.168.1.xxx to 192.168.7.xxx, but it seems Kumo cloud may have old data that it's the passing to pykumo, causing timeout issues because the devices cannot be reached at those old IPs.

Not sure how I can get those IPs updated yet. Continuing to debug.

Update 4: I see from pykumo's readme that they strongly suggest to reserve IP addresses for the units. That is what I'll do. Since they seem to think they are on IPs 192.168.1.xxx, I'll reserve those.

Kumo accesses your indoor units directly on the local LAN using their IP address, discovered at setup time (or at Home Assistant startup, if prefer_cache is False) from the Kumo Cloud web service. It is strongly recommended that you set a fixed IP address for your indoor unit(s), using something like a DHCP reservation.

Update 5: After reserving the IPs for each of my mini split units, and then restarting my router, everything seems to be working again. The Kumo Cloud app shows the units, as well as Home Assistant.

Hopefully this will be helpful to someone else.

mike19home commented 2 months ago

Thank you very much I will try that

bmos commented 2 months ago

I'd highly suggest you set static IP addresses for your Kumo units if your router allows this.