Entity in Node Red JSON

I’m trying to use a number helper as an input for my climate entity temperature setting in Node Red.

{"temperature": "15"}

in the “Data” section of a call service node works fine, but

{"temperature": "input_number.away_temperature"}

leaves me with an API error.

Can anyone help with using the value of a home assistant helper as an input into the service call node in Node Red?

Thanks

Make sure the Data field is set to Expression, rather than JSON

then try

{ "temperature":  $entities('input_number.away_temperature').state }

If you try to use the Test Tab in the editor it’ll say “Attempted to invoke a non-function” but it should still work.

Worked perfectly. Thanks

Ok, try to do something like that:
image
but with that line in json:

{ "temperature": $number($entities("input_number.zadana_temperatura").state) - 0.5 }

And got api error

I tried to use that in a debug node but this does not work:

You are attempting to use the special $entities() function. This function is specifically added to (most of) the WebSocket nodes, and will only work in those nodes. In the debug node, this returns ‘attempt to use an invalid function’ error.

An expression such as

{"temperature": $entities('sensor.bedroom_aircon_room_temperature').state}

works nicely when used inside, for example, the Current State node (eg in the output properties).

Thank you @Biscuit for the quick answer and explanation. I wanted to test first but works with current state node!