Skip to content

Geofences ​

Open Geofences.

A fence is its own record. A rule engine does not draw the fence. It only tests a point against a fence you already saved.

Create the fence on this screen, or with POST /api/geofences. The screen has the name, a circle (centre and radius) or a polygon, and the enter and exit alarm switches. Click the map to set the centre or to add a polygon corner. A polygon needs at least three corners. The ring is closed when you save.

Latitude is a decimal degree from -90 to 90. Longitude is a decimal degree from -180 to 180. Degrees × 1e6 are rejected. A polygon point is longitude, then latitude.

The enter and exit switches start off on this screen. Turn one on and the geofence monitor raises a MAJOR alarm when a device crosses that way. The alarm stays active until you clear it. The monitor and a rule-engine geofence node both run. A chain alarm is a different condition from the fence alarm. Profile alarm rules still run as well.

A POST that leaves alarmOnEnter or alarmOnExit out turns that flag on.

PATCH /api/geofences/{geofenceId} changes a fence. DELETE /api/geofences/{geofenceId} removes it.

The rule engine node ​

Bind a Started engine on Device Profile → Automations. The device profile is how the geofence node runs for that device.

The node reads decimal degrees. These forms are accepted:

FormExample
Number keyslatitude and longitude
Numeric strings"26.9124" and "75.7873"
Nested objectlocation or gps with latitude and longitude, or lat and lon

The default keys are latitude and longitude. You can type other key names on the node.

OutputWhen
insideThe point is inside, and it was not a crossing into the fence
outsideThe point is outside, and it was not a crossing out of the fence
enteredThe previous point was outside and this point is inside
leftThe previous point was inside and this point is outside
failureThe position is missing, out of range, degrees × 1e6, a rejected swap, or the fence was not found

The first point from a device is inside or outside. entered and left start at the second point. A failure does not change the remembered side. The next good point is still judged against the last good point.

An empty fence field checks every enabled fence. The fences are taken in name order, A to Z. The first one that contains the point wins. If none do, the result is outside and the name is the first fence in that same name order. For a lockout, pick one fence.

Reject swapped data is off unless you turn it on. On, the node fails when the latitude key is at least 45° and larger than a longitude that is still inside ±90. That catches a swap where the longitude was the larger number. A real site with that same shape fails too, so leave it off for those sites. A latitude above 90 with a longitude inside ±90 already fails, and the note says the keys may be swapped. A swap that is still a legal point cannot be detected with the switch off.

Treat a crossing as inside or outside sends a leave out on outside and an entry out on inside. geofence_crossing is still left or entered. Use it when the graph only connects inside and outside. Otherwise connect entered and left as well. The editor warns when those two outputs are not connected and the switch is off. A graph that connects only inside and outside does nothing at the moment of a crossing.

Lockout ​

Example: Block the next start is on the rule engine list. It is a draft. It does not send a command. outside and left both go to Send command with method blockNextStart and once: true. entered and inside go to the inside log. failure goes to a log, so a bad fix does not send the command. Duplicate the example, pick one fence, and confirm the device understands blockNextStart before you start the copy.

Preview ​

Run Preview evaluates the fence with the sample location and shows inside or outside. It does not remember the previous point, so it does not show entered or left. It does not send a command or raise an alarm.

support@autoconnecto.in · founder@autoconnecto.in · +91 92121 00555 · app.autoconnecto.in