Difference between revisions of "Trigger: Screen On/Off"

m
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
<pre style="background-color: #EEEEEE; color: Black; border-radius: 10px; padding: 10px;">
+
<pre class="header-style">This trigger will fire when the screen is turned on or off. It monitors the device display state changes, allowing you to automate actions based on screen activity.</pre>
This trigger can be configured to fire when either the screen is turned on or turned off.
 
</pre>
 
<br>
 
'''Example Usage'''<br/>
 
  
<pre style="background-color: #AC2424; color: white; border-radius: 10px; padding: 10px;">
+
''' Options '''
Triggers
 
  
 +
* '''Screen On''' - The trigger fires when the device screen is turned on
 +
* '''Screen Off''' - The trigger fires when the device screen is turned off
  
</pre><br>
+
''' Examples '''
<pre style="background-color: #1665B0; color: white; border-radius: 10px; padding: 10px;">
 
Actions
 
  
 +
'''Example 1: Mute media when screen off'''
  
</pre><br>
+
Automatically pause media playback when the screen turns off:
<pre style="background-color: green; color: white; border-radius: 10px; padding: 10px;">
 
Constraints
 
  
 +
  <pre class="trigger-style">Triggers
  
</pre><br>
+
Screen On/Off: Screen Off</pre>
<pre style="background-color: teal; color: white; border-radius: 10px; padding: 10px;">
+
  <pre class="action-style">Actions
Local variables
 
  
 +
Media Control: Pause</pre>
 +
  <pre class="constraint-style">Constraints
  
</pre><br>
+
Media Playing</pre>
 +
 
 +
'''Example 2: Launch app on screen on'''
 +
 
 +
Open a specific app whenever you turn on your screen:
 +
 
 +
  <pre class="trigger-style">Triggers
 +
 
 +
Screen On/Off: Screen On</pre>
 +
  <pre class="action-style">Actions
 +
 
 +
Launch Application: Clock</pre>
 +
  <pre class="constraint-style">Constraints
 +
 
 +
Time of Day: 6:00 AM - 9:00 AM</pre>
 +
 
 +
'''Example 3: Track screen time'''
 +
 
 +
Log screen on events for usage tracking:
 +
 
 +
  <pre class="trigger-style">Triggers
 +
 
 +
Screen On/Off: Screen On</pre>
 +
  <pre class="action-style">Actions
 +
 
 +
Set Variable: [screen_on_count] = [screen_on_count] + 1
 +
Log to file: "Screen turned on at [hour]:[minute]"</pre>
 +
 
 +
'''Example 4: Power saving mode'''
 +
 
 +
Enable power saving features when screen is off for extended periods:
 +
 
 +
  <pre class="trigger-style">Triggers
 +
 
 +
Screen On/Off: Screen Off</pre>
 +
  <pre class="action-style">Actions
 +
 
 +
Wait: 5 minutes
 +
WiFi: Disable
 +
Bluetooth: Disable</pre>
 +
 
 +
''' Notes '''
 +
 
 +
* This trigger uses a high priority broadcast receiver to ensure quick response to screen state changes
 +
* The trigger fires immediately when the screen state changes
 +
* Screen On fires before the lock screen is displayed - use the Screen Unlocked trigger if you need to wait for the device to be fully unlocked
 +
 
 +
''' See Also '''
 +
 
 +
* [[Trigger:_Screen_Unlocked|Screen Unlocked]]
 +
* [[Constraint:_Screen_On/Off|Screen On/Off Constraint]]
 +
* [[Action:_Screen_On/Off|Screen On/Off]]

Latest revision as of 21:43, 6 January 2026

This trigger will fire when the screen is turned on or off. It monitors the device display state changes, allowing you to automate actions based on screen activity.

Options

  • Screen On - The trigger fires when the device screen is turned on
  • Screen Off - The trigger fires when the device screen is turned off

Examples

Example 1: Mute media when screen off

Automatically pause media playback when the screen turns off:

Triggers

Screen On/Off: Screen Off
Actions

Media Control: Pause
Constraints

Media Playing

Example 2: Launch app on screen on

Open a specific app whenever you turn on your screen:

Triggers

Screen On/Off: Screen On
Actions

Launch Application: Clock
Constraints

Time of Day: 6:00 AM - 9:00 AM

Example 3: Track screen time

Log screen on events for usage tracking:

Triggers

Screen On/Off: Screen On
Actions

Set Variable: [screen_on_count] = [screen_on_count] + 1
Log to file: "Screen turned on at [hour]:[minute]"

Example 4: Power saving mode

Enable power saving features when screen is off for extended periods:

Triggers

Screen On/Off: Screen Off
Actions

Wait: 5 minutes
WiFi: Disable
Bluetooth: Disable

Notes

  • This trigger uses a high priority broadcast receiver to ensure quick response to screen state changes
  • The trigger fires immediately when the screen state changes
  • Screen On fires before the lock screen is displayed - use the Screen Unlocked trigger if you need to wait for the device to be fully unlocked

See Also