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

Home Assistant Core 2023.5 breaks integration #157

Open
pascaltippelt opened this issue May 7, 2023 · 16 comments
Open

Home Assistant Core 2023.5 breaks integration #157

pascaltippelt opened this issue May 7, 2023 · 16 comments

Comments

@pascaltippelt
Copy link

pascaltippelt commented May 7, 2023

When upgrading from 2023.4.X to 2023.5.X, the integration does no longer load. Error message:

Logger: homeassistant.setup
Source: setup.py:214
First occurred: 11:26:57 (1 occurrences)
Last logged: 11:26:57
Setup failed for custom integration ecowitt: Unable to import component: cannot import name 'async_get_registry' from 'homeassistant.helpers.entity_registry' (/usr/src/homeassistant/homeassistant/helpers/entity_registry.py)

It is impossible to delete the integration (in my case nothing happens an the integration just stays "active"). So the repository can't be removed.

Possebly relatet log-entrys:

2023-05-07 11:30:29.774 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request
resp = await request_handler(request)
File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle
resp = await handler(request)
File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 85, in security_filter_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 235, in auth_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 146, in handle
result = await result
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 86, in delete
result = await hass.config_entries.async_remove(entry_id)
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1072, in async_remove
await entry.async_remove(self.hass)
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 578, in async_remove
component = integration.get_component()
File "/usr/src/homeassistant/homeassistant/loader.py", line 813, in get_component
ComponentProtocol, importlib.import_module(self.pkg_path)
File "/usr/local/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/config/custom_components/ecowitt/init.py", line 20, in
from homeassistant.helpers.entity_registry import (
ImportError: cannot import name 'async_get_registry' from 'homeassistant.helpers.entity_registry' (/usr/src/homeassistant/homeassistant/helpers/entity_registry.py)

grafik

My device:

WS2900_V2.01.18
von ecowitt
Firmware: EasyWeatherV1.6.4

@JohnMcLear
Copy link

see #155

duplicate plz close

@Jonvelle53
Copy link

I have the same! Any idea - how can I delete the integration?

@pascaltippelt
Copy link
Author

see #155

duplicate plz close

Not entirely. I additionally informed, that I am unable to remove the integration.

@CamFlyerCH
Copy link

Same here. I renamed and labeled many sensors. So I have to do that all again !?! I would very much like a fix for anyone using this integration !

@ronjtaylor
Copy link

same here.
Logger: homeassistant
Source: components/sensor/init.py:583
First occurred: May 7, 2023 at 5:38:18 AM (14248 occurrences)
Last logged: 6:21:48 AM

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 579, in state
numerical_value = int(value)
ValueError: invalid literal for int() with base 10: 'unknown'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 572, in async_update_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 649, in _async_write_ha_state
state = self._stringify_state(available)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 591, in _stringify_state
if (state := self.state) is None:
File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 583, in state
raise ValueError(
ValueError: Sensor sensor.pm2_5_2_battery has device class battery, state class measurement unit % and suggested precision None thus indicating it has a numeric value; however, it has the non-numeric value: unknown (<class 'str'>)

@CountOlaf87
Copy link

Same here, I removed it and when I try to add the integration again, I get: Config flow could not be loaded: {"message":"Invalid handler specified"}

Error log:
ERROR (MainThread) [homeassistant.config_entries] Error occurred loading flow for integration ecowitt: cannot import name 'async_get_registry' from 'homeassistant.helpers.entity_registry' (/usr/src/homeassistant/homeassistant/helpers/entity_registry.py)

@romainlouvet
Copy link

Same and I am not able to remove this integration 😔

@rpajik
Copy link

rpajik commented May 16, 2023

Same and I am not able to remove this integration 😔
Downgrade HA on version 2023.4, it will start working and you will be able to remove it.

@RXM307
Copy link

RXM307 commented May 25, 2023

you can try my fork it is still working in 2023.5
https://github.com/RXM307/homeassistant_ecowitt
however I believe Ecowitt is now part of homeassistant core https://github.com/home-assistant/core/tree/dev/homeassistant/components/ecowitt

I haven't tried it myself but have been meaning too

@pilehave
Copy link

you can try my fork it is still working in 2023.5 https://github.com/RXM307/homeassistant_ecowitt however I believe Ecowitt is now part of homeassistant core https://github.com/home-assistant/core/tree/dev/homeassistant/components/ecowitt

I haven't tried it myself but have been meaning too

I can't get the official integration to work. Never had problems with the HACS one and the whole webhook thing has me puzzled as to why it is needed.

@JohnMcLear
Copy link

I gave up with the official integration and reverted back to HACS as the official integration doesn't support Official Home Assistant Hardware / OS.

@pilehave
Copy link

Same thing here. The official integration requires all kinds of reverse proxy if you use https and offers nothing that is not in the HACS version.

@rbauman70
Copy link

Yeah, I guess getting the integration into the core adds more requirements, like maybe not using private listening ports. Anyway, I put in a feature request that would solve the problem. And I have a workaround for using the new core integration. Probably a way to do it with Python also.

@RXM307
Copy link

RXM307 commented Jun 14, 2023 via email

@rbauman70
Copy link

Since we seem to have lost the author's support, maybe we can revert the core's implementation back to the private port method then? Can you merge your fork?

@iNaiks
Copy link

iNaiks commented Jul 19, 2023

This Worked for me, only need to change 2 lines in the .py of ecowitt and works.
Link --> #155 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests