Jump to content

Help with geofence program


drprm1

Recommended Posts

So I'm trying to script a program which will alert me when the garage door is opened when my wife and I are gone by using geofencing with our phones......

 

 

Garage door alert 1

If
        $Patrick's_iPhone_Home is 0
    And $Shelleys_iPhone_Home is 0
    And Status  'Garage Door Sensor' is On
 
Then
        Run Program 'Garage door alert 2' (Then Path)
 
Else
   - No Actions - (To add one, press 'Action')
 
 

 

 

 Garage door alert 2

If
   - No Conditions - (To add one, press 'Schedule' or 'Condition')
 
Then
        Send Notification to 'Patrick E-mail' content 'Garage Open Nobody Home'
 
Else
   - No Actions - (To add one, press 'Action')
 
 

 

The Garage door alert 2 program is disabled.........If I open the garage door it's fine but if I have my phone with me and leave it fires, even when my wife is still at home. Basically the program becomes true when either phone is 0, NOT both phones like I specified.. I've checked the variables to make sure they are correct. The geofence for both phones is set at 100M and I've deleted them and redid them.....

 

I do have a simple program to notify me when the garage door opens anytime but I'd like this to work and

can't figure why it's not.

 

Thanks for the help

 


 
 

Link to comment
Share on other sites

Hi drprm1,

 

The way the program is written above is correct and should work how you've specified. If $Shelleys_iPhone_Home is a 1, then the program will run the IF statement when your phone sets the variable to 0 OR when the garage door sensor reports ON and run the ELSE path since $Shelleys_iPhone_Home isn't also a 0.

 

What I suspect is happening is that there is a disconnect somewhere between the program and the variable in the ISY. Please make sure you close the Admin Console after creating or deleting a geo-fence in MobiLinc. The Admin Console does not pick up changes to the Variable configuration MobiLinc makes to the ISY without restarting the Admin Console.

 

Please restart the Admin Console and then setup your program's IF statement again with the variables the ISY has listed. You can test by manually setting these MobiLinc geo-fence created variables to a 1 or 0 to simulate the person leaving or arriving to test your logic.

 

Wes

Link to comment
Share on other sites

Testing a bit more from my office (remote Admin Console)......The notification is sent when I change the variable for my phone remotely...Garage door sensor is OFF, Wife's phone is 0, so when I change the variable from my phone to 0 the notification is sent AND when I change it back to 1 a notification is sent..

Link to comment
Share on other sites

Spoke too soon....Notification was sent when my phone left the area (and variable changed to 0). Wife phone was still variable 1.

???

Can you copy and paste  your exact program 1 into the forum? From your OP everything looks good. Perhaps some quirky syntax is not correct?

 

 

Also try this

 

If

         $Patrick's_iPhone_Home is 0

     And $Shelleys_iPhone_Home is 0

     And Status  'Garage Door Sensor' is On

 

Then

         Wait 30 seconds

         Run Program 'Garage door alert 2' (Then Path)

 

Else

    - No Actions - (To add one, press 'Action')

 

Perhaps the MobiLinc pathway is throwing a glitch status change that you cannot see. The timer will get cancelled if the status changes over and back before 30 seconds are up.

Link to comment
Share on other sites

OK...

 

Garage Alert 1

If
        (
             $Patrick's_iPhone_Home is 0
         And $Shelleys_iPhone_Home is 0
        )
    And Status  'Garage Door Sensor' is On
 
Then
        Run Program ' Garage door alert 2' (Then Path)
 
Else
   - No Actions - (To add one, press 'Action')

 

Garage Alert 2

 

 

If
   - No Conditions - (To add one, press 'Schedule' or 'Condition')
 
Then
        Wait  30 seconds
        Send Notification to 'Patrick E-mail' content 'Garage Open Nobody Home'
 
Else
   - No Actions - (To add one, press 'Action')

 

 

I added the ( ) to the first program....Inserted the wait like specified.....Tested and it still fires when I change the variable for my phone from 1 to 0 AND when I change it back to 1.

 

Link to comment
Share on other sites

.....

I added the ( ) to the first program....Inserted the wait like specified.....Tested and it still fires when I change the variable for my phone from 1 to 0 AND when I change it back to 1.

 

 

The wait  belongs in the first program!

 

The program will fire every time any of the variables or conditions change and depending on the outcome of the whole logic "If" section will run Then or Else, every time. Of course, you should only get notification when the Then clause runs.

 

By the term "fires" stated, do you mean the notification is sent, or you can see the first program  running?

Link to comment
Share on other sites

Youre right. Again its sending out the notification when I change the variable through the Admin Console

 

I would try eliminating the other variables and first see if only Away status from your phone triggers it. (not Home)

 

Then I would add the other conditions/triggers  back in.

 

Just jogging the memory on your ISY may do it. It does sound like ISY is not doing the logic you have written.

Link to comment
Share on other sites

Took the other conditions out of the if clause except one phone's variable...It triggered on home and away states.

Changed to other phone and it too, alone,  triggered on both variable states.....

Link to comment
Share on other sites

Took the other conditions out of the if clause except one phone's variable...It triggered on home and away states.

Changed to other phone and it too, alone,  triggered on both variable states.....

Then it sounds like ISY isn't performing properly.

 

I would open a repair ticket with UDI and they will fix it

Link to comment
Share on other sites

Hi drprm1,

 

Can you reproduce this issue with your own created variables? IE leave MobiLinc totally out of the equation and just create your program/variable structure yourself and test. Once you know this works, then just swap in the MobiLinc created variables.

 

Wes

Link to comment
Share on other sites

I'll try this next......

 

 

FYI, I deleted the programs entirely but I still get the notification (like the program ran) when the variable changes!

This sounds like you have the wrong address in MobiLinc that is triggering something other than the correct variable or program. Easily done.

 

 

BTW: Most of us like to mark our state variables with an "s" prefix so they look something like this

    $sPatrick's_iPhone_Home

Link to comment
Share on other sites

I did save the program.

I too use I and S to distinguish variables but Mobilinc created these so I hadn't changed them yet.

 

You are right Lee, I hadn't deleted the program only disabled it.   It is now deleted for testing.

 

UDI has given me a few things to try next.

 

Thanks

Link to comment
Share on other sites

Well I deleted program, hit save changes (never usually hit "save changes" after deletion).

Closed AC

Cleared Java cache

Rebooted ISY

Opened AC, went to programs, verified program deleted.

Went to variables....Changed the variable and the 'deleted' program ran and sent me the notification...

Link to comment
Share on other sites

Archived

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


×
×
  • Create New...