I have an automation to run a script to turn on specific lights when I turn off my TV between 10pm and 2am. However, it’s stopped working lately, since the latest HA Core update and throws out an error. I’m not sure if the Core update is the reason for this or coincidence.
The automation runs the first two script services but not the rest and the error appears.
If I change the time from
in the automation, just to test it, it works as expected.
I can’t make out what this error is telling me so if anyone could please help out and advise what the issue is.
Error
Logger: homeassistant.components.script.both_to_bed
Source: components/zha/light.py:551
Integration: Script (documentation, issues)
First occurred: July 17, 2023 at 10:16:55 PM (1 occurrences)
Last logged: July 17, 2023 at 10:16:55 PM
Both to Bed: Error executing script. Unexpected error for call_service at pos 2: Failed to enqueue message after 3 attempts: <EmberStatus.NETWORK_BUSY: 161>
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 468, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 703, in _async_call_service_step
response_data = await self._async_run_long_action(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 665, in _async_run_long_action
return long_task.result()
^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 1965, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2005, in _execute_service
return await cast(
^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
return await service.entity_service_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 848, in entity_service_call
response_data = task.result() # pop exception if have
^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1192, in async_request_call
return await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 892, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 582, in async_handle_light_on_service
await light.async_turn_on(**filter_turn_on_params(light, params))
File "/usr/src/homeassistant/homeassistant/components/group/light.py", line 179, in async_turn_on
await self.hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 1965, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2005, in _execute_service
return await cast(
^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
return await service.entity_service_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 848, in entity_service_call
response_data = task.result() # pop exception if have
^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1192, in async_request_call
return await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 892, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 582, in async_handle_light_on_service
await light.async_turn_on(**filter_turn_on_params(light, params))
File "/usr/src/homeassistant/homeassistant/components/zha/light.py", line 1197, in async_turn_on
await super().async_turn_on(**kwargs)
File "/usr/src/homeassistant/homeassistant/components/zha/light.py", line 373, in async_turn_on
if not await self.async_handle_color_commands(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/zha/light.py", line 551, in async_handle_color_commands
result = await self._color_cluster_handler.move_to_color(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/zigpy/zcl/__init__.py", line 375, in request
return await self._endpoint.request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/zigpy/group.py", line 57, in request
await self.application.send_packet(
File "/usr/local/lib/python3.11/site-packages/bellows/zigbee/application.py", line 812, in send_packet
raise zigpy.exceptions.DeliveryError(
zigpy.exceptions.DeliveryError: Failed to enqueue message after 3 attempts: <EmberStatus.NETWORK_BUSY: 161>
Automation
- alias: Both to Bed
id: both_to_bed
mode: single
trigger:
- platform: state
entity_id: media_player.sky_q
to: 'off'
condition:
condition: and
conditions:
- condition: time
after: '22:00:00'
before: '02:00:00'
- condition: state
entity_id: input_boolean.holiday_mode
state: 'off'
- condition: state
entity_id: sensor.iphone_m_battery_state
state: 'Not Charging'
- condition: state
entity_id: sensor.iphone_r_battery_state
state: 'Not Charging'
- condition: or
conditions:
- condition: state
entity_id: person.m
state: 'home'
- condition: state
entity_id: person.r
state: 'home'
# value_template: '{{ is_state("person.m", "home") or is_state("person.r",
# "home") }}'
action:
- service: script.both_to_bed
Script
both_to_bed:
alias: Both to Bed
sequence:
- service: light.turn_on
data:
entity_id: light.living_room_cabinet_lights
brightness: 160
rgb_color:
- 250
- 185
- 120
transition: 2
- service: light.turn_on
data:
entity_id: light.kitchen_lights
brightness: 160
rgb_color:
- 250
- 185
- 120
transition: 2
- service: light.turn_on
data:
entity_id: light.headboard_light
brightness: 160
rgb_color:
- 222
- 91
- 245
transition: 120
- service: light.turn_on
data:
entity_id:
- light.m_bedside_lamp
- light.r_bedside_lamp
brightness: 100
rgb_color:
- 252
- 131
- 10
transition: 120
- service: light.turn_off
data:
entity_id:
- light.living_room_light
- light.tv_unit_lights_all
transition: 4
- delay:
minutes: 2
- service: light.turn_off
data:
entity_id: light.living_room_cabinet_lights