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 received](http://10.6.4.101:1880/#)ns=2;s=SensorIndutivo : msg.payload : number
32.82964323001333
in the dasboard the led when it is true is green but when the sensor stops sending data it does not turn red (value false). The msg.payload of value received when sensor stops not send any value and not turn to red.
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.
cut/paste the output from the first debug node - i.e. what is going into your function - and how often it goes in when working - and what is the time to say it is no longer arriving. (IE what is the repeat time on your inject node)
I should think a simple trigger node would work fine if it's just got to light up an led if configured correctly
Which is what I have been saying all along of course, @smalhao was nearly there but then went off at a tangent again instead of asking if he did not understand the suggestions.
I apologize, in fact I did not understand the suggestions, in particular the way the Trigger applied, the next time I do not understand the suggestions and how to apply them I will ask how the blocks apply, only recently I started programming in Node- Red and I have some difficulty understanding the functions of library blocks because I have little experience of programming with Node-Red.
I wanted to ask about the dashboard, is that when it refresh alone the browser, "Connection Lost" appears, and i have the server connected. I would like to ask what could be this error and solutions? I've been looking and no see anything.
Best to start a new thread for that. When you do so give us more information about where the server is running, what you are running the browser on are they both on the same local network and so on.