Jump to content

Single program toggles a device from off to on & on to off?


rslaufer

Recommended Posts

Posted

I have written paired programs to toggle devices from on to off, and from off to on, after a given switch is triggered. I now need a program that be called by a REST interface that could perform that function. Is there anyway to set up a single program that could handle this. Any suggestions would be appreciated.

 

I realize that abusing nested "if...thens", can produce some real spaghetti code, but I wish my isy994i could deal with some more complicated logical conditions than a single if - then - else statement.

 

Thanks!

 

-RSL-

Posted

Try one program (disabled) and call runIf with /rest

 

 

Program: ToggleLights (disabled to prevent endless loop)

If
  Status MyLightSwitch is not Off

Then
  Set MyLightSwitch Off

Else
  Set MyLightSwitch On

 

Hope this helps.

 

-Xathros

Guest
This topic is now closed to further replies.

  • Recently Browsing

    • No registered users viewing this page.
  • Who's Online (See full list)

  • Forum Statistics

    • Total Topics
      37k
    • Total Posts
      371.4k
×
×
  • Create New...