Problem Information
Expected/Desired Behavior
I have a script that I use to turn a light on, wait for some amount of time using a delay, and then turn the light off. I typically trigger this script through a RestAPI call from another device. Up until version 2023.7, the behavior was that the Rest API call would be trigger, there would be an immediate response from the server, the light would turn on, wait the specified amount of time, and then turn off. This is my desired behavior.
New Observed Behavior
After updating to 2023.7, the behavior that I am observing is that the Rest API command is sent, but then blocks until the entire script completes running. If on the client end I add a timeout to the Rest API send command to return after a short amount of time, this causes the Home Assistant script to immediately stop and cancel the delay, and the last portion of the script where the the light turns off does not get executed.
My guess is that this has something to do with “Responding Services” update noted here: https://www.home-assistant.io/blog/2023/07/05/release-20237/.
If I run the script manually, or I just wait on the client until the server responds, the script does fully run to completion.
Desired Outcome
I would like to know how I can configure my script and the RestAPI integration to just immediately respond with an ack noting that the request was received, and have the script continue running to completion like it used to on prior versions of Home Assistant. At the very least, if I could just have the script continue running even after the remote connection is closed due to a timeout, that would be an acceptable workaround, although I would prefer to be able to know that the response was received by the server.
Version Information
Home Assistant version where problem started: 2023.7.1
Home Assistant last known working version: 2023.6.3
As a note, versions earlier than 2023.6.3 worked as well.
Run Environment
I am running this on OpenSuse Linux using the Home Assistant Docker container.
Script Information
Below is the script being launched via the RestAPI call:
sequence:
- condition: state
entity_id: switch.laundry_room_outside_door_side_switch
state: "off"
- service: switch.turn_on
data: {}
target:
entity_id: switch.laundry_room_outside_door_side_switch
- delay:
seconds: "{{ delay_secs | int }}"
- service: switch.turn_off
data: {}
target:
entity_id: switch.laundry_room_outside_door_side_switch