I want to turn on the lights with time input widget

hey Gunner i want same as you mention but how does it works?

I want to turn on the lights when mu time input widget will get equal to RTC widget but after that how can i turn light on for 12 hours? also motors on after 7 days and fan on for 3 hours periodically.

how can i achieve through the timer widget.

I recommend reading through this topic about that widget…

Thanks @Gunner i have used this code but the problem is that when

min() == STmin();

i just wanted to start lights for 12 hours.( if stop time is less than 12 hours it will go to off
{ if min()== SPmin();} but if it is not than by default it has to turn on for 12 hour and turn off for 12 hours.


fan should on 1 hour and off for 1 hour,

I did try your code but i can not justify where to put this things because the hour problem.

and also i’m confused about how my timer id will do this.

how can i use the timer library to operate the hour problems.

BlynkTimer and the Time Input Widget are two totally different things.

As for the rest, I suspect you need logic code to compare days as well as hours and minutes… but I cannot help you for a few reasons…

A) Not my project :stuck_out_tongue_winking_eye:

B) I actually rarely need to do any extensive Time Input Widget related stuff, so it would require my own re-learning of the process before I could assist properly :blush: assuming you had code to show.

And if you do have code, them post it properly here, in case someone else can give you some pointers.

this is my nodemcu code…

void startevent() {

  if (hour() == SThour) {                                                          /////////start hour /////////
    if (minute() == STmin  ) {  ///////////start min ///////////

    int lights =  timer.setTimer(10*1000L,lighton,NULL);

      int lightsoff =  timer.setTimeout(10*1000L,[](){
      Blynk.virtualWrite(V3, 0);
      Blynk.virtualWrite(V4, 0);
      Blynk.virtualWrite(V11, 0);
      Blynk.virtualWrite(V13, 0);
      Blynk.virtualWrite(V15, 0);
      node.l1 = 0;
      node.l2 = 0;
      node.l3 = 0;


    else if (minute() < STmin) {
      //Serial.print("Will be doing something soon");
    else if (minute() >= STmin) {
      //Blynk.notify("Please Enter Correct time");

ya i know timer widget and blynk timer is totally different but if i want to add Blynk timer library in to the timer widget

is it possible to do this?

as you have mentioned in this

or @Gunner can i add

if(min() ==  STmin() + 10) {  // is this ok for controlling things after 10 min.

// do something after 10 minutes

@Pranav, I appreciate that you think @Gunner is your new BFF, but I can assure you that if you tag him in every post you make the the feeling won’t be reciprocated :grinning:

This is a community of users who are passionate about Blynk, and who aim to support each other to get the best out of the product and to try to help make it better at the same time. Almost everyone here has stated with zero knowledge of C++ and Blynk, and have taught themselves - putting in days of effort to teach themselves via trial and error and research.
The community aims to take some of the pain out of that process, but you still have to do the research and the trial and error; then come back and share what you’ve learned with others.


1 Like

@PeteKnight thanks for your reply,
But i have research the topic many times today then i found gunner’s post and i replied him,

Also about BFF i think i had tagged you many times in my query, but rather than getting advice from you, I received your unprofessional comments , I’m sorry but i have found one such answer that gunner had posted that’s why i tagged him.

and If you don’t mind can YOU help me with this if you had tried before?

And here I thought I was the grumpy forum regular… I didn’t know Pete was such a character as well :rofl:

Pete is often much more diplomatic… so don’t tick him or me off or no one will even answer you again :wink:

1 Like

Clearly my comments have fallen on deaf ears, so I’ll step back and observe from a safe distance.


I don’t know who is grumpy forum regular,

But if Blynk is such a great platform why don’t you guys support . I think you have done more project i appreciate it . I’m sorry @PeteKnight if you get jealous.:wink:

But for next time @PeteKnight i will post as a new member.

Again @PeteKnight if you can support me through this question it will great full.


I don’t want get into this[quote=“Gunner, post:11, topic:32630”]
Pete is often much more diplomatic… so don’t tick him or me off or no one will even answer you again

I don’t want to get into this

I only want to learn always . So sorry if you get offended.

I’m also :joy:

Just to be clear… we are NOT Blynk staff… we are just Blynk users, like yourself, who started off knowing nothing about it and put in lots of time and effort to learn. We volunteer our services as we feel able and desire… not because of any obligation.