Integration

Tuya

Control Tuya smart home devices from FaustBot.

Overview

The Tuya integration adds dedicated triggers and actions so you can build workflows around events, device state, or external updates.

Event Triggers

React to inbound events and status updates.

Action Effects

Send commands and automate responses.

Automation Hooks

Combine triggers with other plugins and scripts.

Setup

1

Enable the Plugin

Open FaustBot settings and enable the Tuya integration.

2

Connect Your Account or Device

Provide any required credentials or connection details.

3

Verify the Connection

Trigger a test action to confirm the integration is responding.

Connection Tips

Keep the service running and verify network permissions if the connection fails.

Triggers

  • Connection status changes (connected, disconnected, error).
  • Incoming events or webhook notifications.
  • State changes reported by the service or device.

Effects

  • Send commands or updates to Tuya.
  • Change device settings or activate presets.
  • Sync data into variables for other actions.

Scripting API

Use the CPH API to control Tuya directly from scripts.

Device Control

Device control
# Turn device on/off
CPH.TuyaTurnOn("Smart Plug")
CPH.TuyaTurnOff("Smart Plug")

# Toggle device state
CPH.TuyaToggle("Living Room Light")

# Check device state
is_on = CPH.TuyaIsOn("Smart Plug")

Light Settings

Light settings
# Set brightness (0-100)
CPH.TuyaSetBrightness("Bedroom Light", 80)

# Set color temperature (warm to cool)
CPH.TuyaSetColorTemp("Bedroom Light", 4500)

# Set RGB color
CPH.TuyaSetColor("RGB Bulb", 255, 100, 50)

Device Info

Device info
# Get all devices
devices = CPH.TuyaGetDevices()

# Get device status
status = CPH.TuyaGetDeviceStatus("Smart Plug")

# Get device properties
props = CPH.TuyaGetDeviceProperties("Smart Plug")

See the full API reference for all available Tuya methods.