How to change colour temperature

I have an i-shinfu tuya g9 bulb that I am having issues with,

In Node Red, I am attempting to change the color temperature using the jsondata “kelvin” attribute. I have successfully changed the brightness_pct in a previous node but keep getting a “HomeAssistantError: network error:(SYSTEM_ERROR) Server Error” for the kelvin change.

I can see in Tuya IOT platform debug device that using the Smart Home app does change the color temp attribute:

However, whatever I try in the node red call service node just results in the same error. A screen print of my node is below:

I have tried various versions of the kelvin value with double quotes, no quotes, and lots of different actual values but it does not work.

I have tried “color_temp_kelvin” but that did not change anything. Regardless of the actual Light integration names, the light turn_on service in the call service node is still expecting this to be entered as “kelvin” (see Property list).

2 potential possibilities come to mind:

  1. the specific Tuya light is not making the Color Temp dpid available to Home Assistant.

  2. the underlying code in the Call Service node is still using “kelvin” as the name of the attribute mapped in the Light integration. Seems unlikely as such an oversight would be affecting thousands.

Not sure how I can work this out.

Worked it out.

I used a script in visual editor mode to set the color temp to the lowest value. In the yaml, this was set to 2000. So, it was all about units. Position 0 in color_temp is 2000 and position 100 is 6500. So I made the mistake of using the color_temp percentages instead of what these related to in Kelvin. When I changed the value in nodered to anything between 2000 and 6500, it worked fine.

My fault for not realising I needed to convert the value.

1 Like

The only thing the data section expects is valid json. You can put whatever you want in there as long as it is formatted correctly it will deploy. When it is executed, you will get an error. That error is HA saying I don’t understand what you sent me, it’s not generated by NR.

Kelvin may work for now but at some point it will not. So if you want to leave it as kelvin keep in mind that it’s changed. color_temp_kelvin does work now, at least for me but I have a newer set of nodes. The example has not been changed in the newer version.