Weird Function Output

I put a 5 second delay between inject and trigger. It works fine now.

I put the following line above the return line:

global.set('ktop',ktop);

I think my last reply is the answer to this. If I remove ground or signal wire, it sends a message with no payload. This is the same thing with the original problem I had. So, maybe it is related to wiring issues, since I am working with a breadboard. When I remove power, it reads 85 degrees (C).

So why not add a switch node to see if msg.payload exists? If it does, send it on, if it doesn't then drop it.