As you have installed the node-red-contrib-tuya-smart-device
to get / set the Tuya bulb you should be able to control it by sending
msg.payload = {"dps":"20","set":true}
and you should get back something like
{"data":{"dps":{"20":true},"t":1695071477},"deviceId":"bfed04c9d469db879doe2y","deviceName":"Smart Bulb 04"}
These are some of the DPs that work for my lamps
Version 3.3 - Light Type (RGB)
DPS Function Point Type Range Units
20 Switch bool True/False
21 Mode enum white,colour,scene,music
22 Bright integer 10-1000 % * 10
23 Color Temp integer 0-1000 1,000,000 / kelvins
24 Color hexstring h:0-360,s:0-1000,v:0-1000 hsv (s & v * 10)
this function converts an HSV colour to the hex string used by my Tuya lamps
/******************************************************************************
* Description Converts an HSV colour value to Tuya hexadecimal colour.
*
* Assumes Hue in set [0, 360], Saturation and Value in the set [0, 100] and
* returns Tuya colour as 12 character hexadecimal string
*
*
* @param {Object | number} hue - The hue as an integer or an HSV Object {hue, saturation, value})
* @param {number} [saturation] - The saturation
* @param {number} [value] - The value
*
* @returns {string} - A 12 character hexadecimal string as used by Tuya devices for colour
*
* Note: To convert RGB colour to Tuya colour use RGBtoHSV() as input
*/
function HSVtoTuyaColour(hue, saturation, value) {
// Note: hue = hue.hue MUST go last
if (arguments.length === 1) {
saturation = hue.saturation;
value = hue.value;
hue = hue.hue;
}
// Increase saturation & value to correct set [0, 1000]
saturation = saturation * 10;
value = value * 10;
return HSVtoHexStr(hue, saturation, value);
} // End Function HSVtoTuyaColour()
You will need to convert the zigbee RGB colour to HSV