MQTT Color item in rule not working

Hello,
I want to create a rule, that sends via mqtt when one of the defined items changes. The item SetMode is working (its a number item), but the color item (colorpicker) isnt working. There are no error messenges in my openhab.log, but when i change the state of the color item, there is a error in eventlog.

2019-10-12 13:42:57.829 [ome.event.ItemCommandEvent] - Item 'Color' received command 235,90,100
2019-10-12 13:42:57.900 [nt.ItemStatePredictedEvent] - Color predicted to become NULL

rule:

rule "led_nanoleaf"
        when
                Item Color changed or Item SetMode changed
        then
                var mode = (SetMode.state as Number).intValue
                var rgb = Color.state
                executeCommandLine("mosquitto_pub -d -t home/light/nanoleaf -m {0:"+mode+",2["+rgb+"]}")
end

What is the problem? Thank you guys

The Color item works in separated rule

rule "split_rgb_values"
        when
                Item Color received command
        then
                executeCommandLine("mosquitto_pub -d -t home/light/nanoleaf -m {0:1,2["+receivedCommand+"]}")
end

Why are you not using the mqtt binding if I may ask?

That’s not an error, but it is probably a clue.
I’m presuming the Item was state NULL before, so there is no change.

No change, no rule trigger.

My fault… Just changed to

Item Color received command or Item SetMode changed

I just changed my rule to

rule "led_nanoleaf"
        when
                Item Color received command  or Item SetMode changed
        then
                var mode = (SetMode.state as Number).intValue
                var rgb = Color.state
                        if(rgb == NULL){
                                rgb = "174,94,100"
                        }
                executeCommandLine("mosquitto_pub -d -t home/light/nanoleaf -m {0:"+mode+",2["+rgb+"]}")
end

Its sending via mqtt when I change the SetMode item and the Color item. The problem is, when Color item changed, it sends the rgb value that is initialized in "if rgb == NULL). I think there is a problem with

var rgb = Color.state

Why? Your events log told you your Item would be state NULL.

But when does your Item change state? Sending a command is not a state change; it may or may not cause a state change later.

What to use instead of Color.state? Are there better solutions to get the rgb-value to a variable?

What you have would be fine if your Item did have a value, a state.
Your underlying problem is that it does not, it has NULL.
You cannot fix that in your rule, you cannot get what is not there.

You can get your command, just as you did in your other rule.

In my view, you are focused on the wrong thing. Why is your Item staying NULL?

Also be aware that a Color Item stores the color as HSB, not RGB.

And as already asked, why are you not using the MQTT binding?