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

No valid unit for entity #115659

Closed
duracellkonijn22 opened this issue Apr 15, 2024 · 19 comments · Fixed by #118091
Closed

No valid unit for entity #115659

duracellkonijn22 opened this issue Apr 15, 2024 · 19 comments · Fixed by #118091

Comments

@duracellkonijn22
Copy link

The problem

Receiving the following errors: 2024-04-15 21:21:49.908 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.so1_afname (<class 'homeassistant.components.velbus.sensor.VelbusSensor'>) is using native unit of measurement 'None' which is not a valid unit for the device class ('power') it is using; expected one of ['W', 'kW']; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+velbus%22

After recent update.

What version of Home Assistant Core has the issue?

2024.4.3

What was the last working version of Home Assistant Core?

core_2024.3.0

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Velbus

Link to integration documentation on our website

https://www.home-assistant.io/integrations/velbus/#:~:text=Example%20automation-,The%20Velbus%20integration,a%20device%20or%20a%20service.

Diagnostics information

See error above

Example YAML snippet

2024-04-15 21:21:49.930 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.statistics_solar_production (<class 'homeassistant.components.template.sensor.SensorTemplate'>) is using native unit of measurement 'kWh' which is not a valid unit for the device class ('power') it is using; expected one of ['W', 'kW']; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+template%22
2024-04-15 21:25:10.308 WARNING (Recorder) [homeassistant.components.sensor.recorder] The unit of sensor.so1_afname (None) cannot be converted to the unit of previously compiled statistics (W). Generation of long term statistics will be suppressed unless the unit changes back to W or a compatible unit. Go to https://my.home-assistant.io/redirect/developer_statistics to fix this
2024-04-15 21:25:10.308 WARNING (Recorder) [homeassistant.components.sensor.recorder] The unit of sensor.so1_afname_counter (None) cannot be converted to the unit of previously compiled statistics (kWh). Generation of long term statistics will be suppressed unless the unit changes back to kWh or a compatible unit. Go to https://my.home-assistant.io/redirect/developer_statistics to fix this
2024-04-15 21:25:10.308 WARNING (Recorder) [homeassistant.components.sensor.recorder] The unit of sensor.so1_afname1 (None) cannot be converted to the unit of previously compiled statistics (W). Generation of long term statistics will be suppressed unless the unit changes back to W or a compatible unit. Go to https://my.home-assistant.io/redirect/developer_statistics to fix this
2024-04-15 21:25:10.308 WARNING (Recorder) [homeassistant.components.sensor.recorder] The unit of sensor.so1_afname1_counter (None) cannot be converted to the unit of previously compiled statistics (kWh). Generation of long term statistics will be suppressed unless the unit changes back to kWh or a compatible unit. Go to https://my.home-assistant.io/redirect/developer_statistics to fix this
2024-04-15 21:25:10.308 WARNING (Recorder) [homeassistant.components.sensor.recorder] The unit of sensor.so2_injectie (None) cannot be converted to the unit of previously compiled statistics (W). Generation of long term statistics will be suppressed unless the unit changes back to W or a compatible unit. Go to https://my.home-assistant.io/redirect/developer_statistics to fix this
2024-04-15 21:25:10.308 WARNING (Recorder) [homeassistant.components.sensor.recorder] The unit of sensor.so2_injectie_counter (None) cannot be converted to the unit of previously compiled statistics (kWh). Generation of long term statistics will be suppressed unless the unit changes back to kWh or a compatible unit. Go to https://my.home-assistant.io/redirect/developer_statistics to fix this
2024-04-15 21:25:10.308 WARNING (Recorder) [homeassistant.components.sensor.recorder] The unit of sensor.so2_injectie1 (None) cannot be converted to the unit of previously compiled statistics (W). Generation of long term statistics will be suppressed unless the unit changes back to W or a compatible unit. Go to https://my.home-assistant.io/redirect/developer_statistics to fix this
2024-04-15 21:25:10.308 WARNING (Recorder) [homeassistant.components.sensor.recorder] The unit of sensor.so2_injectie1_counter (None) cannot be converted to the unit of previously compiled statistics (kWh). Generation of long term statistics will be suppressed unless the unit changes back to kWh or a compatible unit. Go to https://my.home-assistant.io/redirect/developer_statistics to fix this

Anything in the logs that might be useful for us?

No response

Additional information

No response

@home-assistant
Copy link

Hey there @Cereal2nd, @brefra, mind taking a look at this issue as it has been labeled with an integration (velbus) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of velbus can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign velbus Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


velbus documentation
velbus source
(message by IssueLinks)

@duracellkonijn22
Copy link
Author

FYI: turned back to the snapshot of my virtual machine (before update)

@Cereal2nd
Copy link
Contributor

from what version did you upgrade?

as i thought i fixed this a couple of months ago

@kristofbriers
Copy link

I have the same issue.
This screenshot is in version 2024.4.4
image

And this one is in version 2024.4.1
image

@kristofbriers
Copy link

When I remove the velbus entity and add it again it works. When I reboot HA it stops working. I can see in the diagnostics file that something as changed.
Before the reboot:
image
config_entry-velbus-7554e35c23b9ed00b05786197624fb67.json
This is the correct config.
But after the restart of HA:
image
velbus-3bdfd78aed38c65742be9a60c230c68e-Input1 (VMB7IN)-1a9a19e34021f386ca17e95895c2b5f8.json

So somewhere it removes the "unit" line

home-assistant_2024-04-24T13-26-23.538Z.log

@kristofbriers
Copy link

@Cereal2nd Is there something i'm doing wrong? I can't figure out why the unit config keeps disappearing...

@Cereal2nd
Copy link
Contributor

i need to investigate ...

but that will be half may at the earliest

@kristofbriers
Copy link

kristofbriers commented May 3, 2024 via email

@duracellkonijn22
Copy link
Author

Opening the topic again.

Just updated Home Assistant again with the following values:
Core 2024.5.5
Supervisor 2024.05.1
Operating System 12.3
Frontend 20240501.1

Again same notification in error log:
ValueError: Sensor sensor.statistics_daily_power_output_solaredge has device class 'energy', state class 'total' unit 'kWh' and suggested precision 'None' thus indicating it has a numeric value; however, it has the non-numeric value: 'states('sensor.solaredge_ac_power_output')' (<class 'str'>)
2024-06-05 20:55:31.888 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.statistics_solar_production (<class 'homeassistant.components.template.sensor.SensorTemplate'>) is using native unit of measurement 'kWh' which is not a valid unit for the device class ('power') it is using; expected one of ['W', 'kW']; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+template%22
2024-06-05 20:55:31.897 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'hacs' accesses hass.helpers.event. This is deprecated and will stop working in Home Assistant 2024.11, it should be updated to import functions used from event directly at custom_components/hacs/base.py, line 623: self.hass.helpers.event.async_track_time_interval(, please create a bug report at https://github.com/hacs/integration/issues
2024-06-05 21:00:10.391 WARNING (Recorder) [homeassistant.components.sensor.recorder] The unit of sensor.so1_afname (None) cannot be converted to the unit of previously compiled statistics (W). Generation of long term statistics will be suppressed unless the unit changes back to W or a compatible unit. Go to https://my.home-assistant.io/redirect/developer_statistics to fix this
2024-06-05 21:00:10.392 WARNING (Recorder) [homeassistant.components.sensor.recorder] The unit of sensor.so1_afname_counter (None) cannot be converted to the unit of previously compiled statistics (kWh). Generation of long term statistics will be suppressed unless the unit changes back to kWh or a compatible unit. Go to https://my.home-assistant.io/redirect/developer_statistics to fix this
2024-06-05 21:00:10.392 WARNING (Recorder) [homeassistant.components.sensor.recorder] The unit of sensor.so1_afname1 (None) cannot be converted to the unit of previously compiled statistics (W). Generation of long term statistics will be suppressed unless the unit changes back to W or a compatible unit. Go to https://my.home-assistant.io/redirect/developer_statistics to fix this
2024-06-05 21:00:10.392 WARNING (Recorder) [homeassistant.components.sensor.recorder] The unit of sensor.so1_afname1_counter (None) cannot be converted to the unit of previously compiled statistics (kWh). Generation of long term statistics will be suppressed unless the unit changes back to kWh or a compatible unit. Go to https://my.home-assistant.io/redirect/developer_statistics to fix this
2024-06-05 21:00:10.393 WARNING (Recorder) [homeassistant.components.sensor.recorder] The unit of sensor.so2_injectie (None) cannot be converted to the unit of previously compiled statistics (W). Generation of long term statistics will be suppressed unless the unit changes back to W or a compatible unit. Go to https://my.home-assistant.io/redirect/developer_statistics to fix this
2024-06-05 21:00:10.393 WARNING (Recorder) [homeassistant.components.sensor.recorder] The unit of sensor.so2_injectie_counter (None) cannot be converted to the unit of previously compiled statistics (kWh). Generation of long term statistics will be suppressed unless the unit changes back to kWh or a compatible unit. Go to https://my.home-assistant.io/redirect/developer_statistics to fix this
2024-06-05 21:00:10.393 WARNING (Recorder) [homeassistant.components.sensor.recorder] The unit of sensor.so2_injectie1 (None) cannot be converted to the unit of previously compiled statistics (W). Generation of long term statistics will be suppressed unless the unit changes back to W or a compatible unit. Go to https://my.home-assistant.io/redirect/developer_statistics to fix this
2024-06-05 21:00:10.393 WARNING (Recorder) [homeassistant.components.sensor.recorder] The unit of sensor.so2_injectie1_counter (None) cannot be converted to the unit of previously compiled statistics (kWh). Generation of long term statistics will be suppressed unless the unit changes back to kWh or a compatible unit. Go to https://my.home-assistant.io/redirect/developer_statistics to fix this

@kristofbriers
Copy link

kristofbriers commented Jun 5, 2024

Also still have issues with VMB7IN. Still not showing power output..
image

Logfile:
Logger: homeassistant.util.loop
Source: util/loop.py:84
First occurred: 10:02:54 AM (4 occurrences)
Last logged: 10:34:41 AM

Detected blocking call to open inside the event loop by integration 'velbus' at homeassistant/components/velbus/init.py, line 74: controller = Velbus( (offender: /usr/local/lib/python3.12/site-packages/velbusaio/handler.py, line 40: with open(), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+velbus%22 Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/usr/src/homeassistant/homeassistant/main.py", line 223, in sys.exit(main()) File "/usr/src/homeassistant/homeassistant/main.py", line 209, in main exit_code = runner.run(runtime_conf) File "/usr/src/homeassistant/homeassistant/runner.py", line 190, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) File "/usr/local/lib/python3.12/asyncio/base_events.py", line 672, in run_until_complete self.run_forever() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 639, in run_forever self._run_once() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1988, in _run_once handle._run() File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run self._context.run(self._callback, *self._args) File "/usr/src/homeassistant/homeassistant/setup.py", line 165, in async_setup_component result = await _async_setup_component(hass, domain, config) File "/usr/src/homeassistant/homeassistant/setup.py", line 447, in async_setup_component await asyncio.gather( File "/usr/src/homeassistant/homeassistant/setup.py", line 449, in create_eager_task( File "/usr/src/homeassistant/homeassistant/util/async.py", line 37, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 742, in async_setup_locked await self.async_setup(hass, integration=integration) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup result = await component.async_setup_entry(hass, self) File "/usr/src/homeassistant/homeassistant/components/velbus/init.py", line 74, in async_setup_entry controller = Velbus(
Detected blocking call to open inside the event loop by integration 'velbus' at homeassistant/components/velbus/init.py, line 74: controller = Velbus( (offender: /usr/local/lib/python3.12/site-packages/velbusaio/handler.py, line 40: with open(), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+velbus%22 Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/usr/src/homeassistant/homeassistant/main.py", line 223, in sys.exit(main()) File "/usr/src/homeassistant/homeassistant/main.py", line 209, in main exit_code = runner.run(runtime_conf) File "/usr/src/homeassistant/homeassistant/runner.py", line 190, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) File "/usr/local/lib/python3.12/asyncio/base_events.py", line 672, in run_until_complete self.run_forever() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 639, in run_forever self._run_once() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1988, in _run_once handle._run() File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run self._context.run(self._callback, *self._args) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in _handle resp = await handler(request) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 85, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware response = await handler(request) File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle result = await handler(request, **request.match_info) File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 120, in post await hass.config_entries.async_reload(entry_id) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1897, in async_reload return await self.async_setup(entry_id, _lock=False) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1821, in async_setup await entry.async_setup(self.hass) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup result = await component.async_setup_entry(hass, self) File "/usr/src/homeassistant/homeassistant/components/velbus/init.py", line 74, in async_setup_entry controller = Velbus(
Detected blocking call to open inside the event loop by integration 'velbus' at homeassistant/components/velbus/config_flow.py, line 37: controller = velbusaio.controller.Velbus(prt) (offender: /usr/local/lib/python3.12/site-packages/velbusaio/handler.py, line 40: with open(), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+velbus%22 Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/usr/src/homeassistant/homeassistant/main.py", line 223, in sys.exit(main()) File "/usr/src/homeassistant/homeassistant/main.py", line 209, in main exit_code = runner.run(runtime_conf) File "/usr/src/homeassistant/homeassistant/runner.py", line 190, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) File "/usr/local/lib/python3.12/asyncio/base_events.py", line 672, in run_until_complete self.run_forever() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 639, in run_forever self._run_once() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1988, in _run_once handle._run() File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run self._context.run(self._callback, *self._args) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in _handle resp = await handler(request) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 85, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware response = await handler(request) File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle result = await handler(request, **request.match_info) File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 81, in with_admin return await func(self, request, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 222, in post return await super().post(request, flow_id) File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 70, in wrapper return await method(view, request, data, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 122, in post result = await self._flow_mgr.async_configure(flow_id, data) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 368, in async_configure result = await self._async_configure(flow_id, user_input) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 414, in _async_configure result = await self._async_handle_step( File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 517, in _async_handle_step result: _FlowResultT = await getattr(flow, method)(user_input) File "/usr/src/homeassistant/homeassistant/components/velbus/config_flow.py", line 54, in async_step_user if await self._test_connection(prt): File "/usr/src/homeassistant/homeassistant/components/velbus/config_flow.py", line 37, in _test_connection controller = velbusaio.controller.Velbus(prt)
Detected blocking call to open inside the event loop by integration 'velbus' at homeassistant/components/velbus/init.py, line 74: controller = Velbus( (offender: /usr/local/lib/python3.12/site-packages/velbusaio/handler.py, line 40: with open(), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+velbus%22 Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/usr/src/homeassistant/homeassistant/main.py", line 223, in sys.exit(main()) File "/usr/src/homeassistant/homeassistant/main.py", line 209, in main exit_code = runner.run(runtime_conf) File "/usr/src/homeassistant/homeassistant/runner.py", line 190, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) File "/usr/local/lib/python3.12/asyncio/base_events.py", line 672, in run_until_complete self.run_forever() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 639, in run_forever self._run_once() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1988, in _run_once handle._run() File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run self._context.run(self._callback, *self._args) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in _handle resp = await handler(request) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 85, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware response = await handler(request) File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle result = await handler(request, **request.match_info) File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 81, in with_admin return await func(self, request, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 222, in post return await super().post(request, flow_id) File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 70, in wrapper return await method(view, request, data, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 122, in post result = await self._flow_mgr.async_configure(flow_id, data) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 368, in async_configure result = await self._async_configure(flow_id, user_input) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 414, in _async_configure result = await self._async_handle_step( File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 572, in _async_handle_step result = await self.async_finish_flow(flow, result.copy()) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1403, in async_finish_flow await self.config_entries.async_add(entry) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1708, in async_add await self.async_setup(entry.entry_id) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1819, in async_setup await entry.async_setup(self.hass) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup result = await component.async_setup_entry(hass, self) File "/usr/src/homeassistant/homeassistant/components/velbus/init.py", line 74, in async_setup_entry controller = Velbus(

I think it is still missing the option enabled : true
image

I checked on version 2024.4.1 and there you can see the following in the debug file:
image

Core
2024.6.0
Supervisor
2024.05.1
Operating System
12.3
Frontend
20240605.0

@kristofbriers
Copy link

@Cereal2nd Can you please take a look at this again?

@Cereal2nd
Copy link
Contributor

not the coming weeks.

the earliest will be by the end of the month

@kristofbriers
Copy link

@Cereal2nd Okido.

Also I found out that if I delete the hub and then add it again it all works again until I restart HomeAssistant..
image

After adding it again:
image
Diagnostics file after adding it again:
velbus-1c057d0e99cd54aa0665fa8855fe7d2f-Input1 (VMB7IN)-1a9a19e34021f386ca17e95895c2b5f8.json

@duracellkonijn22
Copy link
Author

Reverted my snapshot back to waiting for a solution:
Core
2024.3.0
Supervisor
2024.06.0

@Cereal2nd
Copy link
Contributor

this was added to make the counters work again ...

so i doubt this will fix everything

@kristofbriers
Copy link

this was added to make the counters work again ...

so i doubt this will fix everything

You are right. For some reason it just worked one time after a reload of velbus...
I'm not an expert in this, I'm just trying things out :-)

@Cereal2nd
Copy link
Contributor

i think we will need to do something similar as this for the enabled param.

@Cereal2nd
Copy link
Contributor

image

Something like this should do it (i think) the coding is not the work, its the testing that takes 90% of the dev time

@kristofbriers
Copy link

kristofbriers commented Jun 12, 2024

Oke I did some testing with the changed code.

First I removed velbus from HA and then added it again. Then everything works(but that was also before the change)
image
Debug File:
image

Then I restarted HA and then it stops working again
image
Debug file did not change so Unit and enabled are all filled in correctly.

Then I tried to reload the velbus integration and then strange things happen
image

I have 2 VMB7IN modules(both with counters added to them) and after the reload 1 of the 2 works. When I reload again sometimes the other works again but the first ons stops working... And sometimes both off them stop working...
image

This is the error in the system log:
Logger: homeassistant.util.loop
Source: util/loop.py:84
First occurred: 8:02:57 PM (2 occurrences)
Last logged: 8:43:27 PM

Detected blocking call to open inside the event loop by integration 'velbus' at homeassistant/components/velbus/init.py, line 74: controller = Velbus( (offender: /usr/local/lib/python3.12/site-packages/velbusaio/handler.py, line 40: with open(), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+velbus%22 Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/usr/src/homeassistant/homeassistant/main.py", line 223, in sys.exit(main()) File "/usr/src/homeassistant/homeassistant/main.py", line 209, in main exit_code = runner.run(runtime_conf) File "/usr/src/homeassistant/homeassistant/runner.py", line 190, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) File "/usr/local/lib/python3.12/asyncio/base_events.py", line 672, in run_until_complete self.run_forever() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 639, in run_forever self._run_once() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1988, in _run_once handle._run() File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run self._context.run(self._callback, *self._args) File "/usr/src/homeassistant/homeassistant/setup.py", line 165, in async_setup_component result = await _async_setup_component(hass, domain, config) File "/usr/src/homeassistant/homeassistant/setup.py", line 447, in async_setup_component await asyncio.gather( File "/usr/src/homeassistant/homeassistant/setup.py", line 449, in create_eager_task( File "/usr/src/homeassistant/homeassistant/util/async.py", line 37, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 742, in async_setup_locked await self.async_setup(hass, integration=integration) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup result = await component.async_setup_entry(hass, self) File "/usr/src/homeassistant/homeassistant/components/velbus/init.py", line 74, in async_setup_entry controller = Velbus(
Detected blocking call to open inside the event loop by integration 'velbus' at homeassistant/components/velbus/init.py, line 74: controller = Velbus( (offender: /usr/local/lib/python3.12/site-packages/velbusaio/handler.py, line 40: with open(), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+velbus%22 Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/usr/src/homeassistant/homeassistant/main.py", line 223, in sys.exit(main()) File "/usr/src/homeassistant/homeassistant/main.py", line 209, in main exit_code = runner.run(runtime_conf) File "/usr/src/homeassistant/homeassistant/runner.py", line 190, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) File "/usr/local/lib/python3.12/asyncio/base_events.py", line 672, in run_until_complete self.run_forever() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 639, in run_forever self._run_once() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1988, in _run_once handle._run() File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run self._context.run(self._callback, *self._args) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in _handle resp = await handler(request) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 85, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware response = await handler(request) File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle result = await handler(request, **request.match_info) File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 120, in post await hass.config_entries.async_reload(entry_id) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1897, in async_reload return await self.async_setup(entry_id, _lock=False) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1821, in async_setup await entry.async_setup(self.hass) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup result = await component.async_setup_entry(hass, self) File "/usr/src/homeassistant/homeassistant/components/velbus/init.py", line 74, in async_setup_entry controller = Velbus(

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

Successfully merging a pull request may close this issue.

3 participants