I’m trying to listen all port and showing same values to control their status HIGH or LOW. at current situation I m adding different text widgets for every individual ports I use. kind request is a common widget that checks every thing defined in user defined period. it ll make usage of dashboard more effecient.
and I insisting to request adding widget of pushbutton. it would be so useful while creating dashboard for controlling infrared remote controlled devices like air conditinar…etc
Edit: why Im asking these is I m currently working on fully automated home project. who knows I can make it commercial. if I will do it. I belive we can make partnership for projects
Not sure I have understood your first request, or at least what do you refer to make it more efficient (maybe easier to create the widgets?).
Will check to develop a push button to control a boolean resource, it should be easy. However it may not work as the user expect, due to the latency between pressing and releasing the button and the real change in the device. But sure I can manage to provide a feedback to the user
For your project I think it will be great the upcoming feature, that allows configuring triggers to react to events, sensor values, etc., and actuate over your things.
let me try to explain. when I add a text/value widget to dashboard I can only read from one pin of arduino. because of that I have to add as many as text /value widget to read from pins. that makes dashboard so crowd. to reduce widget quantity I m just asking if it is possible a widget that we can define multiple values form device pins and it will show on screen one pins value for defined time in seconds, then will show the other one itarationaly…
for example in same screen;
garden lights is open
wait for 10 sec
Garage Door is Closed
wait for 10 Sec
air conditionar is idle
.
.
.
etc
I think I understand your request now. If I understand it well, you want a widget that can iterate over different resource values, like a small screen that is reporting the state one after another. If this is your case, I think you can get it working right now with the current software.
First, define a new variable in your sketch, like
int lastReport = 0;
And then add a new resource that is reporting a different resource every time you read the state.
thing["state"] >> [](pson& out){
switch(lastReport){
case 0:
out = digitalRead(statePin1) == HIGH ? "Door Open" : "Door Closed";
break;
case 1:
out = digitalRead(statePin2) == HIGH ? "Garden Lights On" : "Garden Lights On";
// do no put break in the last case, so it will reset the last reported to 0
default:
lastReport = -1;
}
lastReport++;
};
This way, every time you check the resource, it will be providing the state of a different resource. So you can create a text widget in your dashboard that is checking this resource periodically, i.e. 10 seconds. You will see how it changes as I think that you want.
Not sure if I have explained it correctly. Let me know if this is what you are trying to get working