Manage a NaN value

Hello, how can I manage the NaN value coming from a Home Assistant sensor?
It happens when I restart HA.


Welcome to the forum.

Could you please rephrase the question ?
Does the HA node produce the NaN and you want to capture/block that message ?

Yes, I want to trigger an action in the case the value is NaN.

Why don’t you add a switch and tested to see if it’s a number then you can take your action after that

ehm, yep, of course

if ( isNaN(msg.payload))

does the job

....need a coffee.


1 Like

I don't think you can do it with a Switch node, because, paradoxically, NaN is in fact a Number.
Unless it can be done using JSONata

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.