Template Code freezes HA - How to investigate?

After some excellent support I received from petro, I started adding markdown cards to my dashhboards with code as such

only after the second card, HA become unresponsive… not only that dashboard, not any other connection to HA on any other device… To the point that I had to physically reboot HA.

If I dont mess with the markdown cards with scripts as above, it all goes fine. So I doubt it is a corrupt SD card issue.

as soon as I touch the markdown scripts, it becomes unresponsive. I gave it ten minutes once, in case my issue was swapping or stg.

i have a raspi3 (I know), which doesnt have a hard disk yet (I know) and about 100 zigbee gadgets and then some. it is time to upgrade. But before I do, I want to understand what is really going on when HA becomes unresponsive. The number of logs overwhelmed me, some logs seem to be cleared on boot which adds to my confusion. I saw in logs that HACS could be causing it. I disabled HACS (rebotted several times) and still, the markdown cards freeze when I start playing with template.

long story short:
i have an anemic HA setup (1GB, Rasp3) and post-beginner number of gadgets.
some template codes, render HA unresponsive (to the point of physical reboot)
it can be an I/O messup on the SD card as far as I know, so much can be going wrong, I dont know where to begin.

A little hand holding possible? I would like to identify the problem.
Best,

Please verify your system is actually unresponsive, not your browser. You can do this by connecting to HA via ssh or samba and looking at the logs.

As for your template, it will update frequently. Especially if you have all entities in areas.

You can force it to only update at most once per minute by changing it to…

{%- for area in areas() | map('area_name') | sort %}
  {%- for e in states | selectattr('entity_id', 'in', area_entities(area)) | selectattr('attributes.device_class', 'defined') | selectattr('attributes.device_class', 'eq', 'temperature') %}
{{ area }} - {{ e.name }}: {{ e.state_with_unit }}
  {%- endfor %}
{%- endfor %}


i opened above dashboard on mac browser. waited for 10 seconds while it loaded.
i opened a new tab (I know :slightly_smiling_face:) and it was unresponsive, as expected (control experiment).
i moved to my iphone and launched HA. it is spinning and spinning… when i try to connect a folder from macos, samba isnt reachable on homeassistant.local. so i think it is the system that becomes unresponsive. while composing, watchdog kicked in, and HA booted.

1- Which log is should be the log to check, there are many logs (components with logs)
2- lack of “expand” is what makes the latest code update every minute? I am missing how you manage the update frequency?

Thanks in advance,

Edit: In the mean time, I wanted to swap the existing code in above dashboard with suggested code above, but by the time i clicked save, HA became unresponsive. so it is going through another reboot cycle. i guess i shouldnt play with the problem dashboard using UI. Its extremely fragile.

HA’s log.

when you access the states object without accessing a domain, templates are automatically throttled to at most 1 update per minute.

1 Like


I have checked all logs, but somehow they all start from the reboot. i cant find the logs of before the crash?

You can access logs before the crash by looking in your config folder for the past log file.

i found /homeassistant/home-assistant.log.1
which seems to be the penultimate log… for some reason earlier crashes arent there, maybe they are purged. anyway, you have opened a window, once again for me. let me experiment some crashes and inspect both /homeassistant/home-assistant.log and /homeassistant/home-assistant.log.1. I will be back with more questions with new insight :slight_smile:

let me roll back here, for a second:

{% set thisList = states.binary_sensor %}

{{thisList|list|count}} binary sensors

{{thisList|selectattr(‘state’, ‘eq’, ‘on’)|list|count}} on

{{thisList|selectattr(‘state’, ‘eq’, ‘on’)| map(attribute=‘name’) | join(',
')}}

{{thisList|selectattr(‘state’, ‘eq’, ‘off’)|list|count}} off

{{thisList|selectattr(‘state’, ‘eq’, ‘off’)| map(attribute=‘name’) | join(',
')}}

this little guy, just tells me which binary sensors are on or off.
but it does access a domain, right? the binary_sensor domain in first line…
does this mean, this little gadget can also be too heavy?

it means that the template will update at most once per second.

sorry, is there throttling when accessing with a domain or without a domain? from your above quote, my understanding was that if i dont use domain, it is throttled. my example was using domain, so it will NOT be throttled, I guess?

When you access the states object (AllStates), there is a 1 minute throttle. When you access the states.<domain> there is a 1 second throttle. When you access an individual entity, there is no throttle.

This is accessing the AllStates states object…

{{ states | .... }}

this is accessing a domain…

{{ states.light | ... }}

This is accessing an single entity

{{ states.light.living_room ... }}
1 Like

The home assistant is definetely crashing, if i wait long enough comes back with watchdog. when i check the logs, there are seemingly different issues. i deleted the toxic dashboard, and now am writing performance aware markdown cards. its still crashing every now and then, but i can work again. thank you.

whats a good suggestion for hardware upgrade? i guess home.assistant.yellow would end all this misery?

2023-12-20 19:53:44.857 WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-12-20 19:53:56.941 WARNING (Recorder) [homeassistant.components.recorder.util] The system could not validate that the sqlite3 database at //config/home-assistant_v2.db was shutdown cleanly
2023-12-20 19:53:57.043 WARNING (Recorder) [homeassistant.components.recorder.util] Ended unfinished session (id=79 from 2023-12-20 18:47:08.285987)
2023-12-20 19:54:26.938 WARNING (MainThread) [hass_nabucasa.cloud_api] Fetched https://alexa-api.nabucasa.com/access_token (400)
2023-12-20 19:54:40.778 WARNING (MainThread) [homeassistant.setup] Setup of input_boolean is taking over 10 seconds.
2023-12-20 19:54:40.779 WARNING (MainThread) [homeassistant.setup] Setup of input_select is taking over 10 seconds.
2023-12-20 19:54:40.779 WARNING (MainThread) [homeassistant.setup] Setup of zone is taking over 10 seconds.
2023-12-20 19:54:40.780 WARNING (MainThread) [homeassistant.setup] Setup of input_button is taking over 10 seconds.
2023-12-20 19:54:40.780 WARNING (MainThread) [homeassistant.setup] Setup of input_number is taking over 10 seconds.
2023-12-20 19:54:40.780 WARNING (MainThread) [homeassistant.setup] Setup of schedule is taking over 10 seconds.
2023-12-20 19:54:40.781 WARNING (MainThread) [homeassistant.setup] Setup of counter is taking over 10 seconds.
2023-12-20 19:54:40.781 WARNING (MainThread) [homeassistant.setup] Setup of input_datetime is taking over 10 seconds.
2023-12-20 19:54:40.784 WARNING (MainThread) [homeassistant.setup] Setup of input_text is taking over 10 seconds.
2023-12-20 19:54:40.785 WARNING (MainThread) [homeassistant.setup] Setup of application_credentials is taking over 10 seconds.
2023-12-20 19:54:40.786 WARNING (MainThread) [homeassistant.setup] Setup of plant is taking over 10 seconds.
2023-12-20 19:55:13.538 ERROR (MainThread) [hass_nabucasa.remote] Connection problem to snitun server (Challenge/Response error with SniTun server (0 bytes read on a total of 32 expected bytes))
2023-12-20 19:55:34.366 WARNING (MainThread) [homeassistant.components.media_player] Setup of media_player platform dlna_dmr is taking over 10 seconds.
2023-12-20 19:55:52.889 WARNING (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0xEF32:1:0x0b04]: async_initialize: all attempts have failed: [DeliveryError(‘Failed to deliver packet: <TXStatus.MAC_NO_ACK: 233>’), DeliveryError(‘Failed to deliver packet: <TXStatus.MAC_NO_ACK: 233>’), DeliveryError(‘Failed to deliver packet: <TXStatus.MAC_NO_ACK: 233>’), DeliveryError(‘Failed to deliver packet: <TXStatus.NWK_ROUTE_DISCOVERY_FAILED: 208>’)]
2023-12-20 19:55:57.370 WARNING (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0xEF32:1:0x0702]: async_initialize: all attempts have failed: [DeliveryError(‘Failed to deliver packet: <TXStatus.MAC_NO_ACK: 233>’), DeliveryError(‘Failed to deliver packet: <TXStatus.MAC_NO_ACK: 233>’), DeliveryError(‘Failed to deliver packet: <TXStatus.MAC_NO_ACK: 233>’), TimeoutError()]
2023-12-20 19:56:02.093 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: apple_tv
2023-12-20 19:56:46.220 WARNING (MainThread) [zigpy_deconz.api] No response to ‘CommandId.aps_data_indication’ command with seq id ‘0x47’
2023-12-20 19:56:57.564 ERROR (MainThread) [pyatv.protocols.airplay] Failed to set up remote control channel
Traceback (most recent call last):
File “/usr/local/lib/python3.11/site-packages/pyatv/protocols/airplay/init.py”, line 348, in _connect_rc
await session.connect()
File “/usr/local/lib/python3.11/site-packages/pyatv/protocols/airplay/ap2_session.py”, line 69, in connect
self.connection = await http_connect(self._address, self._control_port)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/pyatv/support/http.py”, line 653, in http_connect
_, connection = await loop.create_connection(HttpConnection, address, port)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/asyncio/base_events.py”, line 1085, in create_connection
raise exceptions[0]
File “/usr/local/lib/python3.11/asyncio/base_events.py”, line 1069, in create_connection
sock = await self._connect_sock(
^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/asyncio/base_events.py”, line 973, in _connect_sock
await self.sock_connect(sock, address)
File “/usr/local/lib/python3.11/asyncio/selector_events.py”, line 628, in sock_connect
return await fut
^^^^^^^^^
File “/usr/local/lib/python3.11/asyncio/selector_events.py”, line 668, in _sock_connect_cb
raise OSError(err, f’Connect call failed {address}')
TimeoutError: [Errno 110] Connect call failed (‘192.168.178.116’, 7000)
2023-12-20 19:57:02.242 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: apple_tv
2023-12-20 19:57:03.697 ERROR (MainThread) [homeassistant.components.apple_tv] Failed to connect
Traceback (most recent call last):
File “/usr/local/lib/python3.11/site-packages/pyatv/protocols/mrp/protocol.py”, line 275, in _receive
await semaphore.acquire()
File “/usr/local/lib/python3.11/asyncio/locks.py”, line 387, in acquire
await fut
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/components/apple_tv/init.py”, line 227, in connect_once
await self._connect(conf, raise_missing_credentials)
File “/usr/src/homeassistant/homeassistant/components/apple_tv/init.py”, line 329, in _connect
self.atv = await connect(conf, self.hass.loop, session=session)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/pyatv/init.py”, line 155, in connect
await atv.connect()
File “/usr/local/lib/python3.11/site-packages/pyatv/core/facade.py”, line 684, in connect
if await setup_data.connect():
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/pyatv/protocols/mrp/init.py”, line 1092, in _connect
await protocol.start()
File “/usr/local/lib/python3.11/site-packages/pyatv/protocols/mrp/protocol.py”, line 146, in start
self.device_info = await self.send_and_receive(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/pyatv/protocols/mrp/protocol.py”, line 262, in send_and_receive
return await self._receive(identifier, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/pyatv/protocols/mrp/protocol.py”, line 274, in _receive
async with async_timeout.timeout(timeout):
File “/usr/local/lib/python3.11/site-packages/async_timeout/init.py”, line 141, in aexit
self._do_exit(exc_type)
File “/usr/local/lib/python3.11/site-packages/async_timeout/init.py”, line 228, in _do_exit
raise asyncio.TimeoutError
TimeoutError
2023-12-20 19:59:12.740 ERROR (MainThread) [pyatv.protocols.airplay] Failed to set up remote control channel
Traceback (most recent call last):
File “/usr/local/lib/python3.11/site-packages/pyatv/protocols/airplay/init.py”, line 348, in _connect_rc
await session.connect()
File “/usr/local/lib/python3.11/site-packages/pyatv/protocols/airplay/ap2_session.py”, line 69, in connect
self.connection = await http_connect(self._address, self._control_port)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/pyatv/support/http.py”, line 653, in http_connect
_, connection = await loop.create_connection(HttpConnection, address, port)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/asyncio/base_events.py”, line 1085, in create_connection
raise exceptions[0]
File “/usr/local/lib/python3.11/asyncio/base_events.py”, line 1069, in create_connection
sock = await self._connect_sock(
^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/asyncio/base_events.py”, line 973, in _connect_sock
await self.sock_connect(sock, address)
File “/usr/local/lib/python3.11/asyncio/selector_events.py”, line 628, in sock_connect
return await fut
^^^^^^^^^
File “/usr/local/lib/python3.11/asyncio/selector_events.py”, line 668, in _sock_connect_cb
raise OSError(err, f’Connect call failed {address}')
TimeoutError: [Errno 110] Connect call failed (‘192.168.178.116’, 7000)
2023-12-20 19:59:33.103 ERROR (MainThread) [homeassistant.components.apple_tv] Failed to connect
Traceback (most recent call last):
File “/usr/local/lib/python3.11/site-packages/pyatv/protocols/mrp/protocol.py”, line 275, in _receive
await semaphore.acquire()
File “/usr/local/lib/python3.11/asyncio/locks.py”, line 387, in acquire
await fut
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/components/apple_tv/init.py”, line 227, in connect_once
await self._connect(conf, raise_missing_credentials)
File “/usr/src/homeassistant/homeassistant/components/apple_tv/init.py”, line 329, in _connect
self.atv = await connect(conf, self.hass.loop, session=session)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/pyatv/init.py”, line 155, in connect
await atv.connect()
File “/usr/local/lib/python3.11/site-packages/pyatv/core/facade.py”, line 684, in connect
if await setup_data.connect():
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/pyatv/protocols/mrp/init.py”, line 1092, in _connect
await protocol.start()
File “/usr/local/lib/python3.11/site-packages/pyatv/protocols/mrp/protocol.py”, line 146, in start
self.device_info = await self.send_and_receive(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/pyatv/protocols/mrp/protocol.py”, line 262, in send_and_receive
return await self._receive(identifier, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/pyatv/protocols/mrp/protocol.py”, line 274, in _receive
async with async_timeout.timeout(timeout):
File “/usr/local/lib/python3.11/site-packages/async_timeout/init.py”, line 141, in aexit
self._do_exit(exc_type)
File “/usr/local/lib/python3.11/site-packages/async_timeout/init.py”, line 228, in _do_exit
raise asyncio.TimeoutError
TimeoutError
2023-12-20 19:59:50.387 WARNING (MainThread) [zigpy_deconz.api] No response to ‘CommandId.aps_data_indication’ command with seq id ‘0xa8’
2023-12-20 20:00:41.336 WARNING (MainThread) [homeassistant.components.apple_tv] Connection lost to Apple TV “HomePod B”
2023-12-20 20:03:07.732 WARNING (MainThread) [hass_nabucasa.iot] Connection closed: Cannot write to closing transport
2023-12-20 20:03:08.341 ERROR (MainThread) [pyatv.protocols.airplay] Failed to set up remote control channel
Traceback (most recent call last):
File “/usr/local/lib/python3.11/site-packages/pyatv/protocols/airplay/init.py”, line 348, in _connect_rc
await session.connect()
File “/usr/local/lib/python3.11/site-packages/pyatv/protocols/airplay/ap2_session.py”, line 69, in connect
self.connection = await http_connect(self._address, self._control_port)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/pyatv/support/http.py”, line 653, in http_connect
_, connection = await loop.create_connection(HttpConnection, address, port)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/asyncio/base_events.py”, line 1085, in create_connection
raise exceptions[0]
File “/usr/local/lib/python3.11/asyncio/base_events.py”, line 1069, in create_connection
sock = await self._connect_sock(
^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/asyncio/base_events.py”, line 973, in _connect_sock
await self.sock_connect(sock, address)
File “/usr/local/lib/python3.11/asyncio/selector_events.py”, line 628, in sock_connect
return await fut
^^^^^^^^^
File “/usr/local/lib/python3.11/asyncio/selector_events.py”, line 668, in _sock_connect_cb
raise OSError(err, f’Connect call failed {address}‘)
TimeoutError: [Errno 110] Connect call failed (‘192.168.178.116’, 7000)
2023-12-20 20:03:10.576 WARNING (MainThread) [zigpy_deconz.api] No response to ‘CommandId.aps_data_indication’ command with seq id ‘0x75’
2023-12-20 20:03:12.484 WARNING (MainThread) [hass_nabucasa.cloud_api] Fetched https://alexa-api.nabucasa.com/access_token (400)
2023-12-20 20:03:59.348 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.p_tostiplug_power is taking over 10 seconds
2023-12-20 20:03:59.349 WARNING (MainThread) [homeassistant.helpers.entity] Update of media_player.home is taking over 10 seconds
2023-12-20 20:03:59.350 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.p_koray1_power is taking over 10 seconds
2023-12-20 20:03:59.351 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.p_koray1_summation_delivered is taking over 10 seconds
2023-12-20 20:03:59.352 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.p_koray2_power is taking over 10 seconds
2023-12-20 20:03:59.352 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.p_koray2_summation_delivered is taking over 10 seconds
2023-12-20 20:03:59.377 WARNING (MainThread) [zigpy_deconz.api] No response to ‘CommandId.aps_data_indication’ command with seq id ‘0xeb’
2023-12-20 20:04:55.622 WARNING (MainThread) [homeassistant.components.apple_tv] Connection lost to Apple TV “Girl’s Room”
2023-12-20 20:04:56.416 WARNING (MainThread) [homeassistant.helpers.entity] Update of media_player.home is taking over 10 seconds
2023-12-20 20:04:56.453 ERROR (MainThread) [homeassistant.components.homewizard.coordinator] Error fetching homewizard data: Timeout occurred while connecting to the HomeWizard Energy device
2023-12-20 20:04:56.531 WARNING (MainThread) [homeassistant.components.sensor] Updating zha sensor took longer than the scheduled update interval 0:00:30
2023-12-20 20:04:57.301 WARNING (MainThread) [hass_nabucasa.iot] Connection closed: Cannot write to closing transport
2023-12-20 20:04:58.016 WARNING (MainThread) [zigpy_deconz.zigbee.application] Unexpected transmit confirm for request id 52, Status: TXStatus.SUCCESS
2023-12-20 20:04:58.099 WARNING (MainThread) [zigpy_deconz.zigbee.application] Unexpected transmit confirm for request id 54, Status: TXStatus.SUCCESS
2023-12-20 20:04:58.377 WARNING (MainThread) [zigpy_deconz.zigbee.application] Unexpected transmit confirm for request id 56, Status: TXStatus.SUCCESS
2023-12-20 20:05:00.343 WARNING (MainThread) [hass_nabucasa.cloud_api] Fetched https://alexa-api.nabucasa.com/access_token (400)
2023-12-20 20:05:39.352 ERROR (MainThread) [homeassistant.components.apple_tv] Failed to connect
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/components/apple_tv/init.py”, line 227, in connect_once
await self._connect(conf, raise_missing_credentials)
File “/usr/src/homeassistant/homeassistant/components/apple_tv/init.py”, line 329, in _connect
self.atv = await connect(conf, self.hass.loop, session=session)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/pyatv/init.py”, line 155, in connect
await atv.connect()
File “/usr/local/lib/python3.11/site-packages/pyatv/core/facade.py”, line 684, in connect
if await setup_data.connect():
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/pyatv/protocols/mrp/init.py”, line 1092, in _connect
await protocol.start()
File “/usr/local/lib/python3.11/site-packages/pyatv/protocols/mrp/protocol.py”, line 133, in start
await self.connection.connect()
File “/usr/local/lib/python3.11/site-packages/pyatv/protocols/mrp/connection.py”, line 104, in connect
await self.loop.create_connection(lambda: self, self.host, self.port)
File “/usr/local/lib/python3.11/asyncio/base_events.py”, line 1085, in create_connection
raise exceptions[0]
File “/usr/local/lib/python3.11/asyncio/base_events.py”, line 1069, in create_connection
sock = await self._connect_sock(
^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/asyncio/base_events.py”, line 973, in _connect_sock
await self.sock_connect(sock, address)
File “/usr/local/lib/python3.11/asyncio/selector_events.py”, line 628, in sock_connect
return await fut
^^^^^^^^^
File “/usr/local/lib/python3.11/asyncio/selector_events.py”, line 668, in _sock_connect_cb
raise OSError(err, f’Connect call failed {address}’)
TimeoutError: [Errno 110] Connect call failed (‘192.168.178.116’, 7000)
2023-12-20 20:05:39.511 WARNING (MainThread) [homeassistant.components.media_player] Updating samsungtv media_player took longer than the scheduled update interval 0:00:10
2023-12-20 20:06:02.733 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.p_office_power is taking over 10 seconds
2023-12-20 20:06:02.734 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.p_office_summation_delivered is taking over 10 seconds
2023-12-20 20:06:02.734 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.p_kettle_power is taking over 10 seconds
2023-12-20 20:06:02.734 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.p_kettle_summation_delivered is taking over 10 seconds
2023-12-20 20:06:02.735 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.p_tostiplug_power is taking over 10 seconds
2023-12-20 20:06:14.817 ERROR (MainThread) [homeassistant.components.homewizard.coordinator] Error fetching homewizard data: Timeout occurred while connecting to the HomeWizard Energy device
2023-12-20 20:06:15.488 ERROR (MainThread) [homeassistant.components.lyric] Timeout fetching lyric_coordinator data
2023-12-20 20:06:15.708 WARNING (MainThread) [homeassistant.components.sensor] Updating zha sensor took longer than the scheduled update interval 0:00:30
2023-12-20 20:06:15.722 WARNING (MainThread) [homeassistant.components.media_player] Updating samsungtv media_player took longer than the scheduled update interval 0:00:10
2023-12-20 20:07:00.433 ERROR (MainThread) [pyatv.protocols.airplay] Failed to set up remote control channel
Traceback (most recent call last):
File “/usr/local/lib/python3.11/site-packages/pyatv/support/http.py”, line 463, in send_and_receive
await pending_request.event.wait()
File “/usr/local/lib/python3.11/asyncio/locks.py”, line 213, in wait
await fut
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/lib/python3.11/site-packages/pyatv/support/http.py”, line 462, in send_and_receive
async with async_timeout.timeout(timeout):
File “/usr/local/lib/python3.11/site-packages/async_timeout/init.py”, line 141, in aexit
self._do_exit(exc_type)
File “/usr/local/lib/python3.11/site-packages/async_timeout/init.py”, line 228, in _do_exit
raise asyncio.TimeoutError
TimeoutError

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

Traceback (most recent call last):
File “/usr/local/lib/python3.11/site-packages/pyatv/protocols/airplay/init.py”, line 348, in _connect_rc
await session.connect()
File “/usr/local/lib/python3.11/site-packages/pyatv/protocols/airplay/ap2_session.py”, line 70, in connect
self.verifier = await verify_connection(self._credentials, self.connection)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/pyatv/protocols/airplay/auth/init.py”, line 104, in verify_connection
has_encryption_keys = await verifier.verify_credentials()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/pyatv/protocols/airplay/auth/hap_transient.py”, line 57, in verify_credentials
resp = await self.http.post(
^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/pyatv/support/http.py”, line 432, in post
return await self.send_and_receive(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/pyatv/support/http.py”, line 474, in send_and_receive
raise TimeoutError(f"no response to {method} {uri} ({protocol})") from ex
TimeoutError: no response to POST /pair-setup (HTTP/1.1)
2023-12-20 20:07:29.945 WARNING (MainThread) [homeassistant.helpers.entity] Update of media_player.home is taking over 10 seconds
2023-12-20 20:07:29.946 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.p_office_power is taking over 10 seconds
2023-12-20 20:07:29.946 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.p_office_summation_delivered is taking over 10 seconds
2023-12-20 20:07:29.947 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.p_kettle_power is taking over 10 seconds
2023-12-20 20:07:29.947 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.p_kettle_summation_delivered is taking over 10 seconds
2023-12-20 20:07:29.948 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.p_tostiplug_power is taking over 10 seconds
2023-12-20 20:07:30.077 ERROR (MainThread) [homeassistant.components.homewizard.coordinator] Error fetching homewizard data: Timeout occurred while connecting to the HomeWizard Energy device
2023-12-20 20:07:47.543 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback MrpConnection.connection_made(<_SelectorSoc…e, bufsize=0>>)
Traceback (most recent call last):
File “/usr/local/lib/python3.11/asyncio/events.py”, line 80, in _run
self._context.run(self._callback, *self._args)
File “/usr/local/lib/python3.11/site-packages/pyatv/protocols/mrp/connection.py”, line 69, in connection_made
dstaddr, dstport = sock.getpeername()
^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/asyncio/trsock.py”, line 77, in getpeername
return self._sock.getpeername()
^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 107] Socket not connected
2023-12-20 20:08:06.242 WARNING (MainThread) [homeassistant.helpers.entity] Update of media_player.home is taking over 10 seconds
2023-12-20 20:08:06.251 WARNING (MainThread) [pyatv.protocols.mrp.protocol] There were 1 outstanding requests
2023-12-20 20:08:06.341 WARNING (MainThread) [hass_nabucasa.iot] Connection closed: Cannot write to closing transport
2023-12-20 20:08:06.354 WARNING (MainThread) [homeassistant.components.sensor] Updating zha sensor took longer than the scheduled update interval 0:00:30
2023-12-20 20:08:06.433 ERROR (MainThread) [homeassistant.components.ipp.coordinator] Error fetching ipp data: Invalid response from API: Timeout occurred while connecting to IPP server.
2023-12-20 20:08:10.121 ERROR (MainThread) [homeassistant.components.apple_tv] Failed to connect
Traceback (most recent call last):
File “/usr/local/lib/python3.11/site-packages/pyatv/protocols/mrp/protocol.py”, line 275, in _receive
await semaphore.acquire()
File “/usr/local/lib/python3.11/asyncio/locks.py”, line 387, in acquire
await fut
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/lib/python3.11/site-packages/pyatv/protocols/mrp/protocol.py”, line 274, in _receive
async with async_timeout.timeout(timeout):
File “/usr/local/lib/python3.11/site-packages/async_timeout/init.py”, line 141, in aexit
self._do_exit(exc_type)
File “/usr/local/lib/python3.11/site-packages/async_timeout/init.py”, line 228, in _do_exit
raise asyncio.TimeoutError
TimeoutError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/components/apple_tv/init.py”, line 227, in connect_once
await self._connect(conf, raise_missing_credentials)
File “/usr/src/homeassistant/homeassistant/components/apple_tv/init.py”, line 329, in _connect
self.atv = await connect(conf, self.hass.loop, session=session)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/pyatv/init.py”, line 155, in connect
await atv.connect()
File “/usr/local/lib/python3.11/site-packages/pyatv/core/facade.py”, line 684, in connect
if await setup_data.connect():
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/pyatv/protocols/mrp/init.py”, line 1092, in _connect
await protocol.start()
File “/usr/local/lib/python3.11/site-packages/pyatv/protocols/mrp/protocol.py”, line 146, in start
self.device_info = await self.send_and_receive(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/pyatv/protocols/mrp/protocol.py”, line 262, in send_and_receive
return await self._receive(identifier, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/pyatv/protocols/mrp/protocol.py”, line 278, in _receive
del self._outstanding[identifier]
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
KeyError: ‘F7C98D73-1AA7-49FD-A75A-46EF46C7B21C’
2023-12-20 20:08:10.189 WARNING (MainThread) [hass_nabucasa.cloud_api] Fetched https://alexa-api.nabucasa.com/access_token (400)
2023-12-20 20:08:38.067 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.p_koray2_summation_delivered is taking over 10 seconds
2023-12-20 20:08:38.068 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.p_washingmachine_summation_delivered is taking over 10 seconds
2023-12-20 20:08:38.110 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.p_fridge_power is taking over 10 seconds
2023-12-20 20:08:38.111 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.p_fridge_summation_delivered is taking over 10 seconds
2023-12-20 20:08:38.135 WARNING (MainThread) [zigpy_deconz.api] No response to ‘CommandId.aps_data_indication’ command with seq id ‘0xdd’
2023-12-20 20:08:38.463 WARNING (MainThread) [homeassistant.components.sensor] Updating zha sensor took longer than the scheduled update interval 0:00:30
2023-12-20 20:09:28.950 WARNING (MainThread) [homeassistant.helpers.entity] Update of media_player.home is taking over 10 seconds
2023-12-20 20:09:54.010 WARNING (MainThread) [hass_nabucasa.iot] Connection closed: Cannot write to closing transport
2023-12-20 20:09:54.040 ERROR (MainThread) [homeassistant.components.homewizard.coordinator] Error fetching homewizard data: Timeout occurred while connecting to the HomeWizard Energy device
2023-12-20 20:09:54.052 ERROR (MainThread) [snitun.multiplexer.core] Ping fails, no response from peer
2023-12-20 20:10:19.650 WARNING (MainThread) [homeassistant.components.apple_tv] Connection lost to Apple TV “HomePod W”
2023-12-20 20:10:19.667 WARNING (MainThread) [homeassistant.components.sensor] Updating zha sensor took longer than the scheduled update interval 0:00:30
2023-12-20 20:10:21.488 WARNING (MainThread) [homeassistant.components.media_player] Updating samsungtv media_player took longer than the scheduled update interval 0:00:10
2023-12-20 20:10:21.602 WARNING (MainThread) [homeassistant.helpers.entity] Update of media_player.home is taking over 10 seconds
2023-12-20 20:10:21.757 WARNING (MainThread) [zigpy_deconz.zigbee.application] Unexpected transmit confirm for request id 198, Status: TXStatus.SUCCESS
2023-12-20 20:10:27.050 WARNING (Recorder) [homeassistant.util.executor] Thread[DbWorker_2] is still running at shutdown: File “/usr/local/lib/python3.11/threading.py”, line 1002, in _bootstrap
self._bootstrap_inner()
File “/usr/local/lib/python3.11/threading.py”, line 1045, in _bootstrap_inner
self.run()
File “/usr/local/lib/python3.11/threading.py”, line 982, in run
self._target(*self._args, **self._kwargs)
File “/usr/src/homeassistant/homeassistant/components/recorder/executor.py”, line 18, in _worker_with_shutdown_hook
shutdown_hook()
File “/usr/src/homeassistant/homeassistant/components/recorder/core.py”, line 301, in _shutdown_pool
self.engine.pool.shutdown()
File “/usr/src/homeassistant/homeassistant/components/recorder/pool.py”, line 68, in shutdown
conn.close()
File “/usr/local/lib/python3.11/site-packages/sqlalchemy/pool/base.py”, line 786, in close
self.__close()
File “/usr/local/lib/python3.11/site-packages/sqlalchemy/pool/base.py”, line 885, in __close
self.__pool._close_connection(
File “/usr/local/lib/python3.11/site-packages/sqlalchemy/pool/base.py”, line 379, in _close_connection
self._dialect.do_close(connection)
File “/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py”, line 701, in do_close
dbapi_connection.close()