You now have 3 threads all on the same topic....
tell me which one you want to use in preference and I will lock the others to stop others getting confused.
I use this thread. I testing another way for my problem but i still in the same, the way i´m used is this:
[image.png]
My function is programmed like this:
if (typeof msg.payload === 'number') {
msg.payload = true;
} else {
msg.payload= false;
}
return msg;
When I run the program this gives me the following values of msg.payload:
14/02/2019, 09:45:01[node: test function](http://10.6.4.101:1880/#)ns=2;s=SensorIndutivo : msg.payload : boolean
true
14/02/2019, 09:45:01[node: value …
You have the delay set to 500 milliseconds so it will send one then 0.5 seconds later it sends the other. You need to set the timeout larger than the normal time between samples.
Also you do not want to send ON or OFF to the Join node, that should still be connected direct to the sensor.