Is it possible to change values of a input_boolean variable with just one Call-Service Node (Api-Call-Service).
A turn_on and turn_off call service node is normally used (two nodes) but when the number of input_boolean nodes are large, it would be “nice” if just one could do the task.
There’s a few ways, but the easiest would be either using a Function node in front of the call-service node or mustache templating in the call-service node.
For a Function node, you could do something like this:
var state = msg.payload;
msg.payload = {
domain: 'input_boolean',
service: 'turn_' + state,
entity_id: 'input_boolean.something'
}
return msg;
For mustache templating, in your service, you could set it to turn_{{payload}}.