ok, I don’t have this set up so I’ll give you something so you get the idea.
YAML example for set_color, disregard the other stuff:
mesita:
friendly_name: Mesita
turn_on:
- service: nodered.trigger
data:
skip_condition: true
output_path: true
entity_id: switch.nodered_mesita_from_ha_to_nr
turn_off:
- service: nodered.trigger
data:
skip_condition: true
output_path: false
entity_id: switch.nodered_mesita_from_ha_to_nr
set_color:
- event: mesita_changed
event_data:
h: "{{h}}"
s: "{{s}}"
color_template: "({{states('sensor.hue_mesita') | int}}, {{states('sensor.saturation_mesita') | int}})"
Then in NR
[{"id":"aff607db67440919","type":"server-events","z":"9d6232bd.2dfe7","name":"","server":"9405c3fe.d0a6c","version":2,"eventType":"mesita_changed","exposeToHomeAssistant":false,"eventData":"","haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"waitForRunning":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"$outputData(\"eventData\").event_type","valueType":"jsonata"}],"event_type":"","x":330,"y":520,"wires":[["ebf63d2bd8a8bbeb"]]},{"id":"1856e4583239ab5c","type":"color-convert","z":"9d6232bd.2dfe7","input":"hsv","output":"hex","outputType":"string","scaleInput":false,"x":710,"y":520,"wires":[["b5cbf8ef7abbadbb"]]},{"id":"ebf63d2bd8a8bbeb","type":"change","z":"9d6232bd.2dfe7","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"[payload.event.h,payload.event.s,100]","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":540,"y":520,"wires":[["1856e4583239ab5c"]]},{"id":"b5cbf8ef7abbadbb","type":"alexa-remote-routine","z":"9d6232bd.2dfe7","name":"","account":"7c02d978.c2de98","routineNode":{"type":"node","payload":{"type":"serial","children":[{"type":"smarthome","payload":{"entity":"069402ac-566f-4694-853e-694ce6accdd4","action":"setColor","value":{"type":"msg","value":"payload"}}}]}},"x":920,"y":520,"wires":[[]]},{"id":"9405c3fe.d0a6c","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},{"id":"7c02d978.c2de98","type":"alexa-remote-account","name":"","authMethod":"proxy","proxyOwnIp":"192.168.1.29","proxyPort":"1234","cookieFile":"/config/.storage/authentication","refreshInterval":"3","alexaServiceHost":"alexa.amazon.es","amazonPage":"amazon.es","acceptLanguage":"es-ES","onKeywordInLanguage":"on","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Safari/605.1.15","useWsMqtt":"on","autoInit":"on"}]
That grey node is color-convert, you’ll need it to convert from Hue,Saturation to HEX: node-red-contrib-color-convert