Jump to content

Just Run A Program


johnmsch

Recommended Posts

I recently bought the iPhone app MobiLinc Pro and would like to setup a program that I can turn on/off from the app for when I'm away from home. 

 

I had already setup a folder in the Admin Console for my ISY994i.  Under that folder, I have a few programs to turn on a radio, turn some lights on/off at random times, etc.  Originally, the condition for that folder was:

Folder Conditions for 'Away'
If
        Status  'Garage Door Opener' is Off
Then
   Allow the programs in this folder to run.

 

When I would leave home (this was for when I'd be away overnight or on a trip), I would turn the garage door opener switch (ToggleLinc Relay) off and leave the house through another door.  However, there have been times when I'm home and turn off the garage door opener switch, so I don't want the programs to run.

 

Now that I have MobiLinc Pro, from which I can access my Scenes, Devices, Programs, etc, I trying to find a way to basically turn that "Away" folder on and off.  I'm assuming this could be done with a program, so that when I leave home, I can turn that program on and the programs in the folder would then be active.

 

Hopefully I've explained this well enough to get some help from you guys!

 

Thanks

Link to comment

This is a good application for "State" variables.   Use a variable as the folder condition, and you have multiple options for setting the variable to a 1 or a 0 to enable or disable the folder:

Folder Conditions for 'Away'

If
        $I_am_Home < 1
Then
   Allow the programs in this folder to run.

I have an Insteon "Open/Close" sensor attached to a key hook.   When my keys are hanging on the hook, then the sensor sees the door as closed, and a program runs that sets $I_am_Home to 1.   Pick up the keys, and a program runs that resets the variable to zero:

Keys Up
If
   Status  'Home / A.Wireless / Keys are Gone' is On
    And $I_am_Home is 1
 
Then
        Set Scene 'Goodbye' Off
        $I_am_Home  = 0
        Wait  15 seconds
        $I_am_Home Init To 0

Notice that this program only runs if the variable started out set to 1?  

 

If I use a program or otherwise set $I_am_home to 2, I can force it to always see me as home, even if the keys are on the hook.  Or set it to -1 and it always sees me as away.
 

Link to comment

Wow, that's very clever!  I'm looking at using variables now.

 

For this purpose (just having a variable set to 0 or 1), what's the difference between using an Integer variable and a State variable?

 

Let's say I setup an Integer variable named $Away and had this for the folder condition:

 

Folder Conditions for 'Away'
If
        $Away is 1
Then
   Allow the programs in this folder to run.
 
I'm still not clear on how I would setup a program, that I could run on demand, that would set that variable to 1 or zero.

 

BTW, how did you post those code samples with the highlighting?????

 

Thanks for the info!

Link to comment

Wow, that's very clever!  I'm looking at using variables now.

 

For this purpose (just having a variable set to 0 or 1), what's the difference between using an Integer variable and a State variable?

 

Let's say I setup an Integer variable named $Away and had this for the folder condition:

 

Folder Conditions for 'Away'

If

        $Away is 1

Then

   Allow the programs in this folder to run.

 

I'm still not clear on how I would setup a program, that I could run on demand, that would set that variable to 1 or zero.

 

BTW, how did you post those code samples with the highlighting?????

 

Thanks for the info!

State variables, when the value chnages, cause ISY to run through your programs looking for usage of the variable that changed and evaluate the condition logic and run Then or Else, depending on the outcome of the logic.

 

Integer variables do not do this so you can use hundreds of them and not slow down your ISY trigger engine.

 

 

BTW I use two variables called $cTrue and $cFalse permanently set to ...you guessed it... 1 and 0

Link to comment

Simple answer on the variable question -- when using a variable as the only folder condition, always use a state variable.

 

If you know you never would want to use the variable you are creating as a condition, go ahead and make it an Integer, but if you think you'll ever need to use that variable to trigger a program, make it a state variable;  you can't go back and change type later.
 
Also, if you're going to make constant variables like $cTrue and $cFalse, go ahead and make those integer variables.

 

Let's say I setup an Integer variable named $Away and had this for the folder condition:

Folder Conditions for 'Away'
If
     $Away is 1
Then
     Allow the programs in this folder to run.

I'm still not clear on how I would setup a program, that I could run on demand, that would set that variable to 1 or zero.

 

 

The easiest way to run a program on demand is to make it run when you press a button on a Keypadlinc.

Program "Saw Home Button"

If
     Control 'Front Door Keypadlinc - B Home' is switched Off

Then
     Run Program 'Goodbye' (Then Path)
     $Away = 1
     Set Scene 'Bye Buttons Track Away value' Off

Regarding the above program formatting -- To make code samples appear highlighted, paste the text, select it with the mouse, then in the editor toolbar click on the code.png?t=4b93cd7f1f76df9c2c1783aae5cc3.

 

Link to comment

If MobiLinc allows you to Run Then and Run Else you can use a Flag program. Run Then sets a program True, Run Else sets a program False.

 

Then your Away folder can use the status of the Flag program to enable or disable the folder instead of a variable.

 

Link to comment

Simple answer on the variable question -- when using a variable as the only folder condition, always use a state variable.

 

If you know you never would want to use the variable you are creating as a condition, go ahead and make it an Integer, but if you think you'll ever need to use that variable to trigger a program, make it a state variable;  you can't go back and change type later.

 

Also, if you're going to make constant variables like $cTrue and $cFalse, go ahead and make those integer variables.

 

<snipped>

 

Typo there. Probably a slip of the logic tongue :)

 

  • If you know you never would want to use the variable you are creating as a condition program trigger, go ahead and make it an Integer, but if you think you'll ever need to use that variable to trigger a program, make it a state variable;  you can't go back and change type later.

 

 

All variable types can be used as a condition, just not a trigger.

Link to comment

Just discovered that I can use Geofencing in MobiLinc Pro.  Got it all setup and its working perfectly.

 

Once you set it up, it automagically creates a state variable in the ISY, in my case its JohnnyiPhone_ImHome.  When you go out of the Geofence, MobiLinc sets the value to 0.  When you get back inside, it sets it to 1.  Now I have this simple condition in the folder:

Folder Conditions for 'Away'
If
        $JohnnyiPhone_ImHome is 0
Then
   Allow the programs in this folder to run.

Now I'm playing around with notifications.  I had already set that up, but never used it.  Would like to see some notification messages when a couple of the programs in the Away folder are executed.  Looks like a real pain in the A$$ to setup Customizations, but I'll just keep at it.

 

BTW, does anyone have any recommendations for a particular Push module to push these notifications to my iPhone?  Pros/Cons vs sending text messages?

Link to comment

Just discovered that I can use Geofencing in MobiLinc Pro. Got it all setup and its working perfectly.

 

Once you set it up, it automagically creates a state variable in the ISY, in my case its JohnnyiPhone_ImHome. When you go out of the Geofence, MobiLinc sets the value to 0. When you get back inside, it sets it to 1. Now I have this simple condition in the folder:

Folder Conditions for 'Away'
If
	    $JohnnyiPhone_ImHome is 0
Then
   Allow the programs in this folder to run.
Now I'm playing around with notifications. I had already set that up, but never used it. Would like to see some notification messages when a couple of the programs in the Away folder are executed. Looks like a real pain in the A$$ to setup Customizations, but I'll just keep at it.

 

BTW, does anyone have any recommendations for a particular Push module to push these notifications to my iPhone? Pros/Cons vs sending text messages?

FWIW I like Pushover as you can use it for many things and have different tones. Sometimes people are known to go deaf to certain tones. Its also almost instantaneous for notifications.

Link to comment

Archived

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


  • Recently Browsing

    • No registered users viewing this page.
  • Forum Statistics

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