Plugin Request: Geofence

Helpful Plugins to contribute to the Indigo community.
ryanbuckner
Posts: 1108
Joined: Sat Oct 08, 2011 12:33 pm
Location: Northern Virginia
Contact:

Re: Plugin Request: Geofence

Post by ryanbuckner »

Cool, I'll start adding error handling and validation rules
User avatar
whmoorejr
Posts: 767
Joined: Tue Jan 15, 2013 11:23 am
Location: Houston, TX

Re: Plugin Request: Geofence

Post by whmoorejr »

I've noticed what I can only describe as a state flicker.

The two states that I have noticed are "member_within_geofence" and "member_closest_address"

While setting up triggers, I tried using "member_closest_address" and found that the reported address will sometimes flash "geocode error" This example isn't too bad because I was able to work around it by using conditions in the trigger: member_closest_address" does contain "geocode" and now that trigger works fine.

With the geofences, I've had some fun figuring out the differences between indigo-geofences and places-geofences. I set a trigger to watch a member device (me) and trigger if "member_within_geofence" becomes not equal to "Home-Wide" <- an indigo-geofence larger radius around my places-geofence for "Home". This one truly flickers. My trigger repeatedly fires. I changed the trigger to "has any change" and added a pushover message to give me the string when it fires. All it says (in the pushover message) is "Home-Wide". It's like the state changes off-on-off-on so quickly that by the time the pushover message goes, it's back to on? Debug didn't provide me any clues.

Code: Select all

Life360 Debug                   Updating device: William
   Trigger                         L360 - Bill Arrives Home-Wide
   Trigger                         L360 - Bill Arrives Home-Wide
   Trigger                         L360 - Bill Arrives Home-Wide
   Trigger                         L360 - Bill Arrives Home-Wide
   Life360 Debug                   Updating device: Harper
I'm still testing a lot, ran into several hardware issues and possibly a software issue. The life360 app didn't update 2 of the phones.... they were home from school for about a half hour before they updated. Then they updated immediately for both phones once I opened the app on one of the two phones.
Bill
My Plugin: My People
ryanbuckner
Posts: 1108
Joined: Sat Oct 08, 2011 12:33 pm
Location: Northern Virginia
Contact:

Re: Plugin Request: Geofence

Post by ryanbuckner »

The "flicker" is probably me being a novice plugin developer. My plugin truly overwrites all states every time it runs. I was under the impression (wrongly probably) that Indigo handled determination if the value actually changed or not.

So, assuming it's on me, I may need some help determining where to compare old value vs new value and determining whether not to update the states on the server if they didn't change.
User avatar
whmoorejr
Posts: 767
Joined: Tue Jan 15, 2013 11:23 am
Location: Houston, TX

Re: Plugin Request: Geofence

Post by whmoorejr »

Indigo aside, with just the phone App, I can figure out where my kids are which is/was my main concern. The plugin also does all that and addresses my main concerns. Further automating with location data is fun and cool, but not the top of my priority list. Also, I'm not relying on any location based automation for safety / security, etc. It's supplemental. My point is... the plugin is great and I'm in no rush for any of the quirks to get figured out. I don't want to distract you from the Samsung plugin you're working on. (I'm a Roku TV guy myself, so no testing help for you there)
Bill
My Plugin: My People
ryanbuckner
Posts: 1108
Joined: Sat Oct 08, 2011 12:33 pm
Location: Northern Virginia
Contact:

Re: Plugin Request: Geofence

Post by ryanbuckner »

ok. I do want to improve the Life360 app tho. If I'm updating device_state incorrectly I'd love to do it right.
ckeyes888
Posts: 2431
Joined: Thu Nov 26, 2009 2:41 pm
Location: Kalispell, MT

Re: Plugin Request: Geofence

Post by ckeyes888 »

Trying to get the Geofence plugin setup but get an error when I test the webhook in Geofency entering or leaving.

Code: Select all

   GeoFence Error                  Exception: 'key body_params not found in dict'
Traceback (most recent call last):
  File "plugin.py", line 247, in process_message
    self.parseResult(p["device"], p["name"], p["entry"], action_props['body_params'])
KeyError: 'key body_params not found in dict'
In the Geofence app it says the webhook test is successful.

Any idea how to fix it?

Thanks,

Carl
User avatar
GlennNZ
Posts: 1604
Joined: Sun Dec 07, 2014 3:33 pm
Location: Central Coast, Australia

Plugin Request: Geofence

Post by GlennNZ »

Quick guess reply
Look at what is sent in the json in the Geofency app

Send method is
Post

Not Post (JSON)

Which works in Geofency for me

Glenn


Sent from my iPhone using Tapatalk
Last edited by GlennNZ on Wed Nov 08, 2023 9:40 pm, edited 1 time in total.
ckeyes888
Posts: 2431
Joined: Thu Nov 26, 2009 2:41 pm
Location: Kalispell, MT

Re: Plugin Request: Geofence

Post by ckeyes888 »

Changed it from Post(json) to Post and got it working.

Thanks,

Carl
Last edited by ckeyes888 on Wed Nov 08, 2023 9:53 pm, edited 1 time in total.
User avatar
GlennNZ
Posts: 1604
Joined: Sun Dec 07, 2014 3:33 pm
Location: Central Coast, Australia

Re: Plugin Request: Geofence

Post by GlennNZ »

Sorry should be

POST

Alone - not Post(JSON) which gives the same error as you


Sent from my iPhone using Tapatalk
cmwaffle
Posts: 8
Joined: Sat Apr 27, 2019 3:54 pm

Re: Plugin Request: Geofence

Post by cmwaffle »

Sorry to bother but I'm butt naked new to Geofence Plugin. I'm trying to get the GeoFency Plugin to respond to Geofence on my iPhone. I've put in all the the authorization code and URL that I can and I still get a failed test from the GeoFency web hook test. Can somebody help this poor beginner? Thanks.
User avatar
FlyingDiver
Posts: 7323
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Plugin Request: Geofence

Post by FlyingDiver »

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
cmwaffle
Posts: 8
Joined: Sat Apr 27, 2019 3:54 pm

Re: Plugin Request: Geofence

Post by cmwaffle »

Yes, I've read the README. I make the needed changes in a Note. I then copy and paste it into the URL Settings in the Webhook Settings of the Geofency app. I use the same login and password for my Indigo account to fill in the Account information. I use Post for the HTTP Method.

I'm clearly not doing something right.
User avatar
FlyingDiver
Posts: 7323
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Plugin Request: Geofence

Post by FlyingDiver »

I'm not the expert on actually using the plugin. I just took an old one and updated it. Hopefully an actual user can help you.
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
User avatar
GlennNZ
Posts: 1604
Joined: Sun Dec 07, 2014 3:33 pm
Location: Central Coast, Australia

Plugin Request: Geofence

Post by GlennNZ »

Working fine for me and Geofency.

You will need to post the screen shots of your setup to troubleshoot

Although from your description already see an issue.

Need to post the URL with api_key (which is indigo api key) and I believe plugin gives this information.
HTTP Method: POST
Account: Blank (as isn’t used) api_key is what gives access back to Indigo.

Sent from my iPad using Tapatalk
cmwaffle
Posts: 8
Joined: Sat Apr 27, 2019 3:54 pm

Re: Plugin Request: Geofence

Post by cmwaffle »

I got Geofency and the Geofence Plugin to work for my home location. Does anyone know how to have Indigo activate different triggers when different locations are entered or left?

Thanks.
Post Reply

Return to “Ryan Buckner's Plugins”