Flash lights doorbell ring

Hi,

I have many light entities (Shelly dimmers) and want to flash them up/down for a few seconds when the doorbell rings.

Any ideas how this is achieved?

If the lights are off, they need to come on, flash a few times and go back off again.

If the lights are on, they need to dim up and down and return to the previous setting again.

Thanks.

Have you tried to create the automation yourself? Or start by making two automations? One for each situation.

Yes, however it’s difficult to get the “return to last state”.

If I flash the lights, i can ensure the last state returns correctly.

Can you show what you already have.

I do this using scripts, one for each room:

blink_living_room_light:
  sequence:
    repeat:
      count: 6
      sequence:
        - service: light.toggle
          entity_id: light.living_room_ceiling_light
        - delay:
            milliseconds: 500

Thanks, worked a treat!