Timer widget in New Blynk 2.0

In New Blynk 2.0, the timer widget has been replaced by automations. However, these automations cannot be changed in the same interface as the widgets are in. Looking up for the right automation and changing the times takes great effort when you have many. Using a time input widget instead is possible, but requires a massive need of programming.

Wouldn’t it be an idea to make it possible that the automation can be controlled by the virtual pin output of the time input widget?

That could be done by making it possible to choose a boolean or integer type instead of the string for the virtual pin, which then should be high when the timer is active and low when it is inactive.

In this way times can easily be changed in the basic IOT interface whereas the automations can be used to define the actions that should be taken on these specific times.

Virtual pin is not limited to string values; it can have int or double values as well

You already can use time input with automation:

  1. Set up Time Input with specific datastream
  2. Create ‘Device state’ automation
  3. Select device and time input datastream
  4. Choose condition “is equal to” your high value
  5. Add necessary actions
    as a result - when time input will set high value - automation will be in work
1 Like

Thank you very much for your response.

I set up a time input with a string datastream (as integer and double datastreams are not suitable for time input, as I understood), and created with this a device state automation where two integer datastreams which are related to a switch widget and a led widget should be activated when the time input equals 1. However, this does not function, Nothing happens with the switch nor the led.

Should I choose another number than 1 in the expression “when time-input datastream is equal to 1” or is there something else I am doing wrong?

I thought you were updating some int/double datastream from the hardware on the set time input dates

The problem is that the Time Input widget outputs an array of values including on time, off time (both in seconds since midnight), active on days of the week, sunrise/sunset active and timezone.

The MCU has to take this data and make some sense of it - working-out the current time and comparing it to the on/off time and checking if the device should use or ignore these values on the current day of the week - making timezone corrections as needed. If sunrise/sunset is chosen then these times have to be looked-up for the appropriate latitude and longitude and actioned as appropriate.

What you’re asking for is for the old Timer widget to be resurrected. This widget outputted one value at the On time and another at the Off time.

I do agree that Automations aren’t as useful for timed events as having a widget in the appropriate part of the mobile/web dashboard, in the same way as being forced to use the device tile approach as opposed to the project approach where widgets linked multiple devices could be added alongside each other.
But, that’s the current state of Blynk IoT and I guess we just have to live with it.

Pete.

1 Like

So if I understand well, this does nót work:

  1. Set up Time Input with specific datastream
  2. Create ‘Device state’ automation
  3. Select device and time input datastream
  4. Choose condition “is equal to” your high value
  5. Add necessary actions
    as a result - when time input will set high value - automation will be in work
1 Like

Yep, my fault, I’ve thought you already have some logic relying on time input start/stop that changes some int/double datastream.

We would not make automation controlled by time input for the simple reasons as we already have time-based triggers for automation. But we had in plan some automation improvements/section for device settings, maybe it will cover your problem

It would be nice if we can read the time set inside automation like we do with the time input widget like

t.getStartHour();
t.getStopHour():

This would be really good to have feature from blynk !

So the widjet Time Input on Blynk App what is it for?

Why is it not present as a widget on blynk desktop?

For inputting start/stop times, days of the week time zones etc, as I previously stated…

Very few of the mobile dashboard widgets are available on the web dashboard - take a look and compare them and you’ll see that for yourself.

Pete.

@FabrizioGiliberto if you have further questions about the time input widget versus automations in Blynk IoT then I’d suggest you start a new topic and provide as much detail about what it is that you are trying to achieve, and attempt to articulate your questions in a way that is easily understandable.

Pete.

Thanks
I wanted to update you that today sonk managed to use the time Input widget on esp32.Using the appropriate code I was able to get the time and date through the blynk server, subsequently inserted in the time inpunt widget as a string value via a pin. Inside the code I have set an output pin to manage a load. by selecting the time and day, when the hour is clicked set the pin goes up, when the selected stop timer exceeds the set value the pin out goes down. then you can use the timer input to manage projects by selecting the time and dates from your blynk app

So you seem to be saying that you are using the time input widget as designed?
I’m not sure how this relates to the first post in the topic.

Pete.

Just picking up on this thread as I have started transferring my legacy Blynk app to the new platform. It seems I should be able to use the Time Input widgets as I already do on Blynk legacy, but it is not clear to me how I specify a datastream for that virtual pin. My code retrieves params 0, 1 and 3, but the new Blynk only allows me to set the datastream type to a single Integer, double or String.

Use String.

Pete.

@FabrizioGiliberto
Could you share your project?
Well, I would like to learn how you managed to create this reading of blynk data