Difference between revisions of "Trigger: Geofence Trigger"

 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<pre class="header-style">
+
<pre class="header-style">The Geofence Trigger activates when you enter or exit a specified area. It uses the standard Android Geofence APIs (Google Play Services) which may provide better reliability and lower battery consumption compared to the standard Location Trigger. The trigger fires once when you transition from one state to another.</pre>
This trigger will fire when you enter or exit a specified area (defined as a Geofence). The trigger will fire once when you transition from one state to another. For example if you select the 'enter area' option, the trigger will fire when you were previously outside the area and your new location is within the area.
 
  
It is equivalent to the Location Trigger but uses the standard Android Geofence APIs so may work better and/or use less battery.
+
''' Options '''
</pre>
 
  
Please see [[Trigger:_Location_Trigger|Location Trigger]] and [[Geofences]]
+
* '''Zone Name''': Select which Geofence zone will activate the trigger. Zones are configured in MacroDroid's Geofences settings.
  
'''Configuration Options'''
+
* '''Area Entered/Exited''': Choose whether the trigger fires when:
 +
** Entering the specified area
 +
** Exiting the specified area
  
* Zone name
+
* '''Trigger if Previous Location Unknown''': When enabled, the trigger will fire even if MacroDroid cannot determine your previous location (such as after a device reboot). By default, the trigger requires a confirmed state transition and won't activate without knowing your previous state.
  
The name of the Geofence area that you wish to trigger on.
+
* '''Location Update Rate''': Provides guidance to the Play Services library regarding how frequently location should be checked. Options typically range from 30 seconds to several minutes. Note that actual update frequency may vary from the requested interval depending on system conditions and battery optimization.
  
* Area Entered/Exited
+
''' Examples '''
  
You can choose to trigger either when you enter the area or when you exit the area.
+
''Example 1: Silence Phone at Work''
 +
  <pre class="trigger-style">Triggers
  
* Trigger if previous location unknown
+
Geofence (Area Entered) - Work Office</pre>
 +
  <pre class="action-style">Actions
  
If MacroDroid doesn't know your previous location (for example you have just rebooted your device) then the trigger will not typically fire if you meet the right criteria (as it doesn't know if you have transitioned from one state to another). If you want the trigger to fire in this situation then you can enable this option.
+
Volume Change - Ringer Volume: 0
 +
Volume Change - Notification Volume: 0</pre>
 +
  <pre class="constraint-style">Constraints
  
* Location Update Rate
+
Day of Week: Mon, Tue, Wed, Thu, Fri</pre>
  
This is just guidance for the Play Services library advising it how often you would like to check for location updates. The library will take this into consideration when deciding to check for Geofences but updates may vary considerably from the requested time.
+
Automatically silences the phone when arriving at the office on weekdays.
 +
 
 +
''Example 2: Send Arrival Notification''
 +
  <pre class="trigger-style">Triggers
 +
 
 +
Geofence (Area Entered) - Home</pre>
 +
  <pre class="action-style">Actions
 +
 
 +
Send SMS - To: [contact] - Message: I've arrived home</pre>
 +
 
 +
Sends an SMS notification when arriving at home.
 +
 
 +
''' Notes '''
 +
 
 +
* Requires location permissions (ACCESS_FINE_LOCATION, ACCESS_COARSE_LOCATION).
 +
* Location services must be enabled on the device.
 +
* Uses Google Play Services Geofence APIs, which may provide better battery efficiency than the standard Location Trigger.
 +
* Geofence zones must be configured separately in MacroDroid's Geofences settings before they can be selected.
 +
* The trigger provides context information including geofence name, coordinates, and a Google Maps link that can be used with magic text.
 +
* On Android 10 and above, background location permission may be required for the geofence to work reliably.
 +
 
 +
''' Magic Text '''
 +
 
 +
When this trigger fires, the following magic text values are available:
 +
* Geofence name
 +
* Latitude/Longitude coordinates
 +
* Google Maps location URL
 +
 
 +
''' See Also '''
 +
 
 +
* [[Trigger:_Location_Trigger|Location Trigger]]
 +
* [[Geofences|Geofences Configuration]]

Latest revision as of 23:02, 5 January 2026

The Geofence Trigger activates when you enter or exit a specified area. It uses the standard Android Geofence APIs (Google Play Services) which may provide better reliability and lower battery consumption compared to the standard Location Trigger. The trigger fires once when you transition from one state to another.

Options

  • Zone Name: Select which Geofence zone will activate the trigger. Zones are configured in MacroDroid's Geofences settings.
  • Area Entered/Exited: Choose whether the trigger fires when:
    • Entering the specified area
    • Exiting the specified area
  • Trigger if Previous Location Unknown: When enabled, the trigger will fire even if MacroDroid cannot determine your previous location (such as after a device reboot). By default, the trigger requires a confirmed state transition and won't activate without knowing your previous state.
  • Location Update Rate: Provides guidance to the Play Services library regarding how frequently location should be checked. Options typically range from 30 seconds to several minutes. Note that actual update frequency may vary from the requested interval depending on system conditions and battery optimization.

Examples

Example 1: Silence Phone at Work

Triggers

Geofence (Area Entered) - Work Office
Actions

Volume Change - Ringer Volume: 0
Volume Change - Notification Volume: 0
Constraints

Day of Week: Mon, Tue, Wed, Thu, Fri

Automatically silences the phone when arriving at the office on weekdays.

Example 2: Send Arrival Notification

Triggers

Geofence (Area Entered) - Home
Actions

Send SMS - To: [contact] - Message: I've arrived home

Sends an SMS notification when arriving at home.

Notes

  • Requires location permissions (ACCESS_FINE_LOCATION, ACCESS_COARSE_LOCATION).
  • Location services must be enabled on the device.
  • Uses Google Play Services Geofence APIs, which may provide better battery efficiency than the standard Location Trigger.
  • Geofence zones must be configured separately in MacroDroid's Geofences settings before they can be selected.
  • The trigger provides context information including geofence name, coordinates, and a Google Maps link that can be used with magic text.
  • On Android 10 and above, background location permission may be required for the geofence to work reliably.

Magic Text

When this trigger fires, the following magic text values are available:

  • Geofence name
  • Latitude/Longitude coordinates
  • Google Maps location URL

See Also