dlarrick / hass-kumo

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

Kumo fails to create entities for 2 mini-split heads #54

Closed spurpura-edu closed 3 years ago

spurpura-edu commented 3 years ago

Home Assistant 2021.7.2 Kumo release-0.2.5

Kumo has been added through HACS and flow configuration. After initial authentication success, a restart of Home Assistant failed to create the climate entities. Error message in the Home Assistant Log is below.

My system has 2 mini split heads. The root of the tree is named Home. The first unit is "Basement Bed". The second unit is "Media Room".

2021-07-14 21:57:44 ERROR (MainThread) [homeassistant.components.climate] Error while setting up kumo platform for climate Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 250, in _async_setup_platform await asyncio.shield(task) File "/config/custom_components/kumo/climate.py", line 125, in async_setup_entry kumo_api = pykumo.PyKumo( File "/usr/local/lib/python3.9/site-packages/pykumo/pykumo.py", line 37, in init 'password': base64.b64decode(cfg_json["password"]), TypeError: 'NoneType' object is not subscriptable

spurpura-edu commented 3 years ago

I blew away the Kumo configuration. Rebooted. Reinstalled from HACS. Rebooted. Installed the integration. Integration reported success. Saw this in the log:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 250, in _async_setup_platform await asyncio.shield(task) File "/config/custom_components/kumo/climate.py", line 128, in async_setup_entry success = await hass.async_add_executor_job(kumo_api.update_status) File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run result = self.fn(*self.args, **self.kwargs) File "/usr/local/lib/python3.9/site-packages/pykumo/pykumo.py", line 103, in update_status response = self._request(query) File "/usr/local/lib/python3.9/site-packages/pykumo/pykumo.py", line 75, in _request url = "http://" + self._address + "/api" TypeError: can only concatenate str (not "NoneType") to str

spurpura-edu commented 3 years ago

Rebooted after installation. Saw this in the log:

2021-07-14 22:18:28 ERROR (MainThread) [homeassistant.components.climate] Error while setting up kumo platform for climate Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 250, in _async_setup_platform await asyncio.shield(task) File "/config/custom_components/kumo/climate.py", line 125, in async_setup_entry kumo_api = pykumo.PyKumo( File "/usr/local/lib/python3.9/site-packages/pykumo/pykumo.py", line 37, in init 'password': base64.b64decode(cfg_json["password"]), TypeError: 'NoneType' object is not subscriptable

spurpura-edu commented 3 years ago

I should have mentioned that this is a Raspberry Pi 4B install of Home Assistant OS. NUT is the only process that has been locally added.

danielgoepp commented 3 years ago

@spurpura-edu sorry, I deleted my previous comment, I jumped to conclusions when I saw the last line of your error message :) I was getting the same NoneType error, but mine was due to a missing address field, not password. This looks like you either have no password set.

dlarrick commented 3 years ago

'password': base64.b64decode(cfg_json["password"]), TypeError: 'NoneType' object is not subscriptable

Somehow the cfg_json is not present (is NoneType). I can only guess that perhaps your password contains special characters that are being misinterpreted by the code (not in Kumo or pykumo) that puts it into the config. Things like quotes or YAML comment characters (#) might be suspicious.

Or, as Daniel says, the "password" field is not present in your kumo_cache.json . If that's the case it's even more flakiness on KumoCloud service.

Can your KumoCloud app control the devices over WiFi?

spurpura-edu commented 3 years ago

My password is 43 characters long and contains alpha characters and periods. I have tested it with a 4 character password (“1234”) and the same behaviors appear.

Where is kumo_cache.json placed in the file system? I’ve been looking for it in /config/custom_components/kumo and I never see it.

I have ready access to KumoCloud through the app on an iPhone and through the web interface from a MacBook Pro. The web interface is really fast compared to the app, and I’m kinda thinking I will rarely use the app in the future.

I have a Ubiqitui Dream Machine Pro and the IP addresses of the mini-split heads did change after a power outage. I had marked them as DHCP Static addresses in the UDM interfaces, but that was not respected on restart and I still don’t know why. My Lutron Bridge also lost its IP address and it would not respect the UDM’s static IP info, so I had to manually change it a static IP address.

I also use a PiHole server with Unbound (recursive DNS) and I can see all of the queries being made to kumocloud by the mini splits and the Raspberry Pi running home assistant.

I have nearly zero familiarity with Home Assistant (I’m only a few weeks into this journey) and I can do additional troubleshooting. I’m just still figuring out the architecture and tools available.

On Jul 15, 2021, at 4:09 AM, dlarrick @.***> wrote:

'password': base64.b64decode(cfg_json["password"]), TypeError: 'NoneType' object is not subscriptable

Somehow the cfg_json is not present (is NoneType). I can only guess that perhaps your password contains special characters that are being misinterpreted by the code (not in Kumo or pykumo) that puts it into the config. Things like quotes or YAML comment characters (#) might be suspicious.

Or, as Daniel says, the "password" field is not present in your kumo_cache.json . If that's the case it's even more flakiness on KumoCloud service.

Can your KumoCloud app control the devices over WiFi?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dlarrick/hass-kumo/issues/54#issuecomment-880607071, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGIY6XXXCCHHPRXNT73ZJBLTX26VDANCNFSM5AMZCK5Q.

dlarrick commented 3 years ago

Please take this support discussion to the Home Assistant discussion forum. If you come up with a concrete action to improve the integration or underlying pykumo library, feel free to open another Issue here on GitHub. I'm going to close this one.