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

Platform switch unavailable after every HA Core update #102000

Closed
Taraman17 opened this issue Oct 14, 2023 · 12 comments
Closed

Platform switch unavailable after every HA Core update #102000

Taraman17 opened this issue Oct 14, 2023 · 12 comments

Comments

@Taraman17
Copy link
Contributor

The problem

When I update HA core to a new release, after the restart, All my switches are not working.
I get messaes like "service switch.turn-on is not available". It seems, that the whole switch platform is not available.

After doing a host restart (Raspi 3), everything is back to normal.

Happens after every update. Started sometime earlier this year (about 3-5 months ago)

After the last update today, I restarted, so no logs yet - will provide after the next update.

What version of Home Assistant Core has the issue?

core-2023.10.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

No response

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@home-assistant
Copy link

Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (switch) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of switch 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 switch Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


switch documentation
switch source
(message by IssueLinks)

@Taraman17
Copy link
Contributor Author

Taraman17 commented Oct 23, 2023

Following lines ar in the supervisor log:
23-10-23 18:23:50 ERROR (MainThread) [supervisor.misc.tasks] Watchdog found a problem with Home Assistant API! 23-10-23 18:23:50 ERROR (MainThread) [supervisor.misc.tasks] Home Assistant watchdog reanimation failed! 23-10-23 18:25:50 WARNING (MainThread) [supervisor.misc.tasks] Watchdog miss API response from Home Assistant

Core log is surprisingly short:

2023-10-23 18:26:53.978 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry shellyplug-s-80646F813C58 for shelly
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 399, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/shelly/__init__.py", line 129, in async_setup_entry
    return await _async_setup_block_entry(hass, entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/shelly/__init__.py", line 199, in _async_setup_block_entry
    await _async_block_device_setup()
  File "/usr/src/homeassistant/homeassistant/components/shelly/__init__.py", line 174, in _async_block_device_setup
    await hass.config_entries.async_forward_entry_setups(entry, platforms)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1390, in async_forward_entry_setups
    await asyncio.gather(
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1411, in async_forward_entry_setup
    result = await async_setup_component(self.hass, domain, self._hass_config)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/setup.py", line 95, in async_setup_component
    return await setup_tasks[domain]
           ^^^^^^^^^^^^^^^^^^^^^^^^^
asyncio.exceptions.CancelledError
2023-10-23 18:26:54.122 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry shellyplug-s-80646F817770 for shelly
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 399, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/shelly/__init__.py", line 129, in async_setup_entry
    return await _async_setup_block_entry(hass, entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/shelly/__init__.py", line 199, in _async_setup_block_entry
    await _async_block_device_setup()
  File "/usr/src/homeassistant/homeassistant/components/shelly/__init__.py", line 174, in _async_block_device_setup
    await hass.config_entries.async_forward_entry_setups(entry, platforms)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1390, in async_forward_entry_setups
    await asyncio.gather(
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1411, in async_forward_entry_setup
    result = await async_setup_component(self.hass, domain, self._hass_config)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/setup.py", line 95, in async_setup_component
    return await setup_tasks[domain]
           ^^^^^^^^^^^^^^^^^^^^^^^^^
asyncio.exceptions.CancelledError
2023-10-23 18:26:54.145 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry FRITZ!Repeater 2400 for fritz
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 399, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/fritz/__init__.py", line 57, in async_setup_entry
    await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1390, in async_forward_entry_setups
    await asyncio.gather(
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1411, in async_forward_entry_setup
    result = await async_setup_component(self.hass, domain, self._hass_config)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/setup.py", line 95, in async_setup_component
    return await setup_tasks[domain]
           ^^^^^^^^^^^^^^^^^^^^^^^^^
asyncio.exceptions.CancelledError
2023-10-23 18:26:54.170 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Mosquitto broker for mqtt
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 399, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/mqtt/__init__.py", line 436, in async_setup_entry
    await async_forward_entry_setup_and_setup_discovery(entry, conf)
  File "/usr/src/homeassistant/homeassistant/components/mqtt/__init__.py", line 416, in async_forward_entry_setup_and_setup_discovery
    await asyncio.gather(
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1411, in async_forward_entry_setup
    result = await async_setup_component(self.hass, domain, self._hass_config)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/setup.py", line 95, in async_setup_component
    return await setup_tasks[domain]
           ^^^^^^^^^^^^^^^^^^^^^^^^^
asyncio.exceptions.CancelledError
2023-10-23 18:26:54.197 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry FRITZ!Repeater 2400 for fritz
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 399, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/fritz/__init__.py", line 57, in async_setup_entry
    await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1390, in async_forward_entry_setups
    await asyncio.gather(
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1411, in async_forward_entry_setup
    result = await async_setup_component(self.hass, domain, self._hass_config)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/setup.py", line 95, in async_setup_component
    return await setup_tasks[domain]
           ^^^^^^^^^^^^^^^^^^^^^^^^^
asyncio.exceptions.CancelledError
2023-10-23 18:26:57.092 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Fritz-Adrario for fritz
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 399, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/fritz/__init__.py", line 57, in async_setup_entry
    await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1390, in async_forward_entry_setups
    await asyncio.gather(
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1411, in async_forward_entry_setup
    result = await async_setup_component(self.hass, domain, self._hass_config)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/setup.py", line 95, in async_setup_component
    return await setup_tasks[domain]
           ^^^^^^^^^^^^^^^^^^^^^^^^^
asyncio.exceptions.CancelledError
2023-10-23 18:27:00.936 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: raspberry_pi, sensor.fritz
2023-10-23 18:27:03.103 ERROR (MainThread) [homeassistant.components.rest.data] Error fetching data: https://klosser.duckdns.org:8090/csgoapi/http/v1.0/info/serverInfo failed with [Errno -3] Try again
2023-10-23 18:27:03.104 WARNING (MainThread) [homeassistant.components.rest.util] Empty reply found when expecting JSON data
2023-10-23 18:27:07.084 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform fritz is taking over 10 seconds.
2023-10-23 18:27:53.095 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Raspberry Pi for raspberry_pi
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 399, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/raspberry_pi/__init__.py", line 22, in async_setup_entry
    await hass.config_entries.flow.async_init(
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 872, in async_init
    flow, result = await task
                   ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 890, in _async_init
    flow = await self.async_create_flow(handler, context=context, data=data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 992, in async_create_flow
    handler = await _async_get_flow_handler(
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2088, in _async_get_flow_handler
    await _load_integration(hass, domain, hass_config)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2064, in _load_integration
    await async_process_deps_reqs(hass, hass_config, integration)
  File "/usr/src/homeassistant/homeassistant/setup.py", line 420, in async_process_deps_reqs
    await requirements.async_get_integration_with_requirements(
  File "/usr/src/homeassistant/homeassistant/requirements.py", line 52, in async_get_integration_with_requirements
    return await manager.async_get_integration_with_requirements(domain)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/requirements.py", line 157, in async_get_integration_with_requirements
    await int_or_evt.wait()
  File "/usr/local/lib/python3.11/asyncio/locks.py", line 213, in wait
    await fut
asyncio.exceptions.CancelledError: Global task timeout
2023-10-23 18:27:53.131 WARNING (MainThread) [homeassistant.bootstrap] Setup timed out for stage 2 - moving forward
2023-10-23 18:27:53.416 ERROR (MainThread) [homeassistant.helpers.event] Error while processing template: Template<template=({{ states("sensor.netatmo_regenmesser_rain_today") | float + states("input_number.regenspeicher") | float }}) renders=2>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1925, in forgiving_float_filter
    return float(value)
           ^^^^^^^^^^^^
ValueError: could not convert string to float: 'unavailable'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 568, in async_render
    render_result = _render_with_context(self.template, compiled, **kwargs)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 2196, in _render_with_context
    return template.render(**kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/jinja2/environment.py", line 1301, in render
    self.environment.handle_exception()
  File "/usr/local/lib/python3.11/site-packages/jinja2/environment.py", line 936, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "<template>", line 1, in top-level template code
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1928, in forgiving_float_filter
    raise_no_default("float", value)
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1626, in raise_no_default
    raise ValueError(
ValueError: Template error: float got invalid input 'unavailable' when rendering template '{{ states("sensor.netatmo_regenmesser_rain_today") | float + states("input_number.regenspeicher") | float }}' but no default was specified

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

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 694, in async_render_to_info
    render_info._result = self.async_render(
                          ^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 570, in async_render
    raise TemplateError(err) from err
homeassistant.exceptions.TemplateError: ValueError: Template error: float got invalid input 'unavailable' when rendering template '{{ states("sensor.netatmo_regenmesser_rain_today") | float + states("input_number.regenspeicher") | float }}' but no default was specified
2023-10-23 18:27:53.455 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: float got invalid input 'unavailable' when rendering template '{{ states("sensor.netatmo_regenmesser_rain_today") | float + states("input_number.regenspeicher") | float }}' but no default was specified') while processing template 'Template<template=({{ states("sensor.netatmo_regenmesser_rain_today") | float + states("input_number.regenspeicher") | float }}) renders=4>' for attribute '_attr_native_value' in entity 'sensor.rain_at_six'
2023-10-23 18:27:57.915 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry [email protected] for volvooncall
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 399, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/volvooncall/__init__.py", line 79, in async_setup_entry
    await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1390, in async_forward_entry_setups
    await asyncio.gather(
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1411, in async_forward_entry_setup
    result = await async_setup_component(self.hass, domain, self._hass_config)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/setup.py", line 95, in async_setup_component
    return await setup_tasks[domain]
           ^^^^^^^^^^^^^^^^^^^^^^^^^
asyncio.exceptions.CancelledError

@Taraman17
Copy link
Contributor Author

However for all my switches:
grafik

@joostlek
Copy link
Member

I would think that there is some invalid config in there. Do you run any custom integrations?

@Taraman17
Copy link
Contributor Author

quite a few. How would I find out which one? Trial and error?

@joostlek
Copy link
Member

Does it only happen after update or also after a restart?

@Taraman17
Copy link
Contributor Author

Only after update.
Then, if I restart the whole system everything is back to normal - even after "normal" core restart.

@joostlek
Copy link
Member

Heh, that doesn't make sense. What if you only restart core?

@Taraman17
Copy link
Contributor Author

Hmm, didn't try that in a while - I believe it did not, but not sure anymore.

@Taraman17
Copy link
Contributor Author

Latest update shows the same behaviour, but now without even correctly updating.
After two tries, HA still shows 2023.10.5 I.s.o 2023.11
No error messages on the update in the log and also there does not seem to be a restart in between since the logs date back till after the start of the update.
I'm confused.

@pan123sel
Copy link

pan123sel commented Nov 4, 2023

I am seeing following repeated for sensor and switch.

2023-11-04 09:26:54.606 ERROR (MainThread) [homeassistant.components.binary_sensor] Error adding entities for domain binary_sensor with platform flo Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 614, in _async_add_entity if self.config_entry and (device_info := entity.device_info): ^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/flo/entity.py", line 35, in device_info serial_number=self._device.serial_number, ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/flo/device.py", line 144, in serial_number return self._device_information["serialNumber"] ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^ KeyError: 'serialNumber'

It looks the device no longer provides Serial Number, as Serial Number shows as "Not Available" in the Flo App and debug data has 'serial_number': '',

May be we should switch to Device ID ('macAddress') instead of Serial Number?

Edit: is this the correct thread or should I open a new issue for serial number issue?

@issue-triage-workflows
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@issue-triage-workflows issue-triage-workflows bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 25, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants