Hey there,
I couldn’t find a way to reset the time input from hardware! reset button in app is awesome but I want to do it in code. my time input has start hour and start minute and that’s it. I tried
Blynk.vitualWrite(pin,NULL,NULL);
and some other stuff…
karower
December 18, 2018, 9:43pm
2
So, the following solution is a kind of a hack but it seems to work.
//individual time
BLYNK_WRITE(V8) { // Scheduler #7 Time Input widget
TimeInputParam t(param);
long startseconds = (t.getStartHour() * 3600) + (t.getStartMinute() * 60);
if (t.hasStartTime() && startseconds != 23280) {
long nowseconds = ((hour() * 3600) + (minute() * 60) + second());
int dayadjustment = -1;
if (weekday() == 1) {
dayadjustment = 6; // needed for Sunday Time library is day 1 an…
Hardware: nodemcu, WiFi
Using Blynk server
Blynk lib: 0.5.1
I am trying to update the days using Blynk.virtualWrite(V1, startAt, stopAt, tz, days);
When I am using strings like “1”, “1,2,3” it is working as expected.
What should be the string when I want to reset all the days (none of the days will be selected).
when I try " " or “” : nothing is updated.
when I try “0”:
Android does not deselect the days on the display (keeps the last “valid” days
IOS crashes permanently when I restart…
That’s not a proper solution but it kind of works.
Hey everyone,
Trying to duplicate the “reset” button action from the blynk app in time input.
My widget has no timezone or stopAt, just start time.
I tried,
Blynk.virtualWrite(V10,NULL);
But that does not seems to work.
Would love some advice! Thanks.
EDIT:
Also, there seems to be a problem in the app UI with updating the time input values from virtualWrite. I need to press the time input widget and go back to main screen for it to update.
Gunner
April 5, 2019, 9:25pm
4
@sahar540 Based on this topics eventual conclusion…
Oh… for crying out loud … OK, a bit of a face palm for myself… and big a “why the bleep didn’t you add in this little tidbit at the beginning” for you The widget DOES show either - -:- - or 00:00 depending on how you use the reset function…
In my limited defense, I really don’t use the Time Input Widget for my projects… nothing I use requires such specific timing… so while I did poke at the reset for the purposes as I described above, I never actually…
The “reset” is referenced by the parameter t.hasStartTime()
And based on the example link in the Docs for the Time Input Widget …
It seems there are multiple parameters to send
Blynk.virtualWrite(V1, startAt, stopAt, tz, days);
I would recommend trying something like this (untested!! - you will have to fiddle around with the syntax to get it right, if possible)…
Blynk.virtualWrite(V10, 0, 0); // for "resetting" startAt & stopAt
PS, I merged your current topic back into your past topic about same issue.
Gunner
April 5, 2019, 9:32pm
5
You might also wish to dig into the library file for that widget, for clues on how to reference its parameters…
To reset startAt and stopAt it should be -1 not zero for each of these params
1 Like
Gunner
April 5, 2019, 9:41pm
7
Thanks!! That clears up much!
This widget’s Documentation and examples need some tweaking. I don’t have the energy, inclination, or experience using it, but perhaps someone else can contribute.
1 Like