BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Blynk Android Time Input Widget - Android display problem I observe

Hi Blynkers. The Blynk Time Input widget is my new best friend.

Not only can you set Start and Stop times by day of week, you can also use it as a time display.

When I write to the Blynk Time Input Widget using the documented parameters, it displays whatever times and days of week you wish. Terrific for displaying the day by day schedules you’ve inputted.

Using the Time Input Widget for data input works on iOS and Android.
Time Input as a display works on iOS, but seems to fail on Android.
The day of week display works, but the Start and Stop times do not display,
show dashes. --:-- --:–

I am using Blynk’s public servers. Blynk library 0.6.1.
I use Khoi Hoang’s fabulous Blynk_WiFiManager 1.2.0.
I am running Arduino IDE 1.8.13 on Win 10,
targeting Adafruit’s ESP32 Feather, using library 1.0.5.
Android 11 on a Google Pixel
iPad iOS 14.4

Here’s some code that writes to the Time Input widget. Thanks for the helpful doc, Blynk!
It was easy.

int revolvingDisplayDay = 1; // allows revolvingDisplay to cycle through each day on the Time Input Widget

#define SET_START_STOP_TIME_VPIN 2
#define SET_START_STOP_TIME_VPIN 3

void revolvingDisplay()
{
  Serial.println ( "\nrevolvingDisplay called..." );

  long startTime[7], stopTime[7]; 
  char tzone[] = "AmericaNew_York";

  // Display the current day's schedule on the Time Input Widget
  int today = weekday() - 1;   // using TimeLib, weekday() starts on Sunday. Blynk starts on Monday. Duh. 
  if ( today == 0 ) today = 7; // Sunday, Bloody Sunday

  Serial.print ( "in revolvingDisplay, today is = " ); Serial.print ( today );  
  Serial.print ( ", also showing day # " ); Serial.println ( revolvingDisplayDay );  

  String dayOfWeekString = String ( today );  
  Blynk.virtualWrite ( SET_START_STOP_TIME_VPIN, startTime [today-1], stopTime [today-1], tzone, dayOfWeekString ); 


  // Display a rotating day-by-day schedule on the Display Widget
  dayOfWeekString = String ( revolvingDisplayDay );    // revolvingDisplayDay starts at 1;  index starts at 0
  bool haveValidTimes = ! ( ( startTime[revolvingDisplayDay-1] == -1 ) 
                         || ( stopTime[revolvingDisplayDay-1]  == -1) 
                         || ( startTime[revolvingDisplayDay-1] == stopTime[today-1] ) );
  if ( haveValidTimes )
  {
    Blynk.virtualWrite ( DISPLAY_START_STOP_SCHEDULE_VPIN, startTime [revolvingDisplayDay-1], stopTime [revolvingDisplayDay-1], 
                         tzone, dayOfWeekString ); 
  } 
  else
  {
    Blynk.virtualWrite ( DISPLAY_START_STOP_SCHEDULE_VPIN, 0, 0, tzone, dayOfWeekString );     
  }
  // Revolve to beginning of week
  if ( revolvingDisplayDay >= 7 ) revolvingDisplayDay = 1; else revolvingDisplayDay++;
  
  Serial.println ( "revolvingDisplay done..." );  
}

It Would Be Nice if the Android version of your handy Time Input WIdget would show the start and stop times just as it does on iOS.

Thanks, all.