I am testing a script that performs multiple actions with a few delays. In my scripts.yaml
I have this:
tv_on:
alias: 'TV On'
sequence:
- service: switch.turn_on
data:
entity_id: switch.tv_ir
- delay: '00:00:05'
- service: switch.turn_on
data:
entity_id: switch.speaker
- service: shell_command.luther_sound_bluetooth
- delay: '00:00:03'
- service: broadlink.send_packet_192_168_11_39
data:
packet:
- JgBQAAABJ5USExITETgSExITEhMSExISEzcSNBY3EzcSExISExITEhITEhMSNxMSEhMSExI3ExITNxI3ExITNxI3EzcSExI3EwAFlQABKUkTAA0FAAAAAAAAAAA=
- service: shell_command.luther_sound_vol_reset
and
tv_off:
alias: 'TV Off'
sequence:
- service: switch.turn_off
data:
entity_id: switch.tv_ir
- delay: '00:00:15'
- service: switch.turn_off
data:
entity_id: switch.speaker
When running the TV on script it seems to go wrong after the first delay. The switch.turn_on
command is fired (another automation gets triggered) but the UI / state for switch.speaker
remains off
. The other call to send a IR packet doesn’t seem to get run either.
When turning the TV off it also seems to fail after the first delay.
The switch looks like this:
- platform: mqtt
name: "Speaker"
state_topic: "sycamore/tvspeaker/switch"
command_topic: "sycamore/tvspeaker/switch"
payload_on: "on"
payload_off: "off"
retain: true
and when it changes state from on/off some simple automations run.
Are there any known issues with delay? or obvious syntax issues with the above?
Thanks