Sorry to reawaken this super helpful thread.
I’m trying to create a similar flow - looking at the above I think I had the same issue - I’m ending up with “None for dictionary value”
I’ve posted my node red flow below - to try and tackle the issue I’ve split out my R G B values and trying to pull them into the data field. But still getting the error
I’m wondering if it’s as simple as the way I’m trying to grab the payload values is incorrect?
{"rgb_color": ["{{msg.payloadr}}", "{{msg.payloadg}}", "{{msg.payloadb}}"]}
I’ve tried with the quotes and curly braces none seem to work 
Anyone able to help?
[{"id":"405c45f5.97d48c","type":"function","z":"3aa4bb1d045b93c0","name":"change rgb","func":"var i = flow.get(\"i\");\nvar red = Math.round(Math.sin(0.3*i + 0) * 127 + 128);\nvar green = Math.round(Math.sin(0.3*i + 2) * 127 + 128);\nvar blue = Math.round(Math.sin(0.3*i + 4) * 127 + 128);\n\ni++;\nif (i>=32) {\n i = 0;\n}\n\nflow.set(\"i\", i);\n\nmsg.payload = {};\nmsg.payload.data = {};\nmsg.payload.data.rgb_color = \"[\" + red + \", \" + green + \", \" + blue + \"]\";\nmsg.payload.data.r = red;\nmsg.payload.data.g = green;\nmsg.payload.data.b = blue;\n\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":690,"y":320,"wires":[["93f6beb4.23847","6401153b187820c9"]]},{"id":"c0a79053.feb99","type":"inject","z":"3aa4bb1d045b93c0","name":"","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":360,"y":320,"wires":[["af891aa6.6452f8"]]},{"id":"af891aa6.6452f8","type":"function","z":"3aa4bb1d045b93c0","name":"set var","func":"flow.set(\"i\", 0);\n\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":530,"y":320,"wires":[["405c45f5.97d48c"]]},{"id":"93f6beb4.23847","type":"delay","z":"3aa4bb1d045b93c0","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":700,"y":400,"wires":[["405c45f5.97d48c"]]},{"id":"6a933fa0.e02d5","type":"api-call-service","z":"3aa4bb1d045b93c0","name":"Cycle","server":"3aa13fed.bf745","version":7,"debugenabled":false,"action":"light.turn_on","floorId":[],"areaId":[],"deviceId":[],"entityId":["light.0xa4c138710fc49807"],"labelId":[],"data":"{\"rgb_color\": [msg.payloadr, msg.payloadg, msg.payloadb]}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"light","service":"turn_on","x":1110,"y":340,"wires":[[]]},{"id":"6401153b187820c9","type":"change","z":"3aa4bb1d045b93c0","name":"","rules":[{"t":"set","p":"payloadr","pt":"msg","to":"payload.data.r","tot":"msg"},{"t":"set","p":"payloadg","pt":"msg","to":"payload.data.g","tot":"msg"},{"t":"set","p":"payloadb","pt":"msg","to":"payload.data.b","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":900,"y":320,"wires":[["6a933fa0.e02d5","8a58af81d8c0283e"]]},{"id":"8a58af81d8c0283e","type":"debug","z":"3aa4bb1d045b93c0","name":"debug 21","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payloadr","targetType":"msg","statusVal":"","statusType":"auto","x":1080,"y":220,"wires":[]},{"id":"201e0e17a4b81d6f","type":"inject","z":"3aa4bb1d045b93c0","name":"","props":[{"p":"rese","v":"","vt":"date"},{"p":"reset","v":"reset","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":470,"y":400,"wires":[["93f6beb4.23847"]]},{"id":"3aa13fed.bf745","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30,"areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]