Jsonata $round function not working with entity

From my understanding this should be working. Anyone better with JSONata that could shed some light.

Basically I have the below code. “Zone” gets passed in on the msg.zone stream and “duration” is coming from an input.boolean entity. The problem is when running the flow I get “Invalid JSONata expression: Attempted to invoke a non-function”

   "id": zone,
   "duration": $round(

Just a quick look, $round takes a float as input not an array. Take the square brackets surrounding the $entities function.

That is how I tried it first but fails with same error.

   "id": zone,
   "duration": $round($entities("input_number.rachio_qrruntime_zone1").state)

What node are you using this in? $entities only works in the HA nodes.

You can get the value from the global scope if you’re using it in a non HA node.

That may be my issue then. I could have sworn I used it in a non-HA node before but makes complete since.