Automation Delay Required Between Pilight-Receive and Pilight-Send

Anyone know why the automation below requires a delay of 1 second in order to work properly? I am receiving a 433 MHz code from a door sensor, which the automation is then supposed to turn on a 433 MHz outlet. If I set the delay to anything less than 1 second, the switch in HA will change, however the 433 MHz outlet doesn’t receive the turn_on code. If I use a Zwave switch, the delay is not required. It appears this issue deals strictly with receiving and turning on 433 MHz devices.

#Working Automation
alias: “pilight_door1_closed”
trigger:
platform: event
event_type: pilight_received
event_data:
protocol: ev1527
uuid: 0000-b8-27-eb-4ffabe
unitcode: 879842
state: opened
action:
- service: logbook.log
data:
name: "Automation Triggered: "
message: “pilight_door1_closed”
- delay:
seconds: 1
- service: switch.turn_off
entity_id: switch.zap1

#Not Working Automation
alias: “pilight_door1_closed”
trigger:
platform: event
event_type: pilight_received
event_data:
protocol: ev1527
uuid: 0000-b8-27-eb-4ffabe
unitcode: 879842
state: opened
action:
- service: logbook.log
data:
name: "Automation Triggered: "
message: “pilight_door1_closed”
- service: switch.turn_off
entity_id: switch.zap1

#Switch
platform: command_line
switches:
zap1:
command_on: ‘pilight-send -p clarus_switch -t -u=63 -i=A1’
command_off: ‘pilight-send -p clarus_switch -f -u=63 -i=A1’

And for the record, the logbook info is in there just for troubleshooting. And I’m using the pilight-send command because the clarus_switch protocol doesn’t support alphanumeric IDs.

Well, @janLo has reported that his hardware needs a certain send delay between commands to make it work and he implemented a send delay feature (docu). This send delay feature you cannot use when you call pilight-send from the command line. Your issue of not being able to send alphanumeric ids has been fixed but needs testing before release. Thus soon you do not have to use the command line.
Another reason might be that your receiving hardware is not too happy to receive a 433 MHz command directly after another (let’s face it 433 MHz devices are cheap and that for a reason ;-)). You can maybe make it more happy by repeating you command more often, like all 433 remotes do.