Is it possible to update a time input widget value from hardware side?

Hi,

How could I update time input widget value from hardware side? Should I use the HTTP RESTful API?
And what is the update value format?
Thanks a lot!

Do you want to change the start / stop trigger time or trigger day, or do you just want to activate the widget within the running code?

Hi, mainly I would like to reset the star / stop trigger time and day to another value from hardware. Thanks.

In general you can. But we have no docs for that :). Sorry.

Could you please give me a hint on how to do that?
In my project, when user put a “reset to factory default” command on hardware side, the hardware will reset all Blynk values to default setting include the time input widget. And I would like to sync some important values back to server side.
Is use HTTP RESTFul API the right direction?

I’ll provide you with additional info when I have free time.

I will be grateful for the help.

I was wrong. This is not yet supported. Sorry.

Some updates here?

@ivanlee1007 @Costas good news. This should work already.
Added basic sketch - https://github.com/blynkkk/blynk-library/commit/05846eb10fdd0ac74621b08c1e57234cebc42b54#diff-3b72f05a8e52cc2666e731dcd2135d72

1 Like

@Dmitriy doesn’t look to be working. Rebooting an ESP with some of your code doesn’t visibly change the appearance of the Time Input widget in the Android app. Any server, library or app updates required?

Nope. Should work. @BlynkAndroidDev FYI.

This sketch is currently not supported, you need to send all values, have you tried:

Blynk.virtualWrite(V1, startAt, stopAt, tz, days, “100”);

Android app checks for 5 values amount in the time input hardware write

@BlynkAndroidDev I was trying with all 5 fields entered. App crashed a little while ago (doing some GPS stuff) and I noticed when it came back up TimeInput was correct. Tried again to change details in the sketch but no change in the app.

Closing the app and reopening it seems to be the fix. Presumably it should update the widget without having to close the app.

Let me try a slightly better phone.

No, it should work on any device, but now it supports receiving only 5 params, as it sends on editing: start, stop, timezone, days (I’ve check it should not be empty, it’s bug), and timezone offset (here you could use any integer value).

Next release (we planned to release it soon, but at now moment we are still testing it) will contains possibility to send only start, stop and timezone for TimeInput

1 Like

@BlynkAndroidDev it all seems to work fine except the visual update in the app. The server and MCU are being updated but not what you see in the app. If you kill the app and reopen it then the updated TimeInput settings are visible.

Strange, but OK, in next release it will be fixed.
In my case next code had worked with updating UI also:

  int value = param.asInt();
  int startAt = 5 * 60;
  int stopAt = (60 + 5) * 60;
  char tz[] = "Europe/Kiev";
  char days[] = "1,2,3";
  Blynk.virtualWrite(V1, startAt, stopAt, tz, days, 100);