Jump to content

Help with geofence program


drprm1

Recommended Posts

Posted

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

 


 
 

Posted

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

Posted

You were correct that the Admin Console had not been restarted since I've been doing all this. I restarted it and am testing it today...

 

Thank you

Posted

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

???

Posted

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..

Posted

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.

Posted

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.

 

Posted

.....

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?

Posted

Sorry changed the wait..

Fires means notification sent.

I am going to delete and reinstall Mobilinc

The logic problem sounds like it is at ISY.

Posted

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.

Posted

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.....

Posted

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

Posted

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

Posted

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!

Posted

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

Posted

This might be a very dumb suggestion, but I know I've been bit by it before...remember to click "save" when modifying anything on the program page in the Admin Console. Otherwise, changes aren't written back to the ISY.

 

Wes

Posted

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

Posted

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...

Posted

Ghost protocol?

 

Are you sure  the notification is coming from ISY? Do you have any older notifications in MobiLinc (in the dungeon maybe? :) )

Posted

I don't have any notifications coming from Mobilinc. Again, I can make this occur by changing the variable in the Administrative Console. I turned both phones off to make sure.

Archived

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

×
×
  • Create New...