GPIO Output Actions
GPIO Output Actions
Overview
GPIO output actions are used to control the level state and lighting effects of digital output peripherals (relays, LEDs, buzzers, etc.).
Action Types
| Action | actionType | Description |
|---|---|---|
| ACTION_HIGH | 0 | Set high level |
| ACTION_LOW | 1 | Set low level |
| ACTION_HIGH_INVERTED | 13 | Logic high (physical low level) |
| ACTION_LOW_INVERTED | 14 | Logic low (physical high level) |
| ACTION_BLINK | 2 | Blink (actionValue=interval ms) |
| ACTION_BREATHE | 3 | Breathing light (actionValue=cycle ms) |
Parameter Description
| Field | Description |
|---|---|
| targetPeriphId | Target GPIO output peripheral ID |
| actionType | Action type number |
| actionValue | Action parameter (blink interval/breathing cycle, unit: ms) |
| useReceivedValue | When true, use trigger received value instead of actionValue |
| syncDelayMs | Delay before execution (ms, max 10000) |
Configuration Examples
Method 1: Web Interface Configuration (Recommended)
The peripheral execution page is shown below. When configuring GPIO actions, verify the target peripheral, active level, and whether inverted mode is needed.
Example 1: Output High Level (Turn On Light/Relay)
Scenario: Turn on a relay or LED
Configuration Steps:
Edit the rule in the Peripheral Execution Management page
Click the Add Action button
Fill in the action configuration:
Field Value Description Action Type Select High Level Output high Target Peripheral Select relay1GPIO output peripheral Execution Delay 0Execute immediately Click the Save button
Example 2: Output Low Level (Inverted Mode, for Low-Level Trigger Relay)
Scenario: Control a low-level triggered relay module
Configuration Steps:
Edit the rule, add an action
Fill in:
- Action Type: Select Logic High (Inverted)
- Target Peripheral: Select
relay1 - Note: Logic "ON", physical output LOW
Click Save
💡 Tip: Low-level triggered relay modules require inverted mode; logic "ON" corresponds to physical LOW
Example 3: LED Blink (500ms Interval)
Scenario: LED flash alert during alarm
Configuration Steps:
Edit the rule, add an action
Fill in:
- Action Type: Select Blink
- Target Peripheral: Select
led1 - Blink Interval: Enter
500(500 milliseconds)
Click Save
Example 4: Breathing Light (2-second Cycle)
Scenario: LED smooth gradient effect
Configuration Steps:
Edit the rule, add an action
Fill in:
- Action Type: Select Breathing Light
- Target Peripheral: Select
led_pwm(requires PWM output peripheral) - Breathing Cycle: Enter
2000(2000ms = 2 seconds)
Click Save
💡 Tip: Breathing light requires a PWM output peripheral (type: 17); plain digital output is not supported
Method 2: JSON Configuration File Import
Inverted Mode Description
For low-level triggered relay modules:
- Turn on relay = Physical low level → Use
ACTION_HIGH_INVERTED(13)(logic "ON", physical LOW) - Turn off relay = Physical high level → Use
ACTION_LOW_INVERTED(14)(logic "OFF", physical HIGH)
Precautions
- Peripheral Type Matching: targetPeriphId must point to a GPIO_DIGITAL_OUTPUT(12) type peripheral
- Blink/Breathe Prerequisites: Requires peripheral to support PWM function (blink can be used with plain digital output, breathing requires PWM)
- Delay Orchestration: Use syncDelayMs to achieve timing control for sequential multi-action execution
