Node Red compare array

Hi All,
I thought this was going to be simple but not having much luck.
What i want is if the TV is paused and my lights are already a set color and brightness (set from a scene), then increase the brightness. If then the TV is unpaused then set brightness back down.

As this is from scene i know the values,
When TV pause is set, if light state on and brightness: 15 and rgb_color:[0,0,255]
Then set light brightness 255
When TV resumed if light state on and brightness: 255 and rgb_color:[0,0,255]
Then set light brightness 15

If this light was not already set to this scene then don’t change. (dull blue being move “Movie mode”)
The triggers are easy enough as doing on state changed, but i cannot get the if rgb_color:[0,0,255] to work, testing the strings or numbers are easy enough but i have not been able to work out how to compare against an array.

Any pointers as to which node(s) to use and how to set it would be great as tried all sorts of combinations.

I had to do a compare of 2 sensors as well. what i ended up doing was using 2 state change nodes, each fed into a function both of those functions fed into an and-gate node and then automate from there (node–red-contrib-bool-gate) there may be a better way to do it. but that is what worked for me.

Thanks, even in the function how do I compare array of rgb_color?

Not the OP also not using a function node but you can flatten the array with JSONATA in achange node and use switch node afterwards. something like this:

1 Like

worked perfectly, few more steps than i was thinking of as now using 3 node including current state then the suggested conversion. Just to see if light is blue.
Thank you very much