How to detect no coming payload?

I want to check or detect on node-red when no payload is sent because I am connected to the sensor and accept the value I want to know when there is no information sent from the sensor as a warning or anything. How should I write the function when I try to do it myself? It didn't work as expected.

You can use the Trigger node for this. There is an example in the cookbook: https://cookbook.nodered.org/basic/trigger-timeout

Thx verry much!