midea-ac-py icon indicating copy to clipboard operation
midea-ac-py copied to clipboard

Platform error climate.midea_ac - Requirements for midea_ac not found: ['msmart==0.2.4']

Open mcza88 opened this issue 3 years ago • 14 comments

Bug Description After the update on release 0.2.4 the error appears. Already tried to install via 'pip install msmart', which led to the upgrade to msmart 0.2.5 but the error persists. ➜ ~ pip show msmart Name: msmart Version: 0.2.5 Summary: A library to control Midea appliances via the Local area network Home-page: https://github.com/mac-zhou/midea-msmart Author: mac_zhou Author-email: [email protected] License: MIT Location: /usr/lib/python3.10/site-packages Requires: click, ifaddr, pycryptodome, requests

Tried also to upgrade Core Version to 2022.7.6, but the issue is not solved.

I can get the devices discovered with 'Midea-discover' via CLI

INFO:msmart.cli:*** Found a device: {'name': 'net_ac_DB24', 'ssid': 'net_ac_DB24', 'ip': '192.168.188.199 [...] INFO:msmart.cli:*** Found a device: {'name': 'net_ac_FB12', 'ssid': 'net_ac_FB12', 'ip': '192.168.188.198' [...]

but they are still Unavailable on the GUI and the HA Configuration check fails with the error

Platform error climate.midea_ac - Requirements for midea_ac not found: ['msmart==0.2.4'].

Versions (版本信息)

  • Home Assistant version: 2022.6.6 and 2022.7.6
  • OS version: 8.2
  • Midea msmart version: 0.2.4

mcza88 avatar Jul 25 '22 10:07 mcza88

UPDATE

reverting to a previous snapshot, with Core 2022.6.6 and a previous version of the component (the manifest says 0.0.0) which required msmart version 0.1.24, the problem does not appear, even if it seems that the msmart is not installed at all.

new manifest.json "domain": "midea_ac", "name": "Midea Smart AC", "version": "0.2.4", "documentation": "https://github.com/mac-zhou/midea-ac-py", "issue_tracker": "https://github.com/mac-zhou/midea-ac-py/issues", "requirements": ["msmart==0.2.4", "pycryptodome", "pycryptodomex", "click"], "dependencies": [], "codeowners": ["@mac-zhou"], "iot_class": "local_polling", "config_flow": true, "loggers": ["msmart"]

old version manifest.json "domain": "midea_ac", "name": "Midea Smart Aircon", "version": "0.0.0", "documentation": "", "requirements": ["msmart==0.1.24", "pycryptodome", "midea"], "dependencies": [], "codeowners": ["@mac-zhou"]

HA restored config OS Version: Home Assistant OS 8.2 Home Assistant Core: 2022.6.6

➜ ~ pip show msmart WARNING: Package(s) not found: msmart

mcza88 avatar Jul 25 '22 10:07 mcza88

I'm not familiar with Home Assistant Core installations but you can try to manually installing the dependency. Try pip install msmart==0.2.4 within the virtual-env used by HA core.

mill1000 avatar Jul 25 '22 16:07 mill1000

I'll give it a try, but I've already done something very similar by installing msmart manually after the component update. It installed the version 0.2.5 and it didn't fix the problem, it would be extremely strange if a newer version of msmart causes a compatibility issue with the component.

mcza88 avatar Jul 26 '22 07:07 mcza88

That's odd!

➜  ~ pip install msmart==0.2.4
ERROR: Could not find a version that satisfies the requirement msmart==0.2.4 (from versions: 0.1.8, 0.1.10, 0.1.11, 0.1.12, 0.1.13, 0.1.14, 0.1.15, 0.1.16, 0.1.17, 0.1.18, 0.1.19, 0.1.20, 0.1.21, 0.1.22, 0.1.23, 0.1.24, 0.1.25, 0.1.26, 0.1.27, 0.1.28, 0.1.29, 0.1.30, 0.1.31, 0.1.32, 0.1.33, 0.1.34, 0.1.35, 0.1.36, 0.2.0, 0.2.1, 0.2.2, 0.2.3, 0.2.5)
ERROR: No matching distribution found for msmart==0.2.4

It seems no 0.2.4 version exists.

Installing msmart==0.2.3 is impossible as well, the installation fails with error

error: legacy-install-failure

× Encountered error while trying to install package.
╰─> pycryptodome

Trying to install component version 0.2.3 keeps causing the ACs to be 'Unavailable' with the following errors on HA logs

Broken pipe

Logger: msmart.lan
Source: /usr/local/lib/python3.10/site-packages/msmart/lan.py:70 
First occurred: 09:13:32 (1 occurrences) 
Last logged: 09:13:32

Send 192.168.188.200:41228 -> 192.168.188.198:6444 retries: 0 time: 119.86 Error: [Errno 32] Broken pipe

AC timeout?

Logger: msmart.device.AC.appliance
Source: /usr/local/lib/python3.10/site-packages/msmart/device/AC/appliance.py:114 
First occurred: 09:13:22 (3 occurrences) 
Last logged: 09:50:23

Got Null from 192.168.188.198:6444 Version: 2 Count: 0 Spend time: 5.01
Got Null from 192.168.188.199:6444 Version: 2 Count: 0 Spend time: 5.01

Could be something related to python 3.10?

mcza88 avatar Jul 26 '22 07:07 mcza88

It appears msmart 0.2.4 is not available in PyPi.

You could try installing directly from the repo at the v0.2.4 commit.

pip install git+https://github.com/mac-zhou/midea-msmart@a14eb0f2f005e25bbf7684f817a5a98b2674a080

I get a few timeouts here and there in my log. Usually not enough to cause it to become unavailable. You could try the Keep Last Known State option.

mill1000 avatar Jul 26 '22 15:07 mill1000

How do you use pip to install the version? By trying with the Terminal plugin it says that pip / python / python3 / apt-get are not known commands. Am I missing something to install pip components?

AndoKarim avatar Jul 29 '22 11:07 AndoKarim

How do you use pip to install the version? By trying with the Terminal plugin it says that pip / python / python3 / apt-get are not known commands. Am I missing something to install pip components?

I'm using the 'SSH & Web Terminal' add-on.

mcza88 avatar Jul 29 '22 12:07 mcza88

I'm using it and when typing "pip" it fails image

AndoKarim avatar Jul 29 '22 12:07 AndoKarim

And when putting the github URL directly in the manifest, I get this error in the logs: image Logs image

When running the pip install git+ locally on my laptop it works. But here it seems to be bothered by the "+" in the URL.

I followed the HA docs regarding manifest.json and it's how it should be done..

AndoKarim avatar Jul 29 '22 12:07 AndoKarim

How are you running HA? OS? Container? Supervised? Core?

Is pip3 a recognized command?

mill1000 avatar Jul 29 '22 16:07 mill1000

I'm using the HA OS for Rapsberry. Using the Terminal and SSH module doesn't recognize any command at all image

AndoKarim avatar Jul 29 '22 16:07 AndoKarim

Tried to access to the docker homeassistant with docker exec but it does not recognize docker either.

The issue is that my AC was perfectly working before I got power outage and everything restarted. Then it failed because there is no 0.2.4 in pypy. It should be working now that we have a way to find msmart with your fork or even by cloning the git but issues are different.

The working setup was 16 days ago and the diff are not that huge for the midea-ac-py repo

AndoKarim avatar Jul 29 '22 16:07 AndoKarim

Just wanted to share my experience here as I had the same issue. I updated msmart to 0.2.5 in the manifest file of the midea_ac component itself and was able to get it to load in HA. I'm running Core 2022.9.4

I had one other issue that may or may not be related which was that none of the modes were listed for my unit (heat, cool, heat_cool, etc). I assume this was particular to my unit, which is a DuctlessAire heat pump. midea-discover shows a model number of "00Q13", which is not the "0xac" specified in this readme. Interestingly, I was able to manually add these modes in the component and it works great.

For example, in climate.py:

self._operation_list.append("heat")
self._operation_list.append("cool")

duanechew avatar Sep 22 '22 18:09 duanechew

Those modes might have been missing because of mac-zhou/midea-msmart#90 as seen in #186 and #183. The fix is sitting here mac-zhou/midea-msmart#95

mill1000 avatar Sep 23 '22 02:09 mill1000