Skip to content
Stand with Ukraine flag

Vehicle Entered Restricted Area Alarm

  • Alarm Rule
  • 95 installs
  • v1.0.0
  • Jun 15, 2026
  • MIT license
  • v4.3+

Detect fleet vehicles crossing into restricted areas — fires the moment a tracked vehicle enters a no-go zone (closed customer site, after-hours depot, low-emission zone, school area) and auto-clears on exit. For fleet operators, logistics, last-mile delivery, and telematics integrators.

Type
  • Alarm
Category
  • Geofencing
  • Safety
Use Cases
  • Fleet Tracking
  • Asset Tracking
  • Smart City

Who it’s for

Fleet managers, logistics dispatchers, last-mile delivery operators, and telematics integrators asking “did this truck enter a closed customer site?”, “is a van crossing into the after-hours depot?”, “have we just entered a low-emission or school zone?” — when every unauthorized entry needs a recorded alarm for the operations and compliance log.

What it does

Raises a Critical alarm the moment the watched event becomes ENTERED, and auto-clears when the same event becomes LEFT.

Vehicle Entered Restricted Area Alarm diagram

How to set up

The rule works as soon as it is installed — there are no thresholds to configure. Install on a device or asset profile (e.g. Truck, Van, Fleet Vehicle) so every vehicle of that type is covered automatically and any new vehicle added later is picked up without extra setup. Single-vehicle installs are also supported.

This rule reads the restrictedAreaEvent telemetry. Pair it with the upstream template for the self-geofencing case where each vehicle carries its own restricted-area perimeter:

GPS Tracker Geofencing — Entry, Exit, Presence Dmytro Shvaika

Most fleet setups instead store the polygons on separate restricted-area entities that the vehicles relate to — for that topology, follow the direct vehicle-to-zone relation example or the fleet hierarchy example in the geofencing docs.

How to customize

  • To monitor a differently-named restricted zone — change the Time series key on the entryEvent argument to match your zone group’s name (e.g. restrictedAreaEventnoGoZoneEvent, restrictedAreaEventcongestionZoneEvent, restrictedAreaEventschoolZoneEvent).
  • To monitor several independent restricted zones on the same vehicle — add more zone groups in the upstream Geofencing CF. Each group emits its own Event key (e.g. customerSiteEvent, depotZoneEvent, lowEmissionZoneEvent), and you install this alarm once per zone group so each kind of entry is reported separately.
  • To make the alarm manual-clear-only — remove the Clear condition. The alarm then stays active until an operator clears it. Useful for compliance workflows where every entry must be acknowledged in the audit trail.
  • To restrict firing to specific windows — in the trigger condition’s Schedule, choose Active at a specific time range (or Custom schedule for different intervals per day). Useful for after-hours-only detection (e.g. depot entry outside business hours). For per-vehicle schedules, switch to Dynamic mode and source the schedule JSON from an attribute on the vehicle.
  • To control where the alarm shows up — toggle the propagation flags under Advanced settings.

See also

For the duration-based equivalent that fires when a vehicle or asset stays inside a monitored area longer than a configured threshold rather than on the entry moment — same geofencing CF family, reads the continuous presence-status key with a duration window instead of the transition event key:

Container Yard Dwell Time Alarm Dmytro Shvaika

Share Your Alarm Rule with the Community

Built a reliable alarm rule? Export it as a JSON from ThingsBoard and publish it to the IoT Hub. Share it with thousands of ThingsBoard developers and help the community react to incidents faster.