Difference between revisions of "Trigger: Battery Level"
| Line 1: | Line 1: | ||
<pre class="header-style"> | <pre class="header-style"> | ||
| − | + | 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. | |
| − | + | </pre> | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | + | ''' Options ''' | |
| − | |||
| − | |||
| − | + | When configuring this trigger, select one of the following: | |
| − | </pre> | + | |
| + | * '''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. | ||
| + | |||
| + | <pre class="trigger-style">Trigger: Airplane Mode Enabled</pre> | ||
| + | <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> | ||
| + | |||
| + | ''' Example 2: Restore connectivity settings after flight ''' | ||
| + | |||
| + | When Airplane mode is disabled, automatically enable Wi-Fi and Bluetooth. | ||
| + | |||
| + | <pre class="trigger-style">Trigger: Airplane Mode Disabled</pre> | ||
| + | <pre class="action-style">Action: Set Wi-Fi State - Enable Wi-Fi</pre> | ||
| + | <pre class="action-style">Action: Set Bluetooth State - Enable Bluetooth</pre> | ||
| + | |||
| + | ''' Example 3: Log flight times ''' | ||
| + | |||
| + | 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="action-style">Action: Write To File - Append "[date_time] - Flight mode started" to flight_log.txt</pre> | ||
| + | |||
| + | ''' 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 [[Constraint:_Airplane_Mode|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 ''' | |
| − | |||
| − | |||
| − | |||
| − | + | * [[Constraint:_Airplane_Mode|Airplane Mode Constraint]] - Check if Airplane mode is currently enabled/disabled | |
| − | + | * [[Action:_Set_Airplane_Mode|Set Airplane Mode Action]] - Enable or disable Airplane mode | |
| − | + | [[Category:Triggers]] | |
Revision as of 20:35, 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.
Trigger: Airplane Mode Enabled
Action: Volume Change - Media Volume = 0
Constraint: 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.
Trigger: Airplane Mode Disabled
Action: Set Wi-Fi State - Enable Wi-Fi
Action: Set Bluetooth State - Enable Bluetooth
Example 3: Log flight times
Track when you enable Airplane mode (boarding a flight) by logging to a file.
Trigger: Airplane Mode Enabled
Action: Write To File - Append "[date_time] - 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
- Airplane Mode Constraint - Check if Airplane mode is currently enabled/disabled
- Set Airplane Mode Action - Enable or disable Airplane mode