ajcooper72
(Aidan Cooper)
January 30, 2020, 10:26am
1
I’m trying to write a flow where the call service node’s entity_id is defined by a prior function, but no matter what I try I can’t seem to get it to accept the input.
I’m leaving the entity_id field empty on the call service node, and have tried both a template and a function node to set the entity_id.
Can anyone supply an example of achieving this?
serkank
January 30, 2020, 10:43am
2
service node should have the entity_id setup like this: {{payload.entity_id}}
[{"id":"99e3547d.2a7b88","type":"inject","z":"294e4f5f.46b07","name":"","topic":"","payload":"{\"entity_id\":\"light.living_room_middle\"}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":170,"y":180,"wires":[["afa86036.9ebfd"]]},{"id":"afa86036.9ebfd","type":"api-call-service","z":"294e4f5f.46b07","name":"","server":"e447d17a.16a64","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"{{payload.entity_id}}","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":370,"y":180,"wires":[[]]},{"id":"e447d17a.16a64","type":"server","z":"","name":"Home Assistant","legacy":false,"hassio":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false}]
1 Like