Grab Light state and copy it to another light

Hi guys is it possible to take 3 states at once (brightness, color, on/off) from a current state node and send it to a call service node that it will change that 3 states at once . like copy it over to the other one when ever a ping is incoming?

node1
node 2

I dont know if i could do it with the data input in the service node or i need maybe a function node?
If anyone could help me with that i would be rly thankfull

Greetings

if you didn’t sort it out already:
option 1) you can create a scene on the fly based on one light and apply to another light via node red service calls.
option 2) by manipulating the payload with a change node, you can call a service with parameters. I only did for brightness and service but you can add the color as well in the change node.

[{"id":"8b648a5c.711c88","type":"inject","z":"de9989cc.589d18","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":360,"y":340,"wires":[["e1223542.628ae8"]]},{"id":"e1223542.628ae8","type":"api-current-state","z":"de9989cc.589d18","name":"","server":"e447d17a.16a64","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"light.study1","state_type":"str","state_location":"data.state","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":570,"y":340,"wires":[["6ba35180.6cfdd"]]},{"id":"ba0bad86.ee87d","type":"debug","z":"de9989cc.589d18","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":1210,"y":340,"wires":[]},{"id":"75431647.913698","type":"api-call-service","z":"de9989cc.589d18","name":"","server":"e447d17a.16a64","version":1,"debugenabled":false,"service_domain":"light","service":"","entityId":"light.entry","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1060,"y":340,"wires":[["ba0bad86.ee87d"]]},{"id":"6ba35180.6cfdd","type":"change","z":"de9989cc.589d18","name":"save battery to flow variable","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.service","pt":"msg","to":"\"turn_\" & data.state","tot":"jsonata"},{"t":"move","p":"data.attributes.brightness","pt":"msg","to":"payload.data.brightness","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":340,"wires":[["75431647.913698"]]},{"id":"e447d17a.16a64","type":"server","z":"","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false,"cacheJson":true}]
1 Like

Thx for that :smiley: