I was excited to see the new GPS Trigger widget in a recent update, so I set about adding it to my project. I would like to implement it such that a notification is only sent if the user is outside of a certain area.
I need some clarification: is is possible for the GPS Trigger to return whether or not the user’s phone is in the selected zone? The way I see it you can choose to have a trigger on entering the zone or on leaving it, but what I want is a boolean user_is_in_zone variable that I can use to enable or disable a feature. Is this possible?
I suppose I could use two GPS Triggers with the same zone and set one to enter and one to exit, but that seems silly (and 2x Energy!).
From the wording in the app I assumed that a trigger is sent when either entering or exiting the area, according to the setting in the app (kind of like a rising or falling interrupt).
Are you saying that actually the state is updated whenever the user enters or exits, and the switch determines whether 1 = IN or OUT.
Haven’t had a chance to test this for real yet (requires walking around outside). Is there any documentation for this widget? I couldn’t find any on the Blynk website or GitHub.
I have another quick question: what happens if you have multiple mobile devices running Blynk? Do they all have to enter or exit the geofence for it to trigger?
OK so I finally got around to trying this out. I have GPS Trigger widget on V8 and value display on V9 so I can see what’s going on.
BLYNK_WRITE(V8)
{
// Get here when entering or leaving geofence area
outside_geofence = param.asInt();
}
BLYNK_READ(V9)
{
Blynk.virtualWrite(V9, outside_geofence);
}
The geofence area is a small area around my house and I have the widget set to EXIT so I get a 1 when I’m outside the area which will enable a feature.
Except the value on V9 never changes. I’m currently sat (at work) about 10 miles away from the geofence and the value is still 0. What am I missing?
Did this ever get solved? Or did you guys find a fix? I’m currently having the exact same problem. I can even see my indicator enter/leave the map window in the widget…just getting no response from the gps widget.