Read TimeInput widget

I need to read the TimeInput value at sketch starting like BLYNK_CONNECTED (or every time I need), not only ad BLYNK_WRITE, during values changes.
It’s possible to do? if not, this can be implemented?

I have the same issue, since it seems the Time Input Widget is.not synchronize during startup, and Blynk.syncAll() command doesn’t have any effect on this widget…

@naamah75 and @noersaleh the name of the widget TimeInput suggests to me that what you require should not be available i.e. it is for end users to change time schedules when they are using the app.

Does RTC not provide what you require?

Let me check. Should work. However I did not test it.

@Dmitriy I think syncAll struggles if there are more than a handful of pins to sync and can result in command skipped messages.

I sometimes use a one time timer to sync a few seconds after the initial connection has been made, which normally helps.

@Costas how many pins do you usually sync?

Less than 10 causes problems for me but I am calling separate sync’s as I don’t want to syncAll pins.

@Dmitriy an example with a 4M ESP would be something like this:

// on first boot up when it is busy doing lots of things
Blynk.syncVirtual(V0);
Blynk.syncVirtual(V1);
Blynk.syncVirtual(V2);
Blynk.syncVirtual(V3);
Blynk.syncVirtual(V4);
Blynk.syncVirtual(V5);
Blynk.syncVirtual(V6);
Blynk.syncVirtual(V7);
Blynk.syncVirtual(V8);
Blynk.syncVirtual(V9);
terminal.println("Connected");
terminal.flush();

With say the 10 pins to sync it sometimes skips the Terminal command
With say a few of the sync’s commented out it will run the Terminal command.

OKay… I will try…
Thanks

I tested sync here with a delay after first connection and received no response from the following extract (fine if I click TimeInput and press OK).

BLYNK_WRITE(V22) {    // time input widget, needs to be used with Time Library or RTC widget
               
  TimeInputParam time_input(param);
  // Process timezone
  Serial.println(String("Time zone: ") + time_input.getTZ()); // needs to be BEFORE Start and Stop time so times are adjusted for timezone
  // Process start time
  if (BlynkTime& t = time_input.getStart())
  {

    Serial.println(String("Start: ") + (t.hour() + (time_input.getTZ() / 3600)) + ":" + t.minute()); // seconds not used    + ":" + t.second());
  }
}
1 Like

Bug is reproduced. Fix will require new server update and new app update. That we will do this Saturday I think.

2 Likes

Dear Dmitriy,
is this bug fixed?
Is TimeInput widged full operational using the latest blynk library (master) and the latest Android blynk app ???
Thanks

@mikekgr Yes, however you may need to remove/add widget again.

I tried it (after remove/add widget) also but it did not triggered…
Anyway let me try more…

Thanks

If you have some issues - please create new topic.