Timer widget Disable button

A “Disable” button for this widget would be useful.

Just add your own… we have to use code for that widget anyhow, what is another line or two :slight_smile:

BLYNK_WRITE(V0) {  // Timer Widget Enable Button
  widgetTimerEnable = param.asInt();
}

BLYNK_WRITE(V1) {  // Timer Widget
  widgetTimer = param.asInt();
  if (widgetTimer == 1 && widgetTimerEnable == 1) {
    // Do Timer ON stuff
  } else if (widgetTimer == 0 && widgetTimerEnable == 1) {
    // Do Timer OFF stuff
  } else {
    // do nothing
}
5 Likes

dont have any code running for that widget ?

Not sure what you mean… the basic Timer Widget just toggles a vPin (in my example, V1), so the above code will react to timer changes.

You can of course run a sync command to periodically check the timer pin status in case of device reboots, etc.

1 Like

Hi @Gunner -

First, my apologies for reviving an old post, but did not see a way to privately message you about this. Second, thanks, this post steered me in the right direction. I would like to take it one step further if at all possible. Please see my abbreviated version below as I did not need the second } else if { at this stage.

//COMPLEX TIMER//

BLYNK_WRITE(V10) 
{  // Timer Widget Enable Button
    widgetTimerEnable = param.asInt();
}

BLYNK_WRITE(V0) 
{  // Timer Widget
    widgetTimer = param.asInt();
  if (widgetTimer == 1 && widgetTimerEnable == 1) {
    // Place code here to run timer for i.e. 50% of the scheduled run time only. To be replaced with variable later.
    } else {
        int timer = param.asInt();
        digitalWrite(D7,timer);
    }
}
//COMPLEX TIMER//

The idea is to have a ‘Energy Saving Mode’ button that when enabled, run the timer i.e. 50% of the scheduled time. When disabled, normal run time resume.

Do you know whether this is possible?

Many thanks!
Friedl.

I use Timer widget to switch on/off virtual pins, which have the same functions as buttons for me - I can turn on/of physical device using buttons in app or Timer widget.

The thing is, that not always (not every day) I would like timer to turn on some devices - in that case it would be nice to have a setting in that widget which active/de-active it.

Example: start time 9:00, stop: 10:00, widget active / inactive.
The beset solution would be to have for Timer widget the same settings as for Time Input widget :wink:

So please, if it possible, could you add additional functionality in Adroid app for Timer widget?

The Time Input widget has the ability to select which days you want the timer to operate on, and the ability to be programmed via code (which the timer widget doesn’t) so using this you could (if it’s still necessary) add buttons to your app to override the settings.

I doubt very much whether the basic Timer widget will ever be updated, as it’s not worthwhile given that the newer Time Input widget provides better functionality.

Also, I’ve responded to your other ‘ideas’ post regarding the current development situation.

Pete.