Help using payload from previous node - Home assistant nodes

Hi,

I just started trying node red out with home assistant, but I don't really understand how to create flows.
I'm trying to setup a flow to change the color of a light bulb depending on it's current color (to cycle through a few favourites easily from a hue light switch). Here is what I have so far :

[{"id":"b6ea14f1.63f2c8","type":"api-current-state","z":"5114ad7.ae7af54","name":"","server":"3624259f.a9b772","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"light.0x0017880103ac8bc9_light","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":400,"y":560,"wires":[["a5faa7af.e81e4"]]},{"id":"11497e10.12b34a","type":"inject","z":"5114ad7.ae7af54","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":100,"y":560,"wires":[["b6ea14f1.63f2c8"]]},{"id":"a5faa7af.e81e4","type":"function","z":"5114ad7.ae7af54","name":"","func":"if (JSON.stringify(msg.data.attributes.rgb_color) == JSON.stringify([128, 128, 128]))\n{\n    msg.payload = [0, 0, 0];\n}\nelse\n{\n    msg.payload = [128, 128, 128];\n}\n\nnode.warn(msg.payload);\n\nreturn msg;","outputs":1,"noerr":0,"x":710,"y":560,"wires":[["ee38cfed.4987b"]]},{"id":"ee38cfed.4987b","type":"api-call-service","z":"5114ad7.ae7af54","name":"","server":"3624259f.a9b772","version":1,"service_domain":"light","service":"turn_on","entityId":"light.0x0017880103ac8bc9_light","data":"{\"rgb_color\": {{payload}}}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":970,"y":560,"wires":[["68e19db6.128094"]]},{"id":"68e19db6.128094","type":"debug","z":"5114ad7.ae7af54","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1220,"y":500,"wires":[]},{"id":"3624259f.a9b772","type":"server","z":"","name":"Home Assistant","legacy":false,"hassio":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true}]

This does not work however : "Call-service API error. Error Message: extra keys not allowed @ data['0']"
I know that error usually means you're trying to define your object wrong, like having data inside of data, but I don't think that's what I'm doing here. The {{payload}} syntax was found in other posts here and on the HA forums, maybe that's just not how to do it.
Any tips would be appreciated !
Thanks

Welcome to the community, you don't say which node you are using which is kind of important. I'd suggest editing the title ( the little pencil icon) to include this so that anyone who is familiar with that node is able to notice your post

I'm using the home assistant nodes, I added that

Hi,

Noone has any ideas on this ?

Well this is the Node-RED forum not the Home Assistant forum so while there are some HA users here, there may not be many who have detailed knowledge of it.