Node-RED exec node output to HA sensor/input_text

I have a simple task to read the output from a shell command, which gives me a temperature value.
Struggling how to make it a sensor input. Here is my node and the debug. Debug shows the value as it does during the command line execution, but whenever I connect call service node to input the value into an input_text field, it fails. Besides, any way to parse to value to get rid of β€œC” (Celsius) and input it not to input_text but to a normal sensor value?



Try {β€œvalue”:"{{payload}}"}

You can use the String Node to strip off the β€œC” character as well as convert the string to a Float value.

1 Like

Thanks for your response! I solved it with a function node (split_temperature on the pic below) and the following code:

var parts = msg.payload.split(" ");
msg.payload = parseFloat(parts[0]);
return msg;