Getting value from person and setting it in a text helper

Hello.
I need some help with Node Red.
I’m trying to get the value of a person (home, not_home) and set that value to a text helper.
The goal is to use the texthelper to trigger automations. This way I can easily test the automations since I can manually set the value.

The problem I’m facing it to set a helper value from node red.
I’ve tried with a function node setting Global.Set(“helper”, “home”).
I’ve tried just passing the value to a call service node to set the value but I cant see any change in the helper, even though it calls the service without errors.

[{"id":"a051d4955a40a87c","type":"inject","z":"d64a74a78258a2e5","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"away","payloadType":"str","x":130,"y":1240,"wires":[["5ef2ee23093a00aa","673fcd23781ea661"]]},{"id":"673fcd23781ea661","type":"api-call-service","z":"d64a74a78258a2e5","name":"","server":"47ca925f.1fe98c","version":5,"debugenabled":true,"domain":"text","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_text.peterlocation"],"data":"{\"value\":\"{{payload}}\"}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":380,"y":1240,"wires":[["bc9413881b13dc36"]]},{"id":"47ca925f.1fe98c","type":"server","name":"HomeAssistant","addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"","connectionDelay":false,"cacheJson":false,"heartbeat":false,"heartbeatInterval":"","statusSeparator":"","enableGlobalContextStore":true}]

This is the example of trying to inject “away” into a text helper named peterlocation.
I’m not sure what i’m doing wrong.

Managed to solve it by leaving the call service node blank and returning a msg.object that looked like this.

var msg = {
payload: {
domain: “input_text”,
service: “set_value”,
data: {
entity_id: entity,
value: value
}
}
}

You had the domain set to “text” but it should be “input_text”.