Read and Control an LED using thinger dashboard

Hi,

Is it possible to read the status of an LED and also control the LED using a switch in thinger dashboard?

The actual scenario is, I have an LED connected to one of the digital pin of nodemcu. And it is switching ON and OFF on a timely basis. i.e., 5mins ON & 5mins OFF. I would like to get the status of that LED on thinger on real time basis and also would like to control the LED at any instant of time.

Hi,

You may get the status of the led reading an output resource that will show it current state, something like:

thing["Led"] >> outputValue(digitalRead(ledPin);

At the dashboard you should create a led indicator widget and aim to that resource of that device:

image

And the display setting like this should work,
image

Note that each color has two values, that is the minimum and maximum, because this widget can be applied not just for boolean values, it works to show a color if the value is between that range.

Hope this helps.