The LED Widget in my dashboard is constantly "pale". It is linked to a boolean variable, that toggles between 0 and 1 periodically (which I verified in the variable window). I would expect the LED widget to toggle between intensive green and red.
On the other hand the Status Widget works as expected linked to the same bool variable.
Hm, isn't it enough, that I have a Thing with a variable, that changes periodically (each 2 seconds)? This boolean variable (0/1) is enough to toggle the color of the "Status widget" in the same IoT dashboard. Why does the same fail with the "LED widget"?
I have no own Arduino code in my Thing, so I can't show anything, sorry
The left in the screenshot is a LED widget. It is linked to the same Boolean Variable as the right STATUS widget. So in this snapshot the green LED should be ON and not the red.
BTW, in the meantime I tested another browser (Chrome on Android 12) without success.
... tried to find help in the technical-reference, but to me it reads both widgets visualize "the status of something":
The LED widget is a virtual LED that can signal the status of something. Can either be set to ON or OFF.
Can be linked with a boolean variable.
An example of how it is used in a sketch:
ledVariable = true;
//or
ledVariable = false;
The status widget is great for checking the state of something: green is positive, red is negative!
Can be linked to a boolean variable.
An example of how it is used in a sketch:
statusVariable = true;
//or
statusVariable = false;
Assuming the LED widget is not having a grave bug at the moment, this "something" is not only the status of the boolean variable (else it would work). What more then? Is the LED widget trying to communicate with the remote device or the Arduino Agent websocket and is waiting for a state change from there?
Sorry for speculating, probably I just don't understand the widget concept.
Okay, I give up. In my opinion based on this thread the Arduino LED widget can't signal just the state of a bool IoT Cloud Variable.
It would be nice to see a new widget in the future of your project, that works identically to the Status widget, but would have a non-quadratic, round lamp/LED shape. I propose the name "StatusLED widget" for example.
@eclipse1985 Please see my answer on Mar 15, sorry.
But your question seems to implicate, that the color of a LED widget depends on the sketch on the hardware device, and not only on the state of the corresponding Variable in your cloud. That wouldn't be good news :-(. But better than not knowing how the LED Widget concept works at all, thank you.
May I ask, if you tested linking the LED widget AND the Status widget to the same bool Variable?
The color of the LED widgets depends only on the variable state, so it's not strictly dependent on the sketch code. I have the two widget types (LED/Status) linked with the same variable, and it works, so it's really strange that it doesn't work for you. Can you write me an email (f.mirabito@arduino.cc) specifying your thing ID so I can have a deeper look?
@signuptoarduino I managed to find your data flow on our backend, I can reproduce the issue and we are working on a fix (looks like a bug on our side). Please keep the board connected, I'll let you know soon.
@signuptoarduino we have figured out the cause of the problem. Basically, you are sending 0 and 1 values instead of true and false, and this was causing the bad behavior of the LED widget. However, we have fixed the LED widget in order to accept 0 and 1 as well, so now everything should work as expected. Please check and let me know !