Difference between revisions of "Trigger: USB Device Connect/Disconnect"

m
 
(4 intermediate revisions by 3 users 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 a USB device such as a memory stick or keyboard is connected or disconnected. It monitors for USB peripherals and accessories attached to your Android device.</pre>
This trigger will fire when a USB peripheral device such as a keyboard, mouse or USB memory stick is connected/disconnected from the Android phone/tablet.
 
  
Note that this trigger will not fire in the case where the Android device is connected to a PC or similar.
+
''' Options '''
</pre>
 
  
'''Example Usage'''<br/>
+
* '''USB Device Connected''': Trigger when a USB device is attached to the Android device
If the USB device is connected, open the file manager.
+
* '''USB Device Disconnected''': Trigger when a USB device is detached from the Android device
<pre style="background-color: #AC2424; color: white; border-radius: 10px; padding: 10px;">
 
Triggers
 
  
USB device connected
+
''' Magic Text '''
</pre><br>
 
<pre style="background-color: #1665B0; color: white; border-radius: 10px; padding: 10px;">
 
Actions
 
  
Launch app (File manager)
+
This trigger provides the following magic text values:
</pre><br>
 
<pre style="background-color: green; color: white; border-radius: 10px; padding: 10px;">
 
Constrains
 
  
 +
* '''{usb_product_name}''': The product name of the connected/disconnected USB device
 +
* '''{usb_manufacturer_name}''': The manufacturer name of the USB device
 +
* '''{usb_device_hash}''': A unique identifier hash code for the USB device
  
</pre><br>
+
''' Monitored Events '''
<pre style="background-color: teal; color: white; border-radius: 10px; padding: 10px;">
 
Local variables
 
  
 +
The trigger monitors the following USB events:
 +
* USB device attached
 +
* USB device detached
 +
* USB accessory attached
 +
* USB accessory detached
  
</pre><br>
+
''' Examples '''
 +
 
 +
  <pre class="trigger-style">Triggers
 +
 
 +
USB Device Connect/Disconnect: USB Device Connected</pre>
 +
  <pre class="action-style">Actions
 +
 
 +
Notification: USB Device Connected
 +
    [usb_product_name] by [usb_manufacturer_name]
 +
Speak Text: USB device connected</pre>
 +
 
 +
''Notify when any USB device is connected and announce via TTS.''
 +
 
 +
----
 +
 
 +
  <pre class="trigger-style">Triggers
 +
 
 +
USB Device Connect/Disconnect: USB Device Disconnected</pre>
 +
  <pre class="action-style">Actions
 +
 
 +
Popup Message: USB device safely removed</pre>
 +
 
 +
''Show confirmation when a USB device is safely disconnected.''
 +
 
 +
''' Notes '''
 +
 
 +
* This trigger will NOT fire when the Android device itself is connected to a PC or similar as a USB peripheral. It only monitors USB devices connected TO the Android device.
 +
* Works with USB OTG (On-The-Go) connections where the Android device acts as the host.
 +
* Supported devices include USB keyboards, mice, game controllers, USB flash drives, and other USB peripherals.
 +
* USB accessories connected via the accessory protocol are also detected.
 +
* The device information (product name, manufacturer) availability depends on the USB device providing this information.

Latest revision as of 21:55, 7 January 2026

This trigger will fire when a USB device such as a memory stick or keyboard is connected or disconnected. It monitors for USB peripherals and accessories attached to your Android device.

Options

  • USB Device Connected: Trigger when a USB device is attached to the Android device
  • USB Device Disconnected: Trigger when a USB device is detached from the Android device

Magic Text

This trigger provides the following magic text values:

  • {usb_product_name}: The product name of the connected/disconnected USB device
  • {usb_manufacturer_name}: The manufacturer name of the USB device
  • {usb_device_hash}: A unique identifier hash code for the USB device

Monitored Events

The trigger monitors the following USB events:

  • USB device attached
  • USB device detached
  • USB accessory attached
  • USB accessory detached

Examples

Triggers

USB Device Connect/Disconnect: USB Device Connected
Actions

Notification: USB Device Connected
    [usb_product_name] by [usb_manufacturer_name]
Speak Text: USB device connected

Notify when any USB device is connected and announce via TTS.


Triggers

USB Device Connect/Disconnect: USB Device Disconnected
Actions

Popup Message: USB device safely removed

Show confirmation when a USB device is safely disconnected.

Notes

  • This trigger will NOT fire when the Android device itself is connected to a PC or similar as a USB peripheral. It only monitors USB devices connected TO the Android device.
  • Works with USB OTG (On-The-Go) connections where the Android device acts as the host.
  • Supported devices include USB keyboards, mice, game controllers, USB flash drives, and other USB peripherals.
  • USB accessories connected via the accessory protocol are also detected.
  • The device information (product name, manufacturer) availability depends on the USB device providing this information.