My worst kludge

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.

:roll_eyes:

May be you can use delay in between 2 services.
delay: 00:01:30 (1 minute 30 seconds)

As I said I need a 200ms (that’s 0.2 second) delay. Delay does support milliseconds but the call to the delay routine takes longer than that, hence the kludge.