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

Detected blocking call to open inside the event loop #135

Closed
OzGav opened this issue May 30, 2024 · 33 comments
Closed

Detected blocking call to open inside the event loop #135

OzGav opened this issue May 30, 2024 · 33 comments

Comments

@OzGav
Copy link

OzGav commented May 30, 2024

Warning in log starting with HA 2024.6.0b1

Detected blocking call to open inside the event loop by custom integration 'watchman' at custom_components/watchman/utils.py, line 258: for i, line in enumerate(open(yaml_file, encoding="utf-8")): (offender: /config/custom_components/watchman/utils.py, line 258: for i, line in enumerate(open(yaml_file, encoding="utf-8")):), please create a bug report at https://github.com/dummylabs/thewatchman/issues

@asucrews
Copy link

asucrews commented Jun 4, 2024

to add more details, HA 2024.6 adds a check for this type of file I/O happening in the event loop.

Detected blocking call to open inside the event loop by custom integration 'watchman' at custom_components/watchman/utils.py, line 258: for i, line in enumerate(open(yaml_file, encoding="utf-8")): (offender: /config/custom_components/watchman/utils.py, line 258: for i, line in enumerate(open(yaml_file, encoding="utf-8")):), please create a bug report at https://github.com/dummylabs/thewatchman/issues 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 188, 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/runner.py", line 164, in setup_and_run_hass return await hass.async_run() File "/usr/src/homeassistant/homeassistant/core.py", line 515, in async_run await self.async_start() File "/usr/src/homeassistant/homeassistant/core.py", line 568, in async_start self.bus.async_fire_internal(EVENT_HOMEASSISTANT_STARTED) File "/usr/src/homeassistant/homeassistant/core.py", line 1554, in async_fire_internal self._hass.async_run_hass_job(job, event) File "/usr/src/homeassistant/homeassistant/core.py", line 936, in async_run_hass_job hassjob.target(*args) File "/usr/src/homeassistant/homeassistant/core.py", line 1418, in call self.hass.async_run_hass_job(self.listener_job, event) File "/usr/src/homeassistant/homeassistant/core.py", line 939, in async_run_hass_job return self._async_add_hass_job(hassjob, *args, background=background) File "/usr/src/homeassistant/homeassistant/core.py", line 748, in async_add_hass_job task = 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 "/config/custom_components/watchman/init.py", line 274, in async_on_home_assistant_started parse_config(hass, reason="HA restart") File "/config/custom_components/watchman/init.py", line 351, in parse_config entity_list, service_list, files_parsed, files_ignored = parse( File "/config/custom_components/watchman/utils.py", line 258, in parse for i, line in enumerate(open(yaml_file, encoding="utf-8")):

@KruseLuds
Copy link

KruseLuds commented Jun 6, 2024

I am running into what I believe is the same issue. I had to actually disable the integration as this specific long section of messages keep appearing endlessly in my syslog - and also includes the statement "please create a bug report at https://github.com/dummylabs/thewatchman/issues":

Jun 6 12:19:53 kruse-pi homeassistant[1536]: #33[33m2024-06-06 12:19:53.589 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to open inside the event loop by custom integration 'watchman' at custom_components/watchman/utils.py, line 258: for i, line in enumerate(open(yaml_file, encoding="utf-8")): (offender: /config/custom_components/watchman/utils.py, line 258: for i, line in enumerate(open(yaml_file, encoding="utf-8")):), please create a bug report at https://github.com/dummylabs/thewatchman/issues
Jun 6 12:19:53 kruse-pi homeassistant[1536]: Traceback (most recent call last):
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "", line 198, in _run_module_as_main
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "", line 88, in _run_code
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/src/homeassistant/homeassistant/main.py", line 223, in
Jun 6 12:19:53 kruse-pi homeassistant[1536]: sys.exit(main())
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/src/homeassistant/homeassistant/main.py", line 209, in main
Jun 6 12:19:53 kruse-pi homeassistant[1536]: exit_code = runner.run(runtime_conf)
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/src/homeassistant/homeassistant/runner.py", line 190, in run
Jun 6 12:19:53 kruse-pi homeassistant[1536]: return loop.run_until_complete(setup_and_run_hass(runtime_config))
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/local/lib/python3.12/asyncio/base_events.py", line 672, in run_until_complete
Jun 6 12:19:53 kruse-pi homeassistant[1536]: self.run_forever()
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/local/lib/python3.12/asyncio/base_events.py", line 639, in run_forever
Jun 6 12:19:53 kruse-pi homeassistant[1536]: self._run_once()
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1988, in _run_once
Jun 6 12:19:53 kruse-pi homeassistant[1536]: handle._run()
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
Jun 6 12:19:53 kruse-pi homeassistant[1536]: self._context.run(self._callback, *self._args)
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request
Jun 6 12:19:53 kruse-pi homeassistant[1536]: resp = await request_handler(request)
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in handle
Jun 6 12:19:53 kruse-pi homeassistant[1536]: resp = await handler(request)
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl
Jun 6 12:19:53 kruse-pi homeassistant[1536]: return await handler(request)
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware
Jun 6 12:19:53 kruse-pi homeassistant[1536]: return await handler(request)
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware
Jun 6 12:19:53 kruse-pi homeassistant[1536]: return await handler(request)
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware
Jun 6 12:19:53 kruse-pi homeassistant[1536]: return await handler(request)
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 85, in ban_middleware
Jun 6 12:19:53 kruse-pi homeassistant[1536]: return await handler(request)
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware
Jun 6 12:19:53 kruse-pi homeassistant[1536]: return await handler(request)
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware
Jun 6 12:19:53 kruse-pi homeassistant[1536]: response = await handler(request)
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle
Jun 6 12:19:53 kruse-pi homeassistant[1536]: result = await handler(request, **request.match_info)
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 81, in with_admin
Jun 6 12:19:53 kruse-pi homeassistant[1536]: return await func(self, request, *args, **kwargs)
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/src/homeassistant/homeassistant/components/config/view.py", line 130, in post
Jun 6 12:19:53 kruse-pi homeassistant[1536]: hass.async_create_task(
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/src/homeassistant/homeassistant/core.py", line 806, in async_create_task
Jun 6 12:19:53 kruse-pi homeassistant[1536]: return self.async_create_task_internal(target, name, eager_start)
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/src/homeassistant/homeassistant/core.py", line 828, in async_create_task_internal
Jun 6 12:19:53 kruse-pi homeassistant[1536]: task = create_eager_task(target, name=name, loop=self.loop)
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/src/homeassistant/homeassistant/util/async
.py", line 37, in create_eager_task
Jun 6 12:19:53 kruse-pi homeassistant[1536]: return Task(coro, loop=loop, name=name, eager_start=True)
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/src/homeassistant/homeassistant/components/config/script.py", line 28, in hook
Jun 6 12:19:53 kruse-pi homeassistant[1536]: await hass.services.async_call(DOMAIN, SERVICE_RELOAD)
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/src/homeassistant/homeassistant/core.py", line 2722, in async_call
Jun 6 12:19:53 kruse-pi homeassistant[1536]: self._hass.bus.async_fire_internal(
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/src/homeassistant/homeassistant/core.py", line 1554, in async_fire_internal
Jun 6 12:19:53 kruse-pi homeassistant[1536]: self._hass.async_run_hass_job(job, event)
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/src/homeassistant/homeassistant/core.py", line 939, in async_run_hass_job
Jun 6 12:19:53 kruse-pi homeassistant[1536]: return self._async_add_hass_job(hassjob, *args, background=background)
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/src/homeassistant/homeassistant/core.py", line 748, in async_add_hass_job
Jun 6 12:19:53 kruse-pi homeassistant[1536]: task = create_eager_task(
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/src/homeassistant/homeassistant/util/async
.py", line 37, in create_eager_task
Jun 6 12:19:53 kruse-pi homeassistant[1536]: return Task(coro, loop=loop, name=name, eager_start=True)
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/config/custom_components/watchman/init.py", line 287, in async_on_configuration_changed
Jun 6 12:19:53 kruse-pi homeassistant[1536]: parse_config(hass, reason="configuration changes")
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/config/custom_components/watchman/init.py", line 351, in parse_config
Jun 6 12:19:53 kruse-pi homeassistant[1536]: entity_list, service_list, files_parsed, files_ignored = parse(
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/config/custom_components/watchman/utils.py", line 258, in parse
Jun 6 12:19:53 kruse-pi homeassistant[1536]: for i, line in enumerate(open(yaml_file, encoding="utf-8")):
Jun 6 12:19:53 kruse-pi homeassistant[1536]: #33[0m
Jun 6 12:19:53 kruse-pi homeassistant[1536]: #33[33m2024-06-06 12:19:53.602 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to open inside the event loop by custom integration 'watchman' at custom_components/watchman/utils.py, line 258: for i, line in enumerate(open(yaml_file, encoding="utf-8")): (offender: /config/custom_components/watchman/utils.py, line 258: for i, line in enumerate(open(yaml_file, encoding="utf-8")):), please create a bug report at https://github.com/dummylabs/thewatchman/issues
Jun 6 12:19:53 kruse-pi homeassistant[1536]: Traceback (most recent call last):
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "", line 198, in _run_module_as_main
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "", line 88, in _run_code
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/src/homeassistant/homeassistant/main.py", line 223, in
Jun 6 12:19:53 kruse-pi homeassistant[1536]: sys.exit(main())
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/src/homeassistant/homeassistant/main.py", line 209, in main
Jun 6 12:19:53 kruse-pi homeassistant[1536]: exit_code = runner.run(runtime_conf)
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/src/homeassistant/homeassistant/runner.py", line 190, in run
Jun 6 12:19:53 kruse-pi homeassistant[1536]: return loop.run_until_complete(setup_and_run_hass(runtime_config))
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/local/lib/python3.12/asyncio/base_events.py", line 672, in run_until_complete
Jun 6 12:19:53 kruse-pi homeassistant[1536]: self.run_forever()
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/local/lib/python3.12/asyncio/base_events.py", line 639, in run_forever
Jun 6 12:19:53 kruse-pi homeassistant[1536]: self._run_once()
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1988, in _run_once
Jun 6 12:19:53 kruse-pi homeassistant[1536]: handle._run()
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
Jun 6 12:19:53 kruse-pi homeassistant[1536]: self._context.run(self._callback, *self._args)
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request
Jun 6 12:19:53 kruse-pi homeassistant[1536]: resp = await request_handler(request)
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in handle
Jun 6 12:19:53 kruse-pi homeassistant[1536]: resp = await handler(request)
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl
Jun 6 12:19:53 kruse-pi homeassistant[1536]: return await handler(request)
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware
Jun 6 12:19:53 kruse-pi homeassistant[1536]: return await handler(request)
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware
Jun 6 12:19:53 kruse-pi homeassistant[1536]: return await handler(request)
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware
Jun 6 12:19:53 kruse-pi homeassistant[1536]: return await handler(request)
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 85, in ban_middleware
Jun 6 12:19:53 kruse-pi homeassistant[1536]: return await handler(request)
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware
Jun 6 12:19:53 kruse-pi homeassistant[1536]: return await handler(request)
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware
Jun 6 12:19:53 kruse-pi homeassistant[1536]: response = await handler(request)
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle
Jun 6 12:19:53 kruse-pi homeassistant[1536]: result = await handler(request, **request.match_info)
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 81, in with_admin
Jun 6 12:19:53 kruse-pi homeassistant[1536]: return await func(self, request, *args, **kwargs)
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/src/homeassistant/homeassistant/components/config/view.py", line 130, in post
Jun 6 12:19:53 kruse-pi homeassistant[1536]: hass.async_create_task(
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/src/homeassistant/homeassistant/core.py", line 806, in async_create_task
Jun 6 12:19:53 kruse-pi homeassistant[1536]: return self.async_create_task_internal(target, name, eager_start)
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/src/homeassistant/homeassistant/core.py", line 828, in async_create_task_internal
Jun 6 12:19:53 kruse-pi homeassistant[1536]: task = create_eager_task(target, name=name, loop=self.loop)
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/src/homeassistant/homeassistant/util/async
.py", line 37, in create_eager_task
Jun 6 12:19:53 kruse-pi homeassistant[1536]: return Task(coro, loop=loop, name=name, eager_start=True)
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/src/homeassistant/homeassistant/components/config/script.py", line 28, in hook
Jun 6 12:19:53 kruse-pi homeassistant[1536]: await hass.services.async_call(DOMAIN, SERVICE_RELOAD)
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/src/homeassistant/homeassistant/core.py", line 2722, in async_call
Jun 6 12:19:53 kruse-pi homeassistant[1536]: self._hass.bus.async_fire_internal(
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/src/homeassistant/homeassistant/core.py", line 1554, in async_fire_internal
Jun 6 12:19:53 kruse-pi homeassistant[1536]: self._hass.async_run_hass_job(job, event)
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/src/homeassistant/homeassistant/core.py", line 939, in async_run_hass_job
Jun 6 12:19:53 kruse-pi homeassistant[1536]: return self._async_add_hass_job(hassjob, *args, background=background)
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/src/homeassistant/homeassistant/core.py", line 748, in async_add_hass_job
Jun 6 12:19:53 kruse-pi homeassistant[1536]: task = create_eager_task(
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/usr/src/homeassistant/homeassistant/util/async
.py", line 37, in create_eager_task
Jun 6 12:19:53 kruse-pi homeassistant[1536]: return Task(coro, loop=loop, name=name, eager_start=True)
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/config/custom_components/watchman/init.py", line 287, in async_on_configuration_changed
Jun 6 12:19:53 kruse-pi homeassistant[1536]: parse_config(hass, reason="configuration changes")
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/config/custom_components/watchman/init.py", line 351, in parse_config
Jun 6 12:19:53 kruse-pi homeassistant[1536]: entity_list, service_list, files_parsed, files_ignored = parse(
Jun 6 12:19:53 kruse-pi homeassistant[1536]: File "/config/custom_components/watchman/utils.py", line 258, in parse
Jun 6 12:19:53 kruse-pi homeassistant[1536]: for i, line in enumerate(open(yaml_file, encoding="utf-8")):
Jun 6 12:19:53 kruse-pi homeassistant[1536]: #33[0m

@johntdyer
Copy link

So i'm a little worried about this, the owner of this repo has basically no commit history this year and is the only contributor .... Even if a PR was opened with a fix do we think it will be merged?

@andreasbrett
Copy link

Maybe it's the perfect moment for a fork that addresses some of the issues and takes care of some PRs.

@andreasbrett
Copy link

andreasbrett commented Jun 6, 2024

@Mariusthvdb @OzGav @asucrews @johntdyer I think about creating a maintained fork of this repo. Not introducing lots of new features but rather taking care of due maintenance, small fixes and ensuring it works with the next versions of HA. There's no activity in here and as @johntdyer already pointed out: this might be a sinking ship. Would be great if we could maintain that ship until maybe @dummylabs re-surfaces and takes over again.

Since I don't want to end like @dummylabs and have to do it all alone and you've either contributed to this project or commented and seem to have dev and/or tech backgrounds: would anybody like to join me in realizing this?

@asucrews
Copy link

asucrews commented Jun 6, 2024

@andreasbrett not 100% sure what i can do, but i am willing to help out

@OzGav
Copy link
Author

OzGav commented Jun 6, 2024

Sorry I am unable to commit to helping as I am busy on other projects.

@andreasbrett
Copy link

I just released a beta over on my fork. It fixes this issue. Could you please test it in your HA installations? Find the installation instructions in README and in HACS don't forget to enable "show beta versions".

https://github.com/andreasbrett/thewatchman/releases/tag/v0.6.2-beta0

@jhemak
Copy link

jhemak commented Jun 8, 2024

Sees to be fixed for me using your beta. Great work!

@AnthonyBe
Copy link

I've also replaced the old version with your form beta 0.6.2 beta0 and it's working perfectly! Thanks @andreasbrett !

@Mariusthvdb
Copy link
Contributor

Mariusthvdb commented Jun 8, 2024

Thanks for picking this up! I’ll surely test drive.

having said that, I am surprised I dit see these loggings…
I did add the line to the manifest some iterations ago forcing to be correctly using HA internals but other than that, I have not a single issue with the original.

let me check more and I’ll report back

edit

I see I didnt have that anymore at all, simply have the manifest:

{
  "domain": "watchman",
  "name": "Watchman",
  "documentation": "https://github.com/dummylabs/thewatchman",
  "issue_tracker": "https://github.com/dummylabs/thewatchman/issues",
  "iot_class": "local_push",
  "version": "0.5.1",
  "requirements": [
    "prettytable==3.0.0"
  ],
  "codeowners": [
    "@dummylabs"
  ],
  "config_flow": true
}

not sure why I dont get the errors mentioned above in that case....

@alexsaas
Copy link

Hey @Mariusthvdb could you explain which line you added where?
I'm a bit confused, the manifest looks the same in my installation, like in your example.

@Mariusthvdb
Copy link
Contributor

Correct, as I stated above. It is no longer there.
Core HA now forces Custom components to use the guarded system, except when they bail out in the manifest.

@alexsaas
Copy link

Correct, as I stated above. It is no longer there.

Core HA now forces Custom components to use the guarded system, except when they bail out in the manifest.

Thank you very much for your feedback. Unfortunately, I'm not good enough to understand everything. I don't have core 2024.6.0 or higher installed yet.

Is there anything I can or must do to avoid getting the error later after the core update?

@Mariusthvdb
Copy link
Contributor

Mariusthvdb commented Jun 10, 2024

Tbh: I am not the expert here. Important thing is that

Import executor is on by default now so they don’t need to add that anymore

you could check at discord dev channel ask around.
BDraco is the expert on the matter, maybe catch him in the release community post

@RK62
Copy link

RK62 commented Jun 10, 2024

I just released a beta over on my fork. It fixes this issue. Could you please test it in your HA installations? Find the installation instructions in README and in HACS don't forget to enable "show beta versions".

@andreasbrett I try your beta 0.6.2 beta0 and it's working great on two systems with HA 2024.6.1 Thank you!

@popy2k14
Copy link

@andreasbrett Tried your 0.6.2 beta0 and it fixed the issue for me.
thx a lot for keeping the MUST HAVE integration alive!

PS.: I wonder why this integration is not a standard one.

@alexsaas
Copy link

alexsaas commented Jun 12, 2024

Tbh: I am not the expert here. Important thing is that

Import executor is on by default now so they don’t need to add that anymore

you could check at discord dev channel ask around.

BDraco is the expert on the matter, maybe catch him in the release community post

Thank you for your response. Maybe I'll just wait a bit. @andreasbrett seems to be on the right track.

Edit:

Furthermore, I am even less of an expert. I am a simple user. And somewhat overwhelmed by the problem.

@gcoan
Copy link

gcoan commented Jun 18, 2024

Thanks @andreasbrett I swapped from dummylabs' version to your fork and installed the 0.6.2 beta0 and it fixed the issue for me.

Steps I followed to move to the new version:

  • In HACS, click on thewatchman, three dots in top corner, Remove
  • Warning about the integration is configured, click Ignore
  • (HACS now has forgotten about the integration but it still remains in HA)
  • In HACS, three dots, custom repositories, add https://github.com/andreasbrett/thewatchman
  • Click thewatchman, Download (actually I ticked beta version and selected the beta)
  • Restart HA

No reconfiguration required and all working fine

@teskanoo
Copy link

Thank you @andreasbrett for the update to this repo and to @gcoan for the update instructions.

I am using the new (experimental) HACS user interface.

In order to obtain the 0.6.2 beta0 version, I had to 'redownload' the after initially switching to the new repository.

'redownload' gave me the option to enable beta versions and to select 0.6.2 beta0 version

@cbhiii
Copy link

cbhiii commented Jun 19, 2024 via email

@dummylabs
Copy link
Owner

Hey @andreasbrett, thank you for your efforts. Hopefully, I’m getting back on track and am ready to maintain this repo. Could you please create a pull request for your fix so that I can incorporate it?

@ncd7
Copy link

ncd7 commented Jun 19, 2024

@dummylabs - thanks for coming back!
You can probably just diff his fork and pick up all the updates in case @andreasbrett doesn't get back to you soon

@dummylabs
Copy link
Owner

Yep, just wanted to have proper attribution in the code. Anyway, I really appreciate the valuable contribution of @andreasbrett and other guys. Thank you!

@andreasbrett
Copy link

Hey @andreasbrett, thank you for your efforts. Hopefully, I’m getting back on track and am ready to maintain this repo. Could you please create a pull request for your fix so that I can incorporate it?

I just created the PR for the "blocking call" fix.

@dummylabs
Copy link
Owner

For some strange reason, I couldn’t run it in the devcontainer with HA version 2024.6.0 because of an error message: "No module named ‘aiofiles’". However, adding it to the manifest file solved the problem. I’ll continue testing tomorrow.

dummylabs added a commit that referenced this issue Jun 21, 2024
@dummylabs
Copy link
Owner

Fix is in the main branch (available in HACS as beta). The new version will be published soon.

@dummylabs
Copy link
Owner

Should be fixed in 0.6.2.

@popy2k14
Copy link

thx, for keeping the original watchman repo alive!
PS.: any chance to see this in the core?

@dummylabs
Copy link
Owner

dummylabs commented Jun 27, 2024

any chance to see this in the core?

Don’t believe it’s ready yet. I see several areas for improvement in how watchman should function, particularly:

  1. The standard configuration popup feels too cramped for the numerous configuration options. Having a dedicated panel for configuration (and perhaps reporting) would be beneficial. Every time I attempt to add a new config option, I encounter this issue. However, this requires frontend programming skills, which I don't have at the moment.
  2. The concept of storing a large amount of data in sensor attributes (even though it was an experiment to support custom Lovelace cards). Perhaps creating a separate entity for each detected problem would be a better approach. This would ensure that watchman findings are compatible with most Lovelace cards out of the box. The "repairs" feature is another option here to consider.

@Mariusthvdb
Copy link
Contributor

Mariusthvdb commented Jun 27, 2024

well, if anything, I find the current install working very nicely! and I dread the moment you would change to creating repairs for each file Watchman finds..... maybe per category, but not per file, that would be not be a nice user experience at all, aas Ive seen moments in the config where over 70 or so files where either not used or missing etc etc....

this is one of those very useful components that probably will never be in core, so if you ask me, dont strive for that at all. Just make it better!

thanks for doing so!

btw a FR (will open a separate) would be to add a service to update the readings, (not create a report but actually a rerun of the component) after one has made changes on the config/yaml/recorder etc etc.

we now have to reload the integration, which is not very UI friendly. Seems also not to be reliable, because after commenting an offender, it is still reported after the reload of the integration. but that is per design:

By default, watchman's sensors are updated by homeassistant_started event.

I would just like to add a button in the Dashboard and click that ;-) Additional to the default.....

@dummylabs
Copy link
Owner

dummylabs commented Jun 27, 2024

Thank you for your kind words!

we now have to reload the integration, which is not very UI friendly
actually a rerun of the component

Watchman listens to several events in Home Assistant and should automatically update its sensors when Home Assistant starts and when configuration parts gets reloaded via UI (YAML configuration reloading). I will check it out, may be things have changed since this feature was released.

@Mariusthvdb
Copy link
Contributor

Sure.

please also see if you can add functionality for changing recorded entities filters.

thats when I noticed .

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

Successfully merging a pull request may close this issue.