Automation: switch on->1sec->off->1sec->on possible?

Hi everyone,

i got a power outlet configured as a switch (powers a lamp) and use this at dusk to switch on a lamp.
This works fine as part of my evening automation.

Now i got a lamp on there, that is quiet dumb: it has four states (off, bright, medium low), all of which are cycled with the power switch (of the lamp). The lamp is dumb (at least for me) as it ALWAYS starts in bright mode, but i want it to be set in low mode.

So i thought, it should be possible to turn the switch on-off-on-off-on (with 1 second between) to set the lamp on low mode.

Is ist possible? (on-wait-off-wait… etc.)?

Any thoughts are appreciated. Thanks

script:
  lamp_on_low:
    sequence:
      - service: switch.turn_on
        entity_id: switch.your_switch
      - delay: 1
      - service: switch.turn_off
        entity_id: switch.your_switch
      - delay: 1
      - service: switch.turn_on
        entity_id: switch.your_switch
      - delay: 1
      - service: switch.turn_off
        entity_id: switch.your_switch
      - delay: 1
      - service: switch.turn_on
        entity_id: switch.your_switch

Call the script from a button tap action or make a template switch with the script as the turn on action.

1 Like

Ah! “delay” it is.
Thanks for pointing me in the right direction. This forum is always helpful. :smiling_face_with_three_hearts: