Czy wolisz polską wersję strony elektroda?
Nie, dziękuję Przekieruj mnie tamwhat is the solution?
Key points
• Build the scene (“Tap-to-Run” or “Automation”) with four separate actions per lamp in the order above.
• If several lamps are used, repeat the same four actions for each device (or for the group, if the firmware supports grouped mode changes).
• For advanced control (Home Assistant, MQTT, TinyTuya, OpenBeken) send the same parameter block in a single JSON payload.
Operating states in Tuya RGB(W) lamps
• Power (dp 20 or 1) ON / OFF
• Mode (dp 21 or 2) white
, colour
, scene
, music
• Brightness (dp 22 or 3) 0-100 % (or 0-1000 in raw)
• Colour temperature (dp 23 or 4) 2700-6500 K (white mode only)
• Colour (dp 24 or 5) Hex-encoded HSV or HSB string (colour mode only)
Why colour scenes often fail
• The phone UI lets you pick a colour, but if Mode remains on its last value (often white
) the bulb firmware ignores the incoming RGB string.
• Tuya’s cloud shrinks a “one-click colour” into a single compressed command, so if any parameter is missing the lamp defaults to previous values.
Scene construction inside the Tuya / Smart-Life app
a) Smart → Tap-to-Run → “Launch Tap-to-Run”.
b) THEN → Add task → Run the device → Lamp X
• Switch → ON (saves the power state)
• Mode → Colour (crucial)
• Colour → pick colour wheel or type RGB/HSV
• Brightness → set global intensity
c) Repeat for every lamp (or for a pre-made group).
d) Save → give scene a name → test.
Home Assistant / LocalTuya example (one JSON call)
service: localtuya.set_dp
data:
device_id: 1234567890abcdef
dp: 1
value: true # power
---
service: localtuya.set_dps
data:
device_id: 1234567890abcdef
dps:
20: true # switch
21: "colour" # mode
24: "00ff0000ffff" # Tuya HSB HEX (H,S,V,R,G,B)
22: 255 # brightness (0-255)
tuya-cli set --id --key --dps 21 colour --dps 24 00ff00ffff
• New Tuya Wi-Fi firmwares (1.0.7+ in WBx chips) tighten cloud packet size; colour + brightness often must be in a single packet—LocalTuya ≥ 5.0 has a helper for this.
• Matter-over-Wi-Fi is arriving on some 2024 Tuya modules; once certified, colour scenes will be exposed as standard Matter “OnOffLight” clusters.
• Tuya’s developer console now documents the “colour_data” JSON field allowing direct HSV or RGB hex input; third-party apps (e.g., Tuya IoT Platform → Cloud Functions) can call it.
• HSV vs RGB in Tuya: internally the bulb stores colour as 6-byte HSB hex (HHSSBB
, each 0-255). Example for pure orange: FF8032
becomes FF8032FFFF
when padded to 6 bytes.
• Brightness duplication: HSB “V” already contains brightness, but most TUYA firmwares still need dp 22 brightness—setting both prevents unpredictable dimming.
• Groups: only lamps with identical firmware types can form a native group that accepts a single colour packet; otherwise send commands per lamp.
• Flashing custom firmware (OpenBeken, Tasmota) violates Tuya’s EULA and may void CE/FCC conformity; keep original binaries and follow RF exposure limits.
• Automations that change colour based on camera or sensor events must respect local privacy laws (GDPR, CCPA).
• Always secure local API keys—Tuya keys allow full device control.
Potential challenges & mitigation
• 2.4 GHz Wi-Fi congestion → move bulbs to guest SSID or channel 1/6/11.
• Out-of-range colours (deep reds on cheap RGB-only bulbs) → pick lower saturation or upgrade to RGBCCT lamps.
• Exact datapoint numbers vary with OEM firmware; diagnose with TinyTuya -dps
scan first.
• Some very low-cost bulbs use 3-channel PWM without separate white LED—colour accuracy is limited and can’t render warm whites while in colour mode.
• Evaluate new ESP-QCloud Tuya modules that speak Matter-bridge for native HomeKit/Google integration.
• Study “Adaptive Lighting” (Apple) or Circadian-Lighting (HASS) to blend CCT and RGB automatically.
• Follow Tuya Developer docs: “Standard instruction set of lights (dj)” and “Colour Temp Configure” for upcoming extended gamut commands.
To guarantee a Tuya RGB(W) lamp lights in the exact colour you want, always transmit a full state package: Power ON → Mode Colour → Colour value → Brightness. Implement this either through four explicit tasks per device in the Smart-Life scene editor, or a single JSON packet when using LocalTuya, TinyTuya, MQTT, or custom firmware. Firmware differences, cloud packet limits, and Wi-Fi latency are common pitfalls; staying up-to-date and testing each bulb individually ensures predictable, repeatable colour scenes.