Using mustache templates in the entity id field
[{"id":"0eee5ed698f079b5","type":"inject","z":"89650f988807e878","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":228,"y":128,"wires":[["32e4873d4f403529"]]},{"id":"32e4873d4f403529","type":"api-current-state","z":"89650f988807e878","name":"","server":"","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_select.which_light","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":470,"y":128,"wires":[["6b4b38e8e28c2d1c"]]},{"id":"6b4b38e8e28c2d1c","type":"api-call-service","z":"89650f988807e878","name":"","server":"","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["{{data.entity_id}}"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":730,"y":128,"wires":[[]]}]
https://zachowj.github.io/node-red-contrib-home-assistant-websocket/guide/mustache-templates.html
Using node input
[{"id":"0eee5ed698f079b5","type":"inject","z":"89650f988807e878","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":228,"y":128,"wires":[["32e4873d4f403529"]]},{"id":"32e4873d4f403529","type":"api-current-state","z":"89650f988807e878","name":"","server":"2dad33ee.42bf5c","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_select.which_light","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"data","propertyType":"msg","value":"{\t \"target\": {\t \"entity_id\": $entity().state\t }\t}","valueType":"jsonata"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":470,"y":128,"wires":[["6b4b38e8e28c2d1c"]]},{"id":"6b4b38e8e28c2d1c","type":"api-call-service","z":"89650f988807e878","name":"","server":"2dad33ee.42bf5c","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":730,"y":128,"wires":[[]]},{"id":"2dad33ee.42bf5c","type":"server","name":"Home Assistant","version":4,"addon":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"id","statusSeparator":"","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h12","statusTimeFormat":"h:m"}]
https://zachowj.github.io/node-red-contrib-home-assistant-websocket/node/call-service.html#input
Using JSONata inside the call-service node
[{"id":"0eee5ed698f079b5","type":"inject","z":"89650f988807e878","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":228,"y":128,"wires":[["6b4b38e8e28c2d1c"]]},{"id":"6b4b38e8e28c2d1c","type":"api-call-service","z":"89650f988807e878","name":"","server":"","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":[],"data":"{\t \"entity_id\": $entities(\"input_select.which_light\").state\t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":390,"y":128,"wires":[[]]}]