Visually optimize my flow to reduce the number of nodes used

Good morning and happy Sunday.

I have several (many) home assistant call service node to modify a value in Home Assistant entity. It works.
image

What I'm trying to do is visually optimize my flow.
I would like to be able to enter the dynamic "Data" field. So I can pass it values like, 48,49,50,51,etc ... and have only one generic node instead of 30 static ones.

The value circled in red would be dynamic

Do you have any idea how to pass these values to the nodes? In this example, I'm using an inject node to clarify my request
image
It doesn't work, but that's the final idea
Thanks

The JSONata would be

{"option": $$.payload}

Assuming the input is msg.payload. There should be no need for the value change node.

1 Like

and ... :musical_score: it works as suggested. That's just great.
Many thanks @E1cid for the quick and functional response

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.