Skip to content

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 ​

ActionactionTypeDescription
ACTION_HIGH0Set high level
ACTION_LOW1Set low level
ACTION_HIGH_INVERTED13Logic high (physical low level)
ACTION_LOW_INVERTED14Logic low (physical high level)
ACTION_BLINK2Blink (actionValue=interval ms)
ACTION_BREATHE3Breathing light (actionValue=cycle ms)

Parameter Description ​

FieldDescription
targetPeriphIdTarget GPIO output peripheral ID
actionTypeAction type number
actionValueAction parameter (blink interval/breathing cycle, unit: ms)
useReceivedValueWhen true, use trigger received value instead of actionValue
syncDelayMsDelay before execution (ms, max 10000)

Configuration Examples ​

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:

  1. Edit the rule in the Peripheral Execution Management page

  2. Click the Add Action button

  3. Fill in the action configuration:

    FieldValueDescription
    Action TypeSelect High LevelOutput high
    Target PeripheralSelect relay1GPIO output peripheral
    Execution Delay0Execute immediately
  4. 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:

  1. Edit the rule, add an action

  2. Fill in:

    • Action Type: Select Logic High (Inverted)
    • Target Peripheral: Select relay1
    • Note: Logic "ON", physical output LOW
  3. Click Save

💡 Tip: Low-level triggered relay modules require inverted mode; logic "ON" corresponds to physical LOW


Scenario: LED flash alert during alarm

Configuration Steps:

  1. Edit the rule, add an action

  2. Fill in:

    • Action Type: Select Blink
    • Target Peripheral: Select led1
    • Blink Interval: Enter 500 (500 milliseconds)
  3. Click Save


Example 4: Breathing Light (2-second Cycle) ​

Scenario: LED smooth gradient effect

Configuration Steps:

  1. Edit the rule, add an action

  2. Fill in:

    • Action Type: Select Breathing Light
    • Target Peripheral: Select led_pwm (requires PWM output peripheral)
    • Breathing Cycle: Enter 2000 (2000ms = 2 seconds)
  3. 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 ​

  1. Peripheral Type Matching: targetPeriphId must point to a GPIO_DIGITAL_OUTPUT(12) type peripheral
  2. Blink/Breathe Prerequisites: Requires peripheral to support PWM function (blink can be used with plain digital output, breathing requires PWM)
  3. Delay Orchestration: Use syncDelayMs to achieve timing control for sequential multi-action execution

FastBee | fastbee.cn