dlarrick / hass-kumo

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

Out of sync set point and current temp #29

Closed tmchow closed 3 years ago

tmchow commented 4 years ago

I’m having weird issues with the HA reporting different set point and current temp compared to the kumo app.

105FB7D6-BD14-4D84-BD5D-B95CF128AF21 ![Uploading 5D4F686A-FCD0-4790-836A-4520C4E35859.png…]()

dlarrick commented 4 years ago

Not seeing your 2nd image (presumably a KumoCloud screenshot).

My advice: stop trying to use HA and KumoCloud app together. They're both polling the indoor units, relatively infrequently. What's more, KumoCloud tries to talk locally to the units (using the same protocol as HA is using), but if it fails it falls back to a cloud API into which we have no visibility since it's over https. HA only polls climate units once a minute, so if you make a change in KumoCloud (or with a wireless remote), it might not show up in HA for a while.

Another issue might be that the units' API is in Celsius. HA and KumoCloud may be converting differently; I have seen some evidence that KumoCloud app is not actually doing math but instead using a lookup table.

If you'd like to try to debug, my approach would be to take packet captures on your phone while running HA and KumoCloud, and see if you can spot a difference in the responses being returned from the indoor unit. If I'm somehow misinterpreting the data then that can likely be fixed -- unless it's rounding of Celsius; I'm not interested in trying to reverse-engineer their lookup table.

tmchow commented 4 years ago

I'm actually only trying to use HA now, but had weirdness where it didn't seem like the temp and set points were updating based on my changes. Hence, why I went to kumo cloud app to see what was going on, and noticed the difference. I waited multiple minutes to see if HA would update to reflect what I saw in Kumo cloud app, but it never did.

In my logs, I am seeing this craziness:

Logger: pykumo.pykumo
Source: custom_components/kumo/climate.py:203
First occurred: May 24, 2020, 5:36:45 PM (32479 occurrences)
Last logged: 7:27:20 PM

Error retrieving sensors
Error issuing request http://192.168.1.146/api: HTTPConnectionPool(host='192.168.1.146', port=80): Max retries exceeded with url: /api?m=bcf7d16cec84c32c35923481158dd6808d89551e878fa8b61ae732147667cf8d (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f52eab76ed0>: Failed to establish a new connection: [Errno 111] Connection refused'))
Error retrieving profile
Error issuing request http://192.168.1.146/api: HTTPConnectionPool(host='192.168.1.146', port=80): Max retries exceeded with url: /api?m=82c02f61182ec4b16c8e943920e18d019fd9a9f10b67a8b6961dbc39f70cf3df (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f52e09dce50>: Failed to establish a new connection: [Errno 111] Connection refused'))
Error retrieving adapter profile

I just put another Access Point in my basement where that main units wifi adapter is, so hoping that will help connectivity issues.

dlarrick commented 4 years ago

Connection refused! Now that's odd. I can think of only a few possibilities:

  1. Some sort of rate limiting. Seems unlikely
  2. Some sort of firewall between your HA and the unit(s)
  3. Power issues / loose connector causing the Kumo WiFi unit to reboot
  4. DHCP lease changes
  5. IP address conflict (multiple machines on your network with the same IP address)

I highly recommend setting up a static / persistent DHCP lease for the Kumo units, if your router supports it.

tmchow commented 4 years ago
dlarrick commented 4 years ago

"Connection refused" is bad. That means either the service (on the Kumo unit) is not running / not listening, or something (firewall?) in the middle is actively preventing the TCP socket from opening. In TCP terms, something replied with a RST/ACK packet to the HA system's SYN packet.

tmchow commented 4 years ago

Sh*t, I have no idea how to troubleshoot this. I went into my unifi dashboard to see any events and noticed some disconnects that happen at blips for like a minute:

image

However, I then looked back in logs to look at the timeframe I saw the HA erros (1130am to 1215pm PT) and saw this frequent disconnects with the Attic (name for my home office):

image

So based on this, I'm thinking the issue is the Attic/Office unit, so I'm going to try to get an AP up here.

omriasta commented 4 years ago

Not sure if it's the same issue but occasionally there is an issue with the kumo device denying connections to certain local ips. Usually restarting my entire mesh network resolves this for me with Google WiFi. I originally brought this up with the author of the kumojs project. @dlarrick has also seen something similar https://community.home-assistant.io/t/mitsubishi-kumo-cloud-integration/121508/120

tmchow commented 4 years ago

Got my new AP in that home office area where the second wall unit it. Unfortunately I’m still seeing the same connection errors all over my logs.

Both units have static IPs too. I’m struggling to figure out what is going on

omriasta commented 4 years ago

Check if you can ping the devices from your Hass setup. I also noticed this a few times but I was trying to ping from a different device which was getting responses. When I tried to ping from my Hass it was being blocked. Only way I have figured so far is to restart my entire network (all access points). It's possible that just having the AP that Hass or the kumo unit is connected to rebooted may work but I usually just reboot all.

tmchow commented 3 years ago

I resolved this issue by creating a separate 2Ghz wifi network. In latest installer manual for Kumo cloud, they specifically say a dual band network can cause network disconnects. After creating a dedicated 2Ghz network, It seems to be resolved.