Plugin Request: Geofence

Posted on
Sun Aug 13, 2023 6:23 pm
ryanbuckner offline
Posts: 988
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Plugin Request: Geofence

Cool, I'll start adding error handling and validation rules

Posted on
Tue Aug 22, 2023 8:26 pm
whmoorejr offline
User avatar
Posts: 702
Joined: Jan 15, 2013
Location: Houston, TX

Re: Plugin Request: Geofence

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

Posted on
Wed Aug 23, 2023 7:43 am
ryanbuckner offline
Posts: 988
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Plugin Request: Geofence

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.

Posted on
Wed Aug 23, 2023 9:52 am
whmoorejr offline
User avatar
Posts: 702
Joined: Jan 15, 2013
Location: Houston, TX

Re: Plugin Request: Geofence

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

Posted on
Wed Aug 23, 2023 10:59 am
ryanbuckner offline
Posts: 988
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Plugin Request: Geofence

ok. I do want to improve the Life360 app tho. If I'm updating device_state incorrectly I'd love to do it right.

Posted on
Wed Nov 08, 2023 9:09 pm
ckeyes888 offline
Posts: 2403
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: Plugin Request: Geofence

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

Posted on
Wed Nov 08, 2023 9:16 pm
GlennNZ offline
User avatar
Posts: 1433
Joined: Dec 07, 2014
Location: Central Coast, Australia

Plugin Request: Geofence

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.

Posted on
Wed Nov 08, 2023 9:33 pm
ckeyes888 offline
Posts: 2403
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: Plugin Request: Geofence

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.

Posted on
Wed Nov 08, 2023 9:39 pm
GlennNZ offline
User avatar
Posts: 1433
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: Plugin Request: Geofence

Sorry should be

POST

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


Sent from my iPhone using Tapatalk

Who is online

Users browsing this forum: No registered users and 3 guests