JSONata If state fails for Events state node

Hi,

I´m having an issue with an events state node.

I want to send out payload only if sensor “dwd_forecast_tempmax” is greater than “cover_temp_min”.

So i created an if state JSONata:

$entities("sensor.dwd_forecast_tempmax").state > $entities("input_number.cover_temp_min").state

Today dwd_forecast_tempmax was about 7, cover_temp_min was 18 and the node reported true.

What is my fault?

image

States coming from Home Assistant are almost always strings. Need to convert them to numbers to compare them.

$number($entities("sensor.dwd_forecast_tempmax").state) > $number($entities("input_number.cover_temp_min").state)

perfect! Works like a charm. Thank you!
image