mac-zhou / midea-ac-py

Home Assistant Custom Integration for Midea Group(Hualing, Senville, Klimaire, AirCon, Century, Pridiom, Thermocore, Comfee, Toshiba, Carrier, Goodman, Friedrich, Samsung, Kenmore, Trane, Lennox, LG and much more) Air Conditioners via LAN.
MIT License
519 stars 101 forks source link

Only report supported operational and swing modes #165

Closed mill1000 closed 2 years ago

mill1000 commented 2 years ago

Only report supported operational and swing modes to HA. Requires mac-zhou/midea-msmart#80

mill1000 commented 2 years ago

Closes #159

rubin110 commented 2 years ago

Hello. I would like to test this but I'm not sure what's the proper procedure for moving from using the release HACS integration, to testing out a branch? Should I just remove the HACS or is there a more elegant way of doing it?

rubin110 commented 2 years ago

I might be doing this wrong.

  1. Grabbed the branch for msmart
  2. Used msmart to generate a new token and key.
  3. Commented out the config from configuration.yaml
  4. Removed the HACS integration
  5. Deleted the old climate entity
  6. Restarted HA
  7. Grabbed the branch for midea-ac-py
  8. Copied midea_ac to custom_components
  9. Uncommented out the config lines
  10. Added in the new token and key
  11. Restarted HA

This is what I got in the logs:

2022-07-08 10:37:33 ERROR (MainThread) [homeassistant.components.climate] Error while setting up midea_ac platform for climate
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/midea_ac/climate.py", line 95, in async_setup_platform
    await hass.async_add_executor_job(device.get_capabilities)
AttributeError: 'air_conditioning' object has no attribute 'get_capabilities'
mill1000 commented 2 years ago

Hi,

How are you running HA? Docker, HA OS, bare metal?

Based on the error message it appears that HA is pickup up the old version of msmart. When you grabbed the msmart branch did you install it?

Otherwise it looks like you installed midea-ac-py correctly. Just an FYI, there is no need to change the token and key, those values should be constant.

rubin110 commented 2 years ago

HA docker

Ah ok I think I understand. For some reason I thought that midea-msmart just provides the standalone tool to grab the token and key. Does setting up via HACS auto install midea-msmart somewhere? I'm not sure where to clone that repo out. Thank you.

mill1000 commented 2 years ago

Yes I think HA normally takes care of the dependencies for you, but you'll have to install mac-zhou/midea-msmart#80 manually.

You can use the following command to get a bash terminal in your container. Replace CONTAINER_ID with your HA container (probably homeassistant)

docker exec -it CONTAINER_ID bash

And then use pip to install directly from Git. Here I'm install directly from my branch because it appears pip can't install from a PR.

pip install git+https://github.com/mill1000/midea-msmart.git@feature/capabilities
rubin110 commented 1 year ago

Just wanted to update that I haven't had a free moment to test out this branch again, sorry about that.

mill1000 commented 1 year ago

No worries. This PR was merged to master but there have been some gotchas due to broken dependencies. #183