Issue with "reset" button in widget Time Input

Hi, I have a question about that button in the Blynk App. When I press it, the timer appears to be reset, but it sends “0” seconds to my program, so It saves it in the EEPROM. But I don’t want that to happen, because if I don’t want to set an hour to my program, it will saves it the same as if I set “00:00” to the timer. Is there any way to properly use the reset button? Thanks.

EDIT - just skip to the end… the correct answer often requires the correct questions :stuck_out_tongue:

It works as required… you either set a specific time or 00:00 there can be no “null time” in a process that sends start/stop info to the sketch. Like a Binary Solution Set, there is 0 or 1… there is no “”.

Since the Input timer simply sends a start and stop option, you need to write your code so that it accounts for all variables including your intended “nothing” and runs accordingly.

E.G. if you don’t want any action to happen, then code for such response when receiving 00:00 for BOTH start and stop

The problem is that I only use a “start” time, so “stop” is always zero. But well, I know how binary logic works, but I expected some kind of number out of boundaries, like, if 23:59 is the maximum time, being 85620 seconds, the reset could send 85621.

The reset is simply resetting the options in your time choices to a logical start point (midnight)… beats endlessly scrolling back and forth :wink:

Remember the Time Input Widget is simply that… “input”… no thinking, logic, calculation or so on… just simple options for start & stop of whatever your code wants to do.

Well, It’s not so simple like that, the hours and minutes that you put in the widget converts into seconds and then it sends it to your device. So a condition could be put in that process. Anyway, I sent a suggest to Blynk, maybe they take my feedback or not. Thanks for the replies.

Blynk.virtualWrite(Vx, startAt, stopAt, tz);

I am probably one of the first to critique Blynk for strange things they sometimes do… but I still don’t understand your request or need?

When comparing to the setting of any clock in the world that I have seen, analog or digital… You can move forward or backward in between 00:00 and 23:59 (I often wished for a quick way to reset to midnight, particularly on those ones that only scrolled in one direction :stuck_out_tongue: ) but there is NO “null” time. Nor would it make sense in any form of Time Input.

What you seem to require is a way to shut off the time… which since this widget is NOT a timer anyhow, perhaps you are looking at your need in the wrong perspective. As with any other clock with an optional alarm or timed option, there is a separate ON/OFF action, easily obtained with a button.

1 Like

Yeah, a button may simplify things, but well, the idea is just to nullified the input of time (like, if the widget shows “–:--” is because there si not a time setted, not even 00:00, maybe if the widget shows 00:00 instead of nothing, I wouldn’t have asked any question).
But well, there is not too much left to discuss about it.

Oh… for crying out loud :roll_eyes:… 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 :stuck_out_tongue_winking_eye: 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 SAVED the reset settings and thus never noticed what you only just now mentioned.

Therefore… if you actually want to use the reset as a null time for whatever reasons that you still haven’t made clear, then use the Boolean results from these two commands to determine if the Start/Stop time is - -:- - (there is a NULL after all :blush: just not in the actual time calculations) or 00:00 (midnight).

t.hasStartTime()

t.hasStopTime()

E.G…

BLYNK_WRITE(vPin) {   // Time Input widget Scheduler
  TimeInputParam t(param);
  if (t.hasStartTime() == 0) {
    // Start time is NULL
    // do NULL stuff
  } else {
    // Start time is valid number... including 00:00
    // do start time stuff
  }
}

Nah, I have nothing to complain about, things are how they are, your mockery is unnecesary. But I make it work. Thanks for your help. You got the info from docs.blynk?

1 Like

No prob. Just goes to show how asking a good question with details can quicken a good answer… but we got there anyhow. Not many chipped in so others might not have understood the issue any better.

No, not directly… it is a simple in principal, but complex in operation Widget, that confuses many (and documentation is weak there). I deduced it from digging into and tearing down the advanced example sketch and testing the separate code operations myself.

I don’t really know why you didn’t got it, but I’m not a the person who reads it, so I can’t say nothing. I though details were unnecesary. Thanks again.

Details are always necessary! I looked in the wrong direction because you kept insisting the resets relevance to the sent time settings and how it was sending the wrong datum, when in fact it was simply an ON/OFF switch. Something we both clearly missed :blush: Thus I only investigated based on that info… that was my bad.

But then us regulars answer a lot of these questions and we are often misled by missing info, so it gets frustrating. But this time I learned something I had previously never noticed about that widget… so I am happy :smiley: And it should help others in the future (if they ever search and read that is :wink: )

1 Like