Jump to content

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


rslaufer

Recommended Posts

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-

Link to comment

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

Link to comment

Archived

This topic is now archived and is closed to further replies.


  • Recently Browsing

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

  • Forum Statistics

    • Total Topics
      36.9k
    • Total Posts
      370.2k
×
×
  • Create New...