New Help with Luup

Sorry if I am in the wrong section, new to this layout. Been quite some time since I posted.

Someone created this code many year ago but I never got around to trying it. I wanted to have a way to get a visual alert with a light to flash say 4 times whenever a specific scene was triggered.

The code works except for the fact that it never stops flashing! How do I get the code to stop running. I have no programming skills, just know how to copy and paste. Should I just create a multiple on/off scene with delays instead? Would still like to know how the code should look if it’s possible to end it. Is it as simple as removing “Else go on” to end it?? Thanks for the help in advance :

------  SET THESE TWO VARIABLES to match needs of your system -----
Secs   = 3   ---->>  Secs: Number of seconds between "Blinks"
Device = 10 ---->>  Device: Device#  of Outlet or Light to "BLINK"
Call ='urn:upnp-org:serviceId:SwitchPower1';Do ='SetTarget';Nil =""
function BlinkOn()
 luup.call_action(Call,Do,{newTargetValue=1},Device)  -->BlinksOn
  if (Run == "1") then luup.call_timer("BlinkOff",1,Secs,Nil,Nil) end
function BlinkOff()
 luup.call_action(Call,Do,{newTargetValue=0},Device)  -->BlinksOff
  if (Run == "1") then luup.call_timer("BlinkOn",1,Secs,Nil,Nil) end
if (Run == "1") then Run = "0" --> NewClick while running=Stop,i.e.Run=0
 else Run = "1" luup.call_timer("BlinkOff",1,Secs,Nil,Nil) -->Else go on

This was a recent topic
here is a link to topic it has a couple of examples

Thank you!

Best Home Automation shopping experience. Shop at getvera!

© 2021 Ezlo Innovation, All Rights Reserved. Terms of Use | Privacy Policy | Forum Rules