Jsonata Expression Help

Can someone guide me where I am going wrong please?

I am trying to evaluate a humidity state of a bathroom sensor against another humidity sensor in the house using Jsonata within a stae node in node red. The two sensors aren’t quite calibrated with each other so was trying to put in an offset of (humidity sensor value + 5) * 1.05.

This is the expression but it’s not quite working:
‘$number($entities(“sensor.landing_humidity_sensor_humidity”).state + 8) * 1.05’

Is the expression correct please?

($number($entities("sensor.landing_humidity_sensor_humidity").state) + 8) * 1.05

The state is a string turn it to a number before trying to add 8 to it.

1 Like

Worked a treat! Thankyou.

fancy quotes. code usually doesn’t like fancy quotes.