homeassistant-midea-dehumidifier icon indicating copy to clipboard operation
homeassistant-midea-dehumidifier copied to clipboard

Not compatible with HA 2024.1.0

Open YahyaAlfayad opened this issue 1 year ago • 42 comments

After updating to HA 2024.1.0, the midea-dehumidifier component stopped working with the following log message:

Error while setting up midea_dehumidifier platform for humidifier
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 368, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 752, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1278, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 941, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1062, in _async_write_ha_state
    state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1001, in __async_calculate_state
    attr.update(self.state_attributes or {})
                ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/humidifier/__init__.py", line 217, in state_attributes
    if HumidifierEntityFeature.MODES in self.supported_features:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: argument of type 'int' is not iterable

YahyaAlfayad avatar Jan 04 '24 18:01 YahyaAlfayad

It's not being maintained anymore for a while unfortunately

cannondale0815 avatar Jan 05 '24 01:01 cannondale0815

I made the modifications to work with HA2024.1.0. I don't think they will accept to merge my changes in their branch soon, so, if you're interested, just ping me to make it work back.

fabrizioromanelli avatar Jan 05 '24 10:01 fabrizioromanelli

I made the modifications to work with HA2024.1.0. I don't think they will accept to merge my changes in their branch soon, so, if you're interested, just ping me to make it work back.

Hello, do you have a solution?

pinterd avatar Jan 05 '24 13:01 pinterd

I made the modifications to work with HA2024.1.0. I don't think they will accept to merge my changes in their branch soon, so, if you're interested, just ping me to make it work back.

Hello, do you have a solution?

Yes, just go to the forked project in my GitHub: https://github.com/fabrizioromanelli/homeassistant-midea-dehumidifier And replace humidifier.py and sensor.py in your home assistant installation with the ones provided on my page, restart HA and it'll work!

fabrizioromanelli avatar Jan 05 '24 13:01 fabrizioromanelli

I made the modifications to work with HA2024.1.0. I don't think they will accept to merge my changes in their branch soon, so, if you're interested, just ping me to make it work back.

Hello, do you have a solution?

Yes, just go to the forked project in my GitHub: https://github.com/fabrizioromanelli/homeassistant-midea-dehumidifier And replace humidifier.py and sensor.py in your home assistant installation with the ones provided on my page, restart HA and it'll work!

Thank you very much, I will try it this weekend

pinterd avatar Jan 05 '24 13:01 pinterd

I made the modifications to work with HA2024.1.0. I don't think they will accept to merge my changes in their branch soon, so, if you're interested, just ping me to make it work back.

Hello, do you have a solution?

Yes, just go to the forked project in my GitHub: https://github.com/fabrizioromanelli/homeassistant-midea-dehumidifier And replace humidifier.py and sensor.py in your home assistant installation with the ones provided on my page, restart HA and it'll work!

Thank you very much, I will try it this weekend

Ok, just let me know if it's working as it works on my system

fabrizioromanelli avatar Jan 05 '24 14:01 fabrizioromanelli

@fabrizioromanelli , I've just copied your fix and it works! Thanks a lot!

YahyaAlfayad avatar Jan 05 '24 15:01 YahyaAlfayad

FYI, HA 2024.1.1 fixed the backwards compatibility for humidifier supported_features

YahyaAlfayad avatar Jan 05 '24 17:01 YahyaAlfayad

FYI, HA 2024.1.1 fixed the backwards compatibility for humidifier supported_features

Yes, I tested it but it didn't solve the problem, so the only way is to use the fixes I suggested.

fabrizioromanelli avatar Jan 05 '24 18:01 fabrizioromanelli

Hi all, I created release v1.04 by including changes from @fabrizioromanelli (grazie Fabrizio!) Please provide feedbacks that this new release works as expected.

barban-dev avatar Jan 05 '24 18:01 barban-dev

Hi all, I created release v1.04 by including changes from @fabrizioromanelli (grazie Fabrizio!) Please provide feedbacks that this new release works as expected.

Great @barban-dev! Thanks a lot. I didn't make a pull request as I thought your repo was not updated anymore! 😅

fabrizioromanelli avatar Jan 05 '24 18:01 fabrizioromanelli

Hi all, I created release v1.04 by including changes from @fabrizioromanelli (grazie Fabrizio!) Please provide feedbacks that this new release works as expected.

Great @barban-dev! Thanks a lot. I didn't make a pull request as I thought your repo was not updated anymore! 😅 I am trying to maintain the repo at least in a working state: pull requests are welcome!. BR

barban-dev avatar Jan 05 '24 19:01 barban-dev

Hi, my ha notify me 2024.1.1 version and when i installed It the integrations starts againt to work.

After this ha notify me the 1.04 version and i installed It too but now i get errors and the integrations doesnt work anymore:

`Logger: homeassistant.loader Source: loader.py:842 First occurred: 5 gennaio 2024 alle ore 22:32:03 (2 occurrences) Last logged: 5 gennaio 2024 alle ore 22:32:03

Unexpected exception importing platform custom_components.midea_dehumidifier.sensor Unexpected exception importing platform custom_components.midea_dehumidifier.humidifier Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/loader.py", line 842, in get_platform cache[full_name] = self._import_platform(platform_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/loader.py", line 859, in _import_platform return importlib.import_module(f"{self.pkg_path}.{platform_name}") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1204, in _gcd_import File "", line 1176, in _find_and_load File "", line 1147, in _find_and_load_unlocked File "", line 690, in _load_unlocked File "", line 936, in exec_module File "", line 1074, in get_code File "", line 1004, in source_to_code File "", line 241, in _call_with_frames_removed File "/config/custom_components/midea_dehumidifier/sensor.py", line 54 self._device_class = SensorDeviceClass.HUMIDITY ^ TabError: inconsistent use of tabs and spaces in indentation `

5a2v0 avatar Jan 06 '24 07:01 5a2v0

Also

Logger: homeassistant.loader Source: loader.py:842 First occurred: 17:54:13 (2 occurrences) Last logged: 17:54:14

Unexpected exception importing platform custom_components.midea_dehumidifier.humidifier Unexpected exception importing platform custom_components.midea_dehumidifier.sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/loader.py", line 842, in get_platform cache[full_name] = self._import_platform(platform_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/loader.py", line 859, in _import_platform return importlib.import_module(f"{self.pkg_path}.{platform_name}") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1204, in _gcd_import File "", line 1176, in _find_and_load File "", line 1147, in _find_and_load_unlocked File "", line 690, in _load_unlocked File "", line 936, in exec_module File "", line 1074, in get_code File "", line 1004, in source_to_code File "", line 241, in _call_with_frames_removed File "/config/custom_components/midea_dehumidifier/humidifier.py", line 187 self._device_class = HumidifierDeviceClass.DEHUMIDIFIER ^ TabError: inconsistent use of tabs and spaces in indentation

ptgomes avatar Jan 06 '24 18:01 ptgomes

Also

Logger: homeassistant.loader Source: loader.py:842 First occurred: 17:54:13 (2 occurrences) Last logged: 17:54:14

Unexpected exception importing platform custom_components.midea_dehumidifier.humidifier Unexpected exception importing platform custom_components.midea_dehumidifier.sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/loader.py", line 842, in get_platform cache[full_name] = self._import_platform(platform_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/loader.py", line 859, in _import_platform return importlib.import_module(f"{self.pkg_path}.{platform_name}") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1204, in _gcd_import File "", line 1176, in _find_and_load File "", line 1147, in _find_and_load_unlocked File "", line 690, in _load_unlocked File "", line 936, in exec_module File "", line 1074, in get_code File "", line 1004, in source_to_code File "", line 241, in _call_with_frames_removed File "/config/custom_components/midea_dehumidifier/humidifier.py", line 187 self._device_class = HumidifierDeviceClass.DEHUMIDIFIER ^ TabError: inconsistent use of tabs and spaces in indentation

I did two Pull Request that correct this errore and the one that i reported in the post above. I tested It on my ha with success

5a2v0 avatar Jan 06 '24 18:01 5a2v0

It stopped working when i updated the integration on hacs. What else its needed?

ptgomes avatar Jan 06 '24 18:01 ptgomes

Also Logger: homeassistant.loader Source: loader.py:842 First occurred: 17:54:13 (2 occurrences) Last logged: 17:54:14 Unexpected exception importing platform custom_components.midea_dehumidifier.humidifier Unexpected exception importing platform custom_components.midea_dehumidifier.sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/loader.py", line 842, in get_platform cache[full_name] = self._import_platform(platform_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/loader.py", line 859, in _import_platform return importlib.import_module(f"{self.pkg_path}.{platform_name}") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1204, in _gcd_import File "", line 1176, in _find_and_load File "", line 1147, in _find_and_load_unlocked File "", line 690, in _load_unlocked File "", line 936, in exec_module File "", line 1074, in get_code File "", line 1004, in source_to_code File "", line 241, in _call_with_frames_removed File "/config/custom_components/midea_dehumidifier/humidifier.py", line 187 self._device_class = HumidifierDeviceClass.DEHUMIDIFIER ^ TabError: inconsistent use of tabs and spaces in indentation

I did two Pull Request that correct this errore and the one that i reported in the post above. I tested It on my ha with success

Merged: please try v1.04 patched release

barban-dev avatar Jan 06 '24 18:01 barban-dev

I've replaced humidifier.py and sensor.py. No joy. I can edit the ion, fan and modes: image

Logger: homeassistant.loader Source: loader.py:842 First occurred: 17:38:04 (2 occurrences) Last logged: 17:38:06

Unexpected exception importing platform custom_components.midea_dehumidifier.sensor Unexpected exception importing platform custom_components.midea_dehumidifier.humidifier Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/loader.py", line 842, in get_platform cache[full_name] = self._import_platform(platform_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/loader.py", line 859, in _import_platform return importlib.import_module(f"{self.pkg_path}.{platform_name}") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1204, in _gcd_import File "", line 1176, in _find_and_load File "", line 1147, in _find_and_load_unlocked File "", line 690, in _load_unlocked File "", line 936, in exec_module File "", line 1074, in get_code File "", line 1004, in source_to_code File "", line 241, in _call_with_frames_removed File "/config/custom_components/midea_dehumidifier/sensor.py", line 102 homeassistant-midea-dehumidifier/custom_components/midea_dehumidifier/sensor.py at master · barban-dev/homeassistant-midea-dehumidifier · GitHub ^ SyntaxError: invalid character '·' (U+00B7)

ptgomes avatar Jan 07 '24 17:01 ptgomes

Running the latested version 1.04 from HACS on Core 2024.1.2, Supervisor 2023.12.0, Operating System 11.3:

Screenshot 2024-01-07 215541

Screenshot 2024-01-07 215118

 Logger: homeassistant.setup
Source: setup.py:403
First occurred: 21:49:37 (2 occurrences)
Last logged: 21:49:40

    Unable to prepare setup for platform 'midea_dehumidifier.sensor': Platform not found (Exception importing custom_components.midea_dehumidifier.sensor).
    Unable to prepare setup for platform 'midea_dehumidifier.humidifier': Platform not found (Exception importing custom_components.midea_dehumidifier.humidifier).
Logger: homeassistant.loader
Source: loader.py:842
First occurred: 21:49:37 (2 occurrences)
Last logged: 21:49:40

    Unexpected exception importing platform custom_components.midea_dehumidifier.sensor
    Unexpected exception importing platform custom_components.midea_dehumidifier.humidifier

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 842, in get_platform
    cache[full_name] = self._import_platform(platform_name)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 859, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 936, in exec_module
  File "<frozen importlib._bootstrap_external>", line 1074, in get_code
  File "<frozen importlib._bootstrap_external>", line 1004, in source_to_code
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/config/custom_components/midea_dehumidifier/sensor.py", line 54
    	self._device_class = SensorDeviceClass.HUMIDITY
    ^
TabError: inconsistent use of tabs and spaces in indentation

leowinterde avatar Jan 07 '24 20:01 leowinterde

I made the modifications to work with HA2024.1.0. I don't think they will accept to merge my changes in their branch soon, so, if you're interested, just ping me to make it work back.

Hello, do you have a solution?

Yes, just go to the forked project in my GitHub: https://github.com/fabrizioromanelli/homeassistant-midea-dehumidifier And replace humidifier.py and sensor.py in your home assistant installation with the ones provided on my page, restart HA and it'll work!

In my installation (VM) it works properly!!!

THX!!!

shvirik avatar Jan 10 '24 08:01 shvirik

I made the modifications to work with HA2024.1.0. I don't think they will accept to merge my changes in their branch soon, so, if you're interested, just ping me to make it work back.

Hello, do you have a solution?

Yes, just go to the forked project in my GitHub: https://github.com/fabrizioromanelli/homeassistant-midea-dehumidifier And replace humidifier.py and sensor.py in your home assistant installation with the ones provided on my page, restart HA and it'll work!

In my installation (VM) it works properly!!!

THX!!!

Just did that and it doesnt work...

ptgomes avatar Jan 10 '24 08:01 ptgomes

I made the modifications to work with HA2024.1.0. I don't think they will accept to merge my changes in their branch soon, so, if you're interested, just ping me to make it work back.

Hello, do you have a solution?

Yes, just go to the forked project in my GitHub: https://github.com/fabrizioromanelli/homeassistant-midea-dehumidifier And replace humidifier.py and sensor.py in your home assistant installation with the ones provided on my page, restart HA and it'll work!

that works mille grazie

domerich avatar Jan 12 '24 12:01 domerich

I made the modifications to work with HA2024.1.0. I don't think they will accept to merge my changes in their branch soon, so, if you're interested, just ping me to make it work back.

Hello, do you have a solution?

Yes, just go to the forked project in my GitHub: https://github.com/fabrizioromanelli/homeassistant-midea-dehumidifier And replace humidifier.py and sensor.py in your home assistant installation with the ones provided on my page, restart HA and it'll work!

that works mille grazie

Cant understand why i can get it to work. Please check off any thing is wrong:

  1. Went to the link and downloaded humidifier.py and sensor.py
  2. Via samba (on Windows), copied over on my HA installation. (I noticed that new files are much bigger than the original ones)
  3. Restarted HA

ptgomes avatar Jan 12 '24 12:01 ptgomes

I made the modifications to work with HA2024.1.0. I don't think they will accept to merge my changes in their branch soon, so, if you're interested, just ping me to make it work back.

Hello, do you have a solution?

Yes, just go to the forked project in my GitHub: https://github.com/fabrizioromanelli/homeassistant-midea-dehumidifier And replace humidifier.py and sensor.py in your home assistant installation with the ones provided on my page, restart HA and it'll work!

that works mille grazie

Cant understand why i can get it to work. Please check off any thing is wrong:

  1. Went to the link and downloaded humidifier.py and sensor.py
  2. Via samba (on Windows), copied over on my HA installation. (I noticed that new files are much bigger than the original ones)
  3. Restarted HA

Maybe delete all the hacks files and entities and start over. I just used the integration for the first time and with the two new files it worked

domerich avatar Jan 12 '24 12:01 domerich

What hack integration haver you installed?

A sexta, 12/01/2024, 12:34, domerich @.***> escreveu:

I made the modifications to work with HA2024.1.0. I don't think they will accept to merge my changes in their branch soon, so, if you're interested, just ping me to make it work back.

Hello, do you have a solution?

Yes, just go to the forked project in my GitHub: https://github.com/fabrizioromanelli/homeassistant-midea-dehumidifier And replace humidifier.py and sensor.py in your home assistant installation with the ones provided on my page, restart HA and it'll work!

that works mille grazie

Cant understand why i can get it to work. Please check off any thing is wrong:

  1. Went to the link and downloaded humidifier.py and sensor.py
  2. Via samba (on Windows), copied over on my HA installation. (I noticed that new files are much bigger than the original ones)
  3. Restarted HA

Maybe delete all the hacks files and entities and start over. I just used the integration for the first time and with the two new files it worked

— Reply to this email directly, view it on GitHub https://github.com/barban-dev/homeassistant-midea-dehumidifier/issues/64#issuecomment-1889066559, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHMT4SO6UCDZYHIDWH5U7KTYOEUT5AVCNFSM6AAAAABBNK65L6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBZGA3DMNJVHE . You are receiving this because you commented.Message ID: @.*** com>

ptgomes avatar Jan 12 '24 12:01 ptgomes

I made the modifications to work with HA2024.1.0. I don't think they will accept to merge my changes in their branch soon, so, if you're interested, just ping me to make it work back.

Hello, do you have a solution?

Yes, just go to the forked project in my GitHub: https://github.com/fabrizioromanelli/homeassistant-midea-dehumidifier And replace humidifier.py and sensor.py in your home assistant installation with the ones provided on my page, restart HA and it'll work!

that works mille grazie

Cant understand why i can get it to work. Please check off any thing is wrong:

  1. Went to the link and downloaded humidifier.py and sensor.py
  2. Via samba (on Windows), copied over on my HA installation. (I noticed that new files are much bigger than the original ones)
  3. Restarted HA

Maybe delete all the hacks files and entities and start over. I just used the integration for the first time and with the two new files it worked

Deleted integration and entities. Replaced the 2 files. Still isnt working...

ptgomes avatar Jan 12 '24 13:01 ptgomes

Solved it! Installed EVA II PRO WiFi Midea Inventor Dehumidifier custom integration V2. And there is no need to replace the 2 files

ptgomes avatar Jan 12 '24 13:01 ptgomes

Solved it! Installed EVA II PRO WiFi Midea Inventor Dehumidifier custom integration V2. And there is no need to replace the 2 files

Where/How to get "V2". I could find only latest 1.4.

MrTom1 avatar Jan 12 '24 16:01 MrTom1

Solved it! Installed EVA II PRO WiFi Midea Inventor Dehumidifier custom integration V2. And there is no need to replace the 2 files

Where/How to get "V2". I could find only latest 1.4.

Uploading Screenshot_20240113_172439_Home Assistant.jpg…

ptgomes avatar Jan 13 '24 17:01 ptgomes

I've the same problem as @LeoWinterDE mentioned:

Unable to prepare setup for platform 'midea_dehumidifier.sensor': Platform not found (Exception importing custom_components.midea_dehumidifier.sensor). Unable to prepare setup for platform 'midea_dehumidifier.humidifier': Platform not found (Exception importing custom_components.midea_dehumidifier.humidifier).

@ptgomes your screenshot isn't working, where did you find the "V2"?

friimaind avatar Jan 14 '24 12:01 friimaind