I have been trying to make my siren make a short “bip-bip” like you often hear when car alarms are activated. Trouble is the call to HA’s inbuilt delay takes longer than the 200ms I want the siren active for each “bip”. This is how I solved the problem. I’m not proud of it but it works:
internal_siren_1bip:
sequence:
- service: switch.turn_on
entity_id: switch.Siren_Inside
- service: input_boolean.turn_on
entity_id: input_boolean.dummy_delay
- service: input_boolean.turn_off
entity_id: input_boolean.dummy_delay
- service: input_boolean.turn_on
entity_id: input_boolean.dummy_delay
- service: input_boolean.turn_off
entity_id: input_boolean.dummy_delay
- service: input_boolean.turn_on
entity_id: input_boolean.dummy_delay
- service: input_boolean.turn_off
entity_id: input_boolean.dummy_delay
- service: switch.turn_off
entity_id: switch.Siren_Inside
The code for “siren_2bips” is a repetition of this mess with the 200ms middle off delay made the same way.