Format for calculation in an "If State" field in a Current State Node

I would like to compare the current state to a calculated value (rather than a constant).

I have tried setting the If State to “>”, and then this JSONnata expression: 1000-$number($globalContext("input_number.heating_hysterisis"))

but the Expression editor says:
Argument 1 of function “number” does not match function signature

How can I do this simple calculation in the comparison field ?

$globalContext("input_number.heating_hysterisis") is return undefined because it doesn’t exist.

Either use the full path of the global context or $entities("input_number.heating_hystersis").state

1 Like

Thankyou very much Kermit, I got the “full path of the global context” to work, but using that expression with $entitites resulted in a “Attempted to use a non-function” error.
However, I’m on my way again :slight_smile:

For others who read this who might want to know what the calculation with the full path looks like:
1000-$number($globalContext("homeassistant.homeAssistant.states['input_number.heating_hysterisis'].state"))