Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hass 2024.1 error: Unexpected exception importing platform custom_components.xiaomi_gateway3.climate #1245

Closed
r-jean-pierre opened this issue Dec 28, 2023 · 25 comments · Fixed by #1246
Assignees
Labels
bug Something isn't working
Milestone

Comments

@r-jean-pierre
Copy link

Since the latest core update (2024.1.0b0), I get:

2023-12-28 15:16:01.463 ERROR (MainThread) [homeassistant.loader] Unexpected exception importing platform custom_components.xiaomi_gateway3.climate
2023-12-28 15:16:01.486 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform 'xiaomi_gateway3.climate': Platform not found (Exception importing custom_components.xiaomi_gateway3.climate).

I had no issue before the update (12 different devices working well)

@ghost
Copy link

ghost commented Dec 29, 2023

Same here. Core 2024.1.0b0 - 2024.1.0b2

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

File "/home/homeassistant/.homeassistant/custom_components/xiaomi_gateway3/sensor.py", line 42, in <module> "power": POWER_WATT, ^^^^^^^^^^ NameError: name 'POWER_WATT' is not defined

File "/home/homeassistant/.homeassistant/custom_components/xiaomi_gateway3/climate.py", line 14, in <module> HVAC_MODE_OFF: CURRENT_HVAC_OFF, ^^^^^^^^^^^^^ NameError: name 'HVAC_MODE_OFF' is not defined

@fdmsh
Copy link

fdmsh commented Dec 29, 2023

Logger: homeassistant.setup
Source: setup.py:403
First occurred: 8:22:42 PM (1 occurrences)
Last logged: 8:22:42 PM

Unable to prepare setup for platform 'xiaomi_gateway3.climate': Platform not found (Exception importing custom_components.xiaomi_gateway3.climate).

Logger: homeassistant.loader
Source: loader.py:842
First occurred: 8:22:42 PM (1 occurrences)
Last logged: 8:22:42 PM

Unexpected exception importing platform custom_components.xiaomi_gateway3.climate
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 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "/config/custom_components/xiaomi_gateway3/climate.py", line 14, in
HVAC_MODE_OFF: CURRENT_HVAC_OFF,
^^^^^^^^^^^^^
NameError: name 'HVAC_MODE_OFF' is not defined

@jeremysherriff
Copy link

HA Core 2024.1 is now here and this beta issue is now a reality in prod.

@LeandroIssa
Copy link

Same problem here!

@ErnestoBrandao
Copy link

Same problem

@paulopais
Copy link

Hi, the same problem..

@Lobo2022
Copy link

Lobo2022 commented Jan 4, 2024

Hi, same problem.

@CMGeorge
Copy link

CMGeorge commented Jan 4, 2024

4d92d50

This is fixing the problem for persons who dont want to rollback or wait.

@Chupaka
Copy link

Chupaka commented Jan 4, 2024

To apply #1246 PR quickly, go to your .homeassistant directory and run

curl https://patch-diff.githubusercontent.com/raw/AlexxIT/XiaomiGateway3/pull/1246.patch | git apply --check -v

(to check that everything will be applied successfully) and then

curl https://patch-diff.githubusercontent.com/raw/AlexxIT/XiaomiGateway3/pull/1246.patch | git apply

@ErnestoBrandao
Copy link

for me it does not work :(
Thanks

@Sheredeka
Copy link

for me it does not work :( Thanks

Full restart HA after patch

@ErnestoBrandao
Copy link

Ok my mistake i was outside .homeassistant directory it WORKS
Thanks

@Lobo2022
Copy link

Lobo2022 commented Jan 4, 2024

I applied #1246. It works !

@paulopais
Copy link

Thank you :).. it work

@SK7WALKER
Copy link

how to apply? from file manager? ssh command line? tried from file manager-settings-run shell command- didnt change anything, from ssh i couldnt change directory

@paulopais
Copy link

I did it over ssh , i have haos

@SK7WALKER
Copy link

I did it over ssh , i have haos

how did you change directory?

@paulopais
Copy link

cd homeassistant/
Screenshot_2024-01-04-20-11-50-982_io.homeassistant.companion.android-edit.jpg

@maddoglee
Copy link

maddoglee commented Jan 5, 2024

You forgot to use curl at the beginning of command.

Thanks, For some reason when I pasted into the terminal, it dropped the curl command and added a tilde ~ to the end of it... Hmm probably arising from using a mac... thanks for your quick reply though, I noticed the problem and tried to delete my comment, but you were too quick to reply!

It's all working... My attention to detail is pretty bad.

@fulinsky
Copy link

fulinsky commented Jan 5, 2024

@Chupaka Thank you for sharing!It does work.

@RikardzPT
Copy link

@Chupaka thank you

It works !

@jeremysherriff
Copy link

jeremysherriff commented Jan 5, 2024

The patch has been merged and is available as part of the master branch.

To install it formally, use the "Redownload" option in the 3-dot menu in the HACS web interface:
image

..and choose master (not v3.3.4).
Once downloaded, you will need to restart HA for the changes to take effect.

After restart, you will be prompted about a pending update (to v3.3.4) - do not upgrade until v3.3.5 is released. If further fixes are released in the meantime, just redownload master and restart again.

@ErnestoBrandao
Copy link

"master" asks for update and installs 3.3.4 and the error returns.

@jeremysherriff
Copy link

Sorry, yes that is correct. You should not upgrade.
I have updated my above comment:

After restart, you will be prompted about a pending update (to v3.3.4) - do not upgrade until v3.3.5 is released. If further fixes are released in the meantime, just redownload master and restart again.

@AlexxIT AlexxIT changed the title Unexpected exception importing platform custom_components.xiaomi_gateway3.climate Hass 2024.1 error: Unexpected exception importing platform custom_components.xiaomi_gateway3.climate Jan 5, 2024
@AlexxIT AlexxIT self-assigned this Jan 5, 2024
@AlexxIT
Copy link
Owner

AlexxIT commented Jan 5, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.