Need to turn a device off and on quickly each time the scene is triggered

Hi everyone

I am going to be using a zwave switch to turn on and off my pool lights.
However in order to change the LED colors i need to turn it off and on quickly to change color.

I tried to make a scene that turns the device off and then on but it wont let me duplicate the same command in a scene.

Is there a luup code that will sent the off command then immediately the on command when executed from a scene?

thank you

I tried to do something similar to control my outdoor PIR flood lights connected to a Fibaro relay switch.

The flood lights needed a on and off sequence quickly to enable the manual override feature so the light would stay on all the time rather than just switch themselves off again after no motion was detected.

I tried this code in a scene but it wasn’t switching the Fibaro relay fast enough for it to work.

367 is the devices ID number in Vera.

luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{ newTargetValue="0" },367)
luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{ newTargetValue="1" },367)
luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{ newTargetValue="0" },367)
luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{ newTargetValue="1" },367)