home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.49k stars 30.33k forks source link

No valid unit for entity #115659

Closed duracellkonijn22 closed 4 months ago

duracellkonijn22 commented 6 months ago

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[bot] commented 6 months ago

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 commented 6 months ago

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

Cereal2nd commented 5 months ago

from what version did you upgrade?

as i thought i fixed this a couple of months ago

kristofbriers commented 5 months ago

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 commented 5 months ago

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 commented 5 months ago

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

Cereal2nd commented 5 months ago

i need to investigate ...

but that will be half may at the earliest

kristofbriers commented 5 months ago

Oke, thanks in advance!

On Fri, 3 May 2024 at 08:15, Maikel Punie @.***> wrote:

i need to investigate ...

but that will be half may at the earliest

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/115659#issuecomment-2092371986, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIFV7UGZPTQT6PACF73SJ7LZAMTPXAVCNFSM6AAAAABGH6QRZCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJSGM3TCOJYGY . You are receiving this because you commented.Message ID: @.***>

duracellkonijn22 commented 4 months ago

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 commented 4 months ago

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_eagertask( 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 commented 4 months ago

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

Cereal2nd commented 4 months ago

not the coming weeks.

the earliest will be by the end of the month

kristofbriers commented 4 months ago

@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 commented 4 months ago

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

Cereal2nd commented 4 months ago

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

so i doubt this will fix everything

kristofbriers commented 4 months ago

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 commented 4 months ago

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

Cereal2nd commented 4 months ago

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 commented 4 months ago

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_eagertask( 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(

kristofbriers commented 3 months ago

@Cereal2nd

I updated to 2024.6.4 on my test environment and it works again! When I updated my production I first had some trouble but when I deleted the velbus hub and added it again it all works at the moment.

duracellkonijn22 commented 3 months ago

I can also confirm that this issue has been solved here in 2024.6.4.

Thanks!