Difference between revisions of "Trigger: Battery Level"

Line 18: Line 18:
 
When Airplane mode is enabled at night, automatically mute media volume.
 
When Airplane mode is enabled at night, automatically mute media volume.
  
   <pre class="trigger-style">Trigger: Airplane Mode Enabled</pre>
+
   <pre class="trigger-style">Triggers
   <pre class="action-style">Action: Volume Change - Media Volume = 0</pre>
+
 
   <pre class="constraint-style">Constraint: Time of Day (10:00 PM - 7:00 AM)</pre>
+
Airplane Mode Enabled</pre>
 +
   <pre class="action-style">Actions
 +
 
 +
Volume Change - Media Volume = 0</pre>
 +
   <pre class="constraint-style">Constraints
 +
 
 +
Time of Day (10:00 PM - 7:00 AM)</pre>
  
 
''' Example 2: Restore connectivity settings after flight '''
 
''' Example 2: Restore connectivity settings after flight '''
Line 26: Line 32:
 
When Airplane mode is disabled, automatically enable Wi-Fi and Bluetooth.
 
When Airplane mode is disabled, automatically enable Wi-Fi and Bluetooth.
  
   <pre class="trigger-style">Trigger: Airplane Mode Disabled</pre>
+
   <pre class="trigger-style">Triggers
   <pre class="action-style">Action: Set Wi-Fi State - Enable Wi-Fi</pre>
+
 
  <pre class="action-style">Action: Set Bluetooth State - Enable Bluetooth</pre>
+
Airplane Mode Disabled</pre>
 +
   <pre class="action-style">Actions
 +
 
 +
Set Wi-Fi State (Enable Wi-Fi)
 +
Set Bluetooth State (Enable Bluetooth)</pre>
  
 
''' Example 3: Log flight times '''
 
''' Example 3: Log flight times '''
Line 34: Line 44:
 
Track when you enable Airplane mode (boarding a flight) by logging to a file.
 
Track when you enable Airplane mode (boarding a flight) by logging to a file.
  
   <pre class="trigger-style">Trigger: Airplane Mode Enabled</pre>
+
   <pre class="trigger-style">Triggers
   <pre class="action-style">Action: Write To File - Append "[date_time] - Flight mode started" to flight_log.txt</pre>
+
 
 +
Airplane Mode Enabled</pre>
 +
   <pre class="action-style">Actions
 +
 
 +
Write To File - Append "{hour}:{minute}:{second} - Flight mode started" to flight_log.txt</pre>
  
 
''' Notes '''
 
''' Notes '''
Line 47: Line 61:
 
* [[Constraint:_Airplane_Mode|Airplane Mode Constraint]] - Check if Airplane mode is currently enabled/disabled
 
* [[Constraint:_Airplane_Mode|Airplane Mode Constraint]] - Check if Airplane mode is currently enabled/disabled
 
* [[Action:_Airplane_Mode_On/Off|Airplane Mode On/Off Action]] - Enable or disable Airplane mode
 
* [[Action:_Airplane_Mode_On/Off|Airplane Mode On/Off Action]] - Enable or disable Airplane mode
 
[[Category:Triggers]]
 

Revision as of 20:45, 5 January 2026

This trigger fires when the device's Airplane mode setting is changed. You can configure it to trigger    when Airplane mode is enabled, or when it is disabled.

Options

When configuring this trigger, select one of the following:

  • Airplane Mode Enabled - Fires when Airplane mode is turned ON
  • Airplane Mode Disabled - Fires when Airplane mode is turned OFF

How It Works

The trigger listens for the system broadcast that Android sends whenever the Airplane mode state changes. This means the trigger fires immediately when the setting is toggled, regardless of how it was changed (Quick Settings tile, Settings app, or another automation).

Example 1: Mute media when going to sleep

When Airplane mode is enabled at night, automatically mute media volume.

Triggers

Airplane Mode Enabled
Actions

Volume Change - Media Volume = 0
Constraints

Time of Day (10:00 PM - 7:00 AM)

Example 2: Restore connectivity settings after flight

When Airplane mode is disabled, automatically enable Wi-Fi and Bluetooth.

Triggers

Airplane Mode Disabled
Actions

Set Wi-Fi State (Enable Wi-Fi)
Set Bluetooth State (Enable Bluetooth)

Example 3: Log flight times

Track when you enable Airplane mode (boarding a flight) by logging to a file.

Triggers

Airplane Mode Enabled
Actions

Write To File - Append "{hour}:{minute}:{second} - Flight mode started" to flight_log.txt

Notes

  • This trigger detects changes to Airplane mode. It does not fire based on the current state when a macro is enabled. To check the current Airplane mode state, use the Airplane Mode Constraint.
  • On some devices, enabling Airplane mode automatically disables Wi-Fi, Bluetooth, and mobile data. However, some devices allow Wi-Fi and Bluetooth to be re-enabled while Airplane mode remains active.
  • No special permissions are required for this trigger.

See Also