Control Tuya smart home devices via cloud API.
tinytuya Python library installedTUYA_ACCESS_ID — Cloud project Access IDTUYA_ACCESS_SECRET — Cloud project Access SecretTUYA_API_REGION — Data center region (default: sg)The skill will not function if TUYA_ACCESS_ID and TUYA_ACCESS_SECRET are missing.
See SETUP.md for detailed installation and configuration instructions.
See references/api-reference.md for DP codes, color presets, HSV encoding, and device details.
Two scripts in scripts/:
ScriptPurposedevices_control.pyDevice controller — lights, plugs, sensors, any Tuya devicedevices_scan.pyLocal network device discovery
bash
python3 scripts/devices_control.py <device_id> <command> [args]
bash
python3 scripts/devices_control.py <device_id> on
python3 scripts/devices_control.py <device_id> off
python3 scripts/devices_control.py <device_id> color blue
python3 scripts/devices_control.py <device_id> white 750 80
python3 scripts/devices_control.py <device_id> brightness 50
python3 scripts/devices_control.py <device_id> preset warm 50
bash
python3 scripts/devices_control.py <device_id> status
python3 scripts/devices_control.py <device_id> detail
python3 scripts/devices_control.py <device_id> model
python3 scripts/devices_control.py <device_id> send bright_value 500
python3 scripts/devices_control.py discover
bash
python3 scripts/devices_scan.py [--timeout 10] [--verbose]
User input is always 1–100 (percentage). Scripts convert to Tuya range (10–1000) internally:
Available presets: red, orange, yellow, green, cyan, blue, purple, mauve, pink, warm, cool
warm and cool use white mode with temperature control. All others use HSV color mode.