Skip to content

Commands

QWavey edited this page May 3, 2026 · 26 revisions

NOTE:

ALMOST ALL COMMANDS WITH "✅" ARE COMPLETED AND INTEGRATED IN THE SCRIPT. THE REST NOT.

✅ Basic Functions

Command Example Description
REM REM Hello World! Comment line
DELAY DELAY 1000 Wait in ms
DEFAULTDELAY DEFAULTDELAY 200 Default delay between commands
STRING STRING Hello World! Types text
REPEAT REPEAT 3 Repeats last command
LOCALE LOCALE DE Switches keyboard layout
KEYCODE KEYCODE 0x02 0x04 Sends HID keycodes
LED LED 40 20 10 Sets RGB color

✅ Modifier & Special Keys

Command Aliases Description
CTRL CONTROL Control key
SHIFT - Shift key
ALT - Alt key
WINDOWS GUI Windows key
ENTER - Enter/Return
TAB - Tab
ESC ESCAPE Escape
DELETE DEL Delete
UP UPARROW Up arrow
DOWN DOWNARROW Down arrow
LEFT LEFTARROW Left arrow
RIGHT RIGHTARROW Right arrow
CAPSLOCK - Caps Lock
NUMLOCK - Num Lock
PRINTSCREEN - Print Screen

✅ Advanced Features

Feature Command Example Description
Conditional Execution IF_PRESENT SSID="MyWiFi" Runs only if SSID found
Conditional Execution IF_NOTPRESENT SSID="Guest" Runs if SSID not found
Hold Keys HOLD SHIFT 10 Hold SHIFT for 10s
Hold Keys HOLD_TILL_STRING Hold until next STRING
Rowed Payloads BEGIN_ROWER … END_ROWER Chain .txt payloads
Math Ops VAR1=5 + VAR2=3VAR1+VAR2=8 Supports + - × ÷
Variables VAR myVar=Hello Define and reuse variables
Self-Destruct SELFDESTRUCT password Erases firmware
Boolean-Variables IN WORK

WiFi Automation

These variables control WiFi behavior based on the presence of a specific SSID.

Variable Description
WIFI_OFF_WHEN_WIFI="SSID" IS_ONLINE Turn WiFi off when the specified SSID is online.
WIFI_OFF_WHEN_WIFI="SSID" IS_OFFLINE Turn WiFi off when the specified SSID is offline.
WIFI_ON_WHEN_WIFI="SSID" IS_ONLINE Turn WiFi on when the specified SSID is online.
WIFI_ON_WHEN_WIFI="SSID" IS_OFFLINE Turn WiFi on when the specified SSID is offline.

Bluetooth Automation

These variables control Bluetooth behavior based on the presence of a specific SSID.

Variable Description
BLUETOOTH_OFF_WHEN_WIFI="SSID" IS_ONLINE Turn Bluetooth off when the specified SSID is online.
BLUETOOTH_OFF_WHEN_WIFI="SSID" IS_OFFLINE Turn Bluetooth off when the specified SSID is offline.
BLUETOOTH_ON_WHEN_WIFI="SSID" IS_ONLINE Turn Bluetooth on when the specified SSID is online.
BLUETOOTH_ON_WHEN_WIFI="SSID" IS_OFFLINE Turn Bluetooth on when the specified SSID is offline.

Client Connection Triggers

These variables can be used to trigger actions based on client connectivity status for WiFi or Bluetooth.

Variable Description
IF_CLIENT_CONNECTED_BLUETOOTH Trigger action when a client connects via Bluetooth.
IF_CLIENT_CONNECTED_WIFI Trigger action when a client connects via WiFi.
IF_CLIENT_DISCONNECTED_WIFI Trigger action when a client disconnects from WiFi.
IF_CLIENT_DISCONNECTED_BLUETOOTH Trigger action when a client disconnects from Bluetooth.
IF_CLIENT_CONNECTED Trigger action when a client connects (generic).
IF_CLIENT_DISCONNECTED Trigger action when a client disconnects (generic).
IF_CLIENT_CONNECTED_DISCONNECTED Trigger action on any connection/disconnection event.
IF_CLIENT_CONNECTED_DISCONNECTED_BLUETOOTH Trigger action on Bluetooth connection/disconnection.
IF_CLIENT_CONNECTED_DISCONNECTED_WIFI Trigger action on WiFi connection/disconnection.

OS_DETECTION

Step Command / Code Description / Output
1 VAR DETECT_OS = cmd /c reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find "ProductName" | clip Detects the Windows Product Name and copies it to the Clipboard.
2 STRING DETECT_OS Prints the copied OS information.
3 IF_DETECT_OS_INCLUDES = "Windows"STRING This is a Windows device Detects and prints if it’s a Windows system.
4 IF_DETECT_OS_INCLUDES = "Linux"STRING This is a Linux device Detects and prints if it’s a Linux system.
Example Output ProductName REG_SZ Windows 10 Home

Automation, Time, Events, and Network

Command Example Description / Notes
GET_TIME GET_TIME de Retrieves current time from an NTP/time server for the specified region (e.g., "de" for Germany). Supports 24-hour format.
RUN_AT_TIME RUN_AT_TIME = 1PM, de
RUN_AT_TIME = 1PM 10, de
RUN_AT_TIME = 20:00
Schedules execution of commands at a specific time. Accepts regional time zones.
VAR Time = GET_TIME VAR Time = GET_TIME de
STRING Time
Stores current time in a variable for later use.
GET_DAY GET_DAY de Retrieves the current day of the week for the specified region.
RUN_AT_DAY RUN_AT_DAY = monday
RUN_AT_TIME = 13:30, de
Executes commands on a specific day and optionally at a specific time.
RUN_WHEN_WIFI RUN_WHEN_WIFI = "SSID" IS_ONLINE
STRING RUN_WHEN_WIFI is Online!
RUN_WHEN_WIFI = "SSID" IS_OFFLINE
Triggers commands when a specific WiFi network is online or offline.
WAIT_FOR_EVENT WAIT_FOR_EVENT = USB_CONNECTED
STRING USB is connected!
WAIT_FOR_EVENT = USB_DISCONNECTED
STRING USB is disconnected!
Pauses execution until a specific system event occurs (USB connection/disconnection).
HTTP_REQUEST HTTP_REQUEST = "http://example.com/api" Sends an HTTP GET request to the specified URL. Requires WiFi connection.
HTTPS_REQUEST HTTPS_REQUEST = "https://example.com/api" Sends an HTTPS GET request to the specified URL. Requires WiFi connection.

Specific Commands

Command Example Description
SHUTDOWN SHUTDOWN 1000 Shuts down the ESP in 1 second.
REBOOT REBOOT NOW / REBOOT 1000 Reboots the ESP immediately / in 1 second.
PING PING 8.8.8.8 Pings a host to check connectivity. Requires WiFi connection.
DOWNLOAD_FILE DOWNLOAD_FILE https://example.com/file.txt Downloads a file from the internet. Requires WiFi connection.
UPLOAD_FILE UPLOAD_FILE FILE_DIR_ON_SD DIRECT_UPLOAD_FIELD_URL_TO_UPLOAD_TO Uploads a file to a server. Requires WiFi connection.

Line Command / Code Explanation
1 VAR prefix="ID-" Declares a variable named prefix and assigns it the string value "ID-". This will be used as a prefix for generated IDs.
2 VAR start=0 Declares a variable start with the numeric value 0. This is the starting value for the loop counter.
3 VAR end=50 Declares a variable end with the numeric value 50. This is the upper limit for the loop.
4 VAR pad=4 Declares a variable pad with the value 4, meaning numbers will be padded with zeros up to 4 digits (e.g., 0005).
6 FOR i FROM ${start} TO ${end} STEP 5 Begins a for loop. The variable i starts from the value of ${start} (0) and increases by 5 each iteration until it reaches ${end} (50).
7 STRING ${prefix}${i.toString().padStart(pad,"0")} Constructs a string that combines the prefix ("ID-") with the current loop index i, converted to a string and padded with zeros to length 4. Example outputs: ID-0000, ID-0005, ID-0010, etc.
8 ENTER Simulates pressing the Enter key — often used in automation scripts (like AutoHotkey or UI.Vision RPA) to move to the next line or submit the value.
9 ENDFOR Marks the end of the FOR loop. After this point, the script continues normally.
11 IF ${end} > 50 Starts a conditional block: checks if the value of end is greater than 50. If true, executes the next commands inside the block.
12 STRING "Done past 50" Outputs the string "Done past 50". This only happens if the IF condition is true.
13 ENTER Again, simulates pressing Enter (e.g., to confirm or move to a new line).
14 ENDIF Marks the end of the IF statement.

EXAMPLE:

VAR start=0
VAR end=50
VAR pad=4

FOR i FROM ${start} TO ${end} STEP 5
  STRING ${prefix}${i.toString().padStart(pad,"0")}
  ENTER
ENDFOR

IF ${end} > 50
  STRING "Done past 50"
  ENTER
ENDIF

ANOTHER IDEA: BLUETOOTH DEVICE DETECTION (DETECT WHEN AN BLEUTOOTH DEVICE IS ONLINE)

Command Example Description
DETECT_FACE DETECT_FACE Trigger when a face is detected via camera module.
DETECT_ARM DETECT_ARM Trigger when a arm is detected via camera module.
DETECT_LEG DETECT_LEG Trigger when a leg is detected via camera module.
DETECT_HAND DETECT_HAND Trigger when a leg is detected via camera module.
DETECT_KEYWORD DETECT_KEYWORD "Start" or anything Voice trigger for ESP with mic module.
CLASSIFY_IMAGE CLASSIFY_IMAGE FILE="img.jpg" Run lightweight ML model on an image.
REPEAT_UNTIL REPEAT_UNTIL VAR Hello = True Repeat actions until a condition is met.
DISPLAY_MSG DISPLAY_MSG CONTENT="Hello!" Show text on attached display.
DISPLAY_IMAGE DISPLAY_IMAGE CONTENT="Hello.png" Show an image on attached display.
DISPLAY_VIDEO DISPLAY_VIDEO CONTENT="Hello.mp4" Show a video on attached display.
PLAY_MUSIC PLAY_MUSIC="sound.mp3" Play a music file.

Category Command / Keyword Description / Notes
Variables VAR Declares a variable. Use $ when referencing it.
$Test Example of using a variable.
Functions FUNCTION NAME() Starts a function.
END_FUNCTION Ends a function.
NAME() Calls a function.
LED / RGB Control LED_R / LED_G / LED_B / LED_Y / LED_W / LED_O / LED_P / LED_C / LED_M / LED_IR / LED_UV / LED_A / LED_V Controls LEDs by color.
BLINK_LED_ Blinks LED. Optional delay: BLINK_LED_V 200.
LED_STOP Stops blinking LED.
Button Commands IF_BUTTON_WAS_PRESSED Trigger action on press.
IF_BUTTON_WAS_HOLD Trigger action while held.
IF_BUTTON_WAS_HOLD_RELEASE Trigger action on long press release.
RUN_PAYLOAD Execute payload.
SET_BUTTON_PIN / PIN2 / PIN3 / PIN4 Assign GPIO pins to the button.

PLANNED: ESP LIGHT VERSION WEHRE THE HTML IS BAKED IN THE ESP FIRMWARE NOT REQUIRING A SD CARD.

Clone this wiki locally