Multiple attributes in call service node?

Hi everyone, I’m having an issue with setting a light’s brightness and color at the same time…

In the expression field, if I write this

{"rgb_color": data.event.new_state.attributes.rgb_color}

it applies the RGB color to the lamp and works fine, but if I set it to this:

{"brightness": data.event.new_state.attributes.brightness, "rgb_color": data.event.new_state.attributes.rgb_color}

it only applies the brightness without changing the color.

I don’t know much about this yet, I think there could be a syntax/order issue with the expression? Is this the right way of sending two commands at the same time?

Thanks,
Rodrigo

If setting the syntax to {"brightness": data.event.new_state.attributes.brightness, "rgb_color": data.event.new_state.attributes.rgb_color} doesn’t work, there could be a few other things that you could check:

  1. Make sure that the light is compatible with changing both its brightness and color. Some lights only support one or the other, and trying to change both at the same time might not work.

  2. Check the values of the brightness and rgb_color attributes. Make sure that the values being passed to the light are valid and within the acceptable range for those attributes.

  3. Check for any errors in your code that might be causing the issue. This could include syntax errors or other issues with the expression or the code that’s calling the expression.

1 Like

Thanks @bastero for your reply! I think it might be the first thing. I checked everything else, I copied the paths from debug nodes, and tested sending only the brightness or the RGB color data separatelt and they work, it only fails when I put them together.

R.