Widget timer input. Dias da semana

Olá eu utilizo o widget timer input para uma autorização de iluminação. Pois ele está acendendo a iluminação com todos os dias da semana desligado. Pois como eu faço para só funcionar nos dias da semana Selecionada.

You can try automation instead of the timer input widget.
https://docs.blynk.io/en/concepts/automations

Eu consigo determinar o dia da semana e hora pela automação via app

Yes.

Obrigado por responder. Eu utilizo 2 timer input para iluminação pois eu estou percebendo que 1 dos times input está acionando 2 vezes 1 no horário Ajustado outro fora de horário. Sendo que os 2 tem o mesmo código porém o que muda seria o virtual pin. O que poderia ser

Posting your whole sketch might help.

I believe sticking to automation would be more preferred approach.

Olá este e meu código pois ele esta acendendo na hora programada das 19:00 as 19:30. Sendo que ela acende sozinho sem alterar a hora do Timer input. Das 00:40 as 01:30.

[Unformatted code removed by moderator]

Post the whole sketch please.

@EduardoSantino when you post code to the forum you need to put triple backticks at the begin8ng and end of your code so that it displays correctly.

Triple backticks look like this:
```

Pete.

Obrigado pela dica dos acentos ``` agora sei o que é

Obrigado pelo retorno postarei um pouco mais tarde

Olá este e o código

#define BLYNK_PRINT Serial
#define BLYNK_TEMPLATE_ID "TMPLhSWCjVlR"
#define BLYNK_DEVICE_NAME "Automação Minha Casa"
#define BLYNK_AUTH_TOKEN ""

#include <SPI.h>
#include <Ethernet.h>
#include <BlynkSimpleEthernet.h>
#include <WidgetRTC.h>

#include <DHT.h>
#define DHTPIN 6 // Define em que pino está conectado o módulo DHT
#define DHTTYPE DHT11 // Define se o módulo conectado é o DHT11
#define corredor 7 // pino rele corrredor
#define Sala 9 // pino rele sala

char auth[] = "";

#define W5100_CS  10
#define SDCARD_CS 4

#define Lime "#00FF00" // cor dos leds
#define DeepSkyBlue "#00BFFF" // cor temp frio
#define GreenYellow  "#ADFF2F" // cor temp ideal
#define Red "#FF0000" // cor temp quente
#define Snow "#FFFAFA"
#define MediumSlateBlue "#7B68EE" //v7 V17 V

DHT dht(DHTPIN, DHTTYPE);

BlynkTimer timer; 
BlynkTimer temporizador; // Timer desliga sala

WidgetTerminal terminalcorredor(V3);
WidgetTerminal terminalsala(V8);

String displaycorredor;
String displaysala;

char Date[16];
char Time[16];

long startsecondswd;
long stopsecondswd;
long nowseconds;
long  slider;

int timercorredor;
int timersala;

BLYNK_CONNECTED() {

  Blynk.sendInternal("rtc", "sync");

  terminalcorredor.clear();
  terminalsala.clear();

  saudacao_sala();
  saudacao_corredor();

  Blynk.virtualWrite(V0, 0);
  Blynk.virtualWrite(V1, 0);
  Blynk.virtualWrite(V2, 0);
  Blynk.virtualWrite(V5, 0);
  Blynk.virtualWrite(V7, 0);
  Blynk.virtualWrite(V9, 0);
  Blynk.virtualWrite(V10, 0);
  Blynk.virtualWrite(V11, 0);
  Blynk.virtualWrite(V12, 0);
  Blynk.virtualWrite(V13, 0);
  Blynk.virtualWrite(V14, 0);
  Blynk.virtualWrite(V15, 0);
  Blynk.virtualWrite(V17, 0);
  Blynk.virtualWrite(V19, 0);
  Blynk.virtualWrite(V20, 0);
  Blynk.virtualWrite(V22, 0);
  Blynk.virtualWrite(V23, 0);
  Blynk.virtualWrite(V24, 0);
  Blynk.virtualWrite(V25, 0);
  Blynk.virtualWrite(V26, 0);
  Blynk.virtualWrite(V27, 0);
  Blynk.virtualWrite(V28, 0);
  Blynk.virtualWrite(V29, 0);

  Blynk.virtualWrite(V5, 1);
  Blynk.virtualWrite(V7, 1);
  
  timercorredor = 1;
  timersala = 1;



}

void programadiario() {

  if (year() != 1970) {

    if (timersala == 1) {

      Blynk.syncVirtual(V6); // sincr. v6 timer intupt
    }

    if (timercorredor == 1) {

      Blynk.syncVirtual(V4); // sincr. v4 timer intupt

    }
  }
}


void relogio() // relogio no display
{

  int gmthour = hour();
  if (gmthour == 24) {
    gmthour = 0;
  }

  String displayhour =   String(gmthour, DEC);
  int hourdigits = displayhour.length();
  
  if (hourdigits == 1) {
    displayhour = "0" + displayhour;
  }

  String displayminute = String(minute(), DEC);
  int minutedigits = displayminute.length();
  if (minutedigits == 1) {
    displayminute = "0" + displayminute;
  }

  String dia = String(day(), DEC);
  int diadigito = dia.length();
  dia = dia;


  String mes = String(month()); // mês
  int mesdigito = mes.length();
  if( mesdigito == 1){
    mes = "0" + mes;
    
  }

  String ano = String(year());

  displaycorredor = "Relógio:  " + displayhour + ":" + displayminute + "                         " + dia + " / " + mes + " / " + ano + "                            CORREDOR";
  Blynk.setProperty(V3, "label", displaycorredor);

  displaysala = "Relógio:  " + displayhour + ":" + displayminute + "                            " + dia + " / " + mes + " / " + ano + "                                  SALA";
  Blynk.setProperty(V8, "label", displaysala);

}

void resetTerminalSala()
{
  sala_auto();
}

void resetTerminalCorredor()
{

  corredor_auto();

}

BLYNK_WRITE(V5)  // timer corredor
{
  if (param.asInt() == 1) {

    timer.setTimeout(50, resetTerminalCorredor);

    timercorredor = 1;

    Blynk.setProperty(V5, "color", MediumSlateBlue);
    Blynk.virtualWrite(V11, 0);
    Blynk.virtualWrite(V2, 0);

  } else

    if (param.asInt() == 0) {

      timercorredor = 0;
      terminalcorredor.clear();
      saudacao_corredor();

      Blynk.virtualWrite(V0, 0);
      digitalWrite(corredor, LOW);

    }
}

BLYNK_WRITE(V4) // timer input sala
{
  if (timercorredor == 1) {

    sprintf(Date, "%02d/%02d/%04d",  day(), month(), year());
    sprintf(Time, "%02d:%02d:%02d", hour(), minute(), second());

    TimeInputParam t(param);

    int dayadjustment = -1;
    if (weekday() == 1) {
      dayadjustment =  6; // needed for Sunday, Time library is day 1 and Blynk is day 7
    }
    if (t.isWeekdaySelected(weekday() + dayadjustment)) { //Time library starts week on Sunday, Blynk on Monday

      terminalcorredor.println("               CORREDOR PROGRAMADO PARA HOJE");
      terminalcorredor.println();
      terminalcorredor.flush();

      if (t.hasStartTime()) // Process start time
      {
        terminalcorredor.println(String("ACENDE :  ") + t.getStartHour() + ":" + t.getStartMinute() + " Hrs");
        terminalcorredor.flush();
      }
      if (t.hasStopTime()) // Process stop time
      {
        terminalcorredor.println(String("APAGA :   ") + t.getStopHour() + ":" + t.getStopMinute() + " Hrs");

        terminalcorredor.println();
        terminalcorredor.println();
        terminalcorredor.flush();
      }

      for (int i = 1; i <= 7; i++) {  // Process weekdays (1. Mon, 2. Tue, 3. Wed, ...)
        if (t.isWeekdaySelected(i)) {
          //terminalsala.println(String("Day ") + i + " is selected");
          //terminalsala.flush();


        }
      }

      nowseconds = ((hour() * 3600) + (minute() * 60) + second());
      startsecondswd = (t.getStartHour() * 3600) + (t.getStartMinute() * 60);
      //Serial.println(startsecondswd);  // used for debugging
      if (nowseconds >= startsecondswd) {
        //terminalsala.print("Até você COMEÇOU em");
        //terminalsala.println(String(" ") + t.getStartHour() + ":" + t.getStartMinute());
        //terminalsala.flush();

        if (nowseconds <= startsecondswd + 90) {
          Blynk.setProperty(V0, "color", Lime);
          Blynk.virtualWrite(V0, 255);
          Blynk.virtualWrite(V14, 255);
        }
      }
      else {
        //terminalsala.println("Sem programação hoje");
        //terminalsala.flush();

      }
      stopsecondswd = (t.getStopHour() * 3600) + (t.getStopMinute() * 60);
      //Serial.println(stopsecondswd);  // used for debugging
      if (nowseconds >= stopsecondswd) {
        digitalWrite(Sala, LOW); // set LED OFF
        Blynk.virtualWrite(V10, 0);
        //terminalsala.print("Up to you STOPPED at");
        //terminalsala.println(String(" ") + t.getStopHour() + ":" + t.getStopMinute());
        //terminalsala.flush();
        if (nowseconds <= stopsecondswd + 90) {
          
          digitalWrite(corredor, LOW);
          Blynk.virtualWrite(V0, 0);

        }
      }
      else {
        if (nowseconds >= startsecondswd) {

          digitalWrite(corredor, HIGH);
          Blynk.setProperty(V0, "color", Lime);
          Blynk.virtualWrite(V0, 255);
          Blynk.virtualWrite(V14, 255);// teste
          terminalcorredor.println("                                    CORREDOR ACESO !");
          terminalcorredor.flush();

        }
      }
    }
    else {

      terminalcorredor.clear();
      terminalcorredor.println();
      terminalcorredor.println();
      terminalcorredor.println();
      terminalcorredor.println();
      terminalcorredor.println("                        CORREDOR SEM PROGRAMAÇÃO");
      terminalcorredor.println();
      terminalcorredor.println();
      terminalcorredor.flush();

    }
    terminalcorredor.println();
  }
}

void setup()
{

  Serial.begin(9600);

  pinMode(SDCARD_CS, OUTPUT);
  digitalWrite(SDCARD_CS, HIGH); // Deselect the SD card
  pinMode(Sala, OUTPUT);
  pinMode(corredor  , OUTPUT);

  Blynk.begin(auth);
  dht.begin();

  timer.setInterval(5000L, programadiario); // verifica a programação diaria
  timer.setInterval(5000L, temperatura); // leitura sensor temperatura
  timer.setInterval(1000L, relogio); // leitura relogio

}

void loop()
{
  Blynk.run();
  timer.run();
  temporizador.run();
}

To be honest with you, your sketch is a little bit messy.
I’d suggest that you rewrite your sketch from the very beginning, keeping it as simple as you can.

Ok vou re postar somente a parte do Timer input pois é ele que está dando bug sendo que ele é igual ao da sala só muda variaveis . Só este que liga 2 vez sem alteração de horário

BLYNK_WRITE(V4) // timer input sala
{
  if (timercorredor == 1) {

    sprintf(Date, "%02d/%02d/%04d",  day(), month(), year());
    sprintf(Time, "%02d:%02d:%02d", hour(), minute(), second());

    TimeInputParam t(param);

    int dayadjustment = -1;
    if (weekday() == 1) {
      dayadjustment =  6; // needed for Sunday, Time library is day 1 and Blynk is day 7
    }
    if (t.isWeekdaySelected(weekday() + dayadjustment)) { //Time library starts week on Sunday, Blynk on Monday

      terminalcorredor.println("               CORREDOR PROGRAMADO PARA HOJE");
      terminalcorredor.println();
      terminalcorredor.flush();

      if (t.hasStartTime()) // Process start time
      {
        terminalcorredor.println(String("ACENDE :  ") + t.getStartHour() + ":" + t.getStartMinute() + " Hrs");
        terminalcorredor.flush();
      }
      if (t.hasStopTime()) // Process stop time
      {
        terminalcorredor.println(String("APAGA :   ") + t.getStopHour() + ":" + t.getStopMinute() + " Hrs");

        terminalcorredor.println();
        terminalcorredor.println();
        terminalcorredor.flush();
      }

      for (int i = 1; i <= 7; i++) {  // Process weekdays (1. Mon, 2. Tue, 3. Wed, ...)
        if (t.isWeekdaySelected(i)) {
          //terminalsala.println(String("Day ") + i + " is selected");
          //terminalsala.flush();


        }
      }

      nowseconds = ((hour() * 3600) + (minute() * 60) + second());
      startsecondswd = (t.getStartHour() * 3600) + (t.getStartMinute() * 60);
      //Serial.println(startsecondswd);  // used for debugging
      if (nowseconds >= startsecondswd) {
        //terminalsala.print("Até você COMEÇOU em");
        //terminalsala.println(String(" ") + t.getStartHour() + ":" + t.getStartMinute());
        //terminalsala.flush();

        if (nowseconds <= startsecondswd + 90) {
          Blynk.setProperty(V0, "color", Lime);
          Blynk.virtualWrite(V0, 255);
          Blynk.virtualWrite(V14, 255);
        }
      }
      else {
        //terminalsala.println("Sem programação hoje");
        //terminalsala.flush();

      }
      stopsecondswd = (t.getStopHour() * 3600) + (t.getStopMinute() * 60);
      //Serial.println(stopsecondswd);  // used for debugging
      if (nowseconds >= stopsecondswd) {
        digitalWrite(Sala, LOW); // set LED OFF
        Blynk.virtualWrite(V10, 0);
        //terminalsala.print("Up to you STOPPED at");
        //terminalsala.println(String(" ") + t.getStopHour() + ":" + t.getStopMinute());
        //terminalsala.flush();
        if (nowseconds <= stopsecondswd + 90) {
          
          digitalWrite(corredor, LOW);
          Blynk.virtualWrite(V0, 0);

        }
      }
      else {
        if (nowseconds >= startsecondswd) {

          digitalWrite(corredor, HIGH);
          Blynk.setProperty(V0, "color", Lime);
          Blynk.virtualWrite(V0, 255);
          Blynk.virtualWrite(V14, 255);// teste
          terminalcorredor.println("                                    CORREDOR ACESO !");
          terminalcorredor.flush();

        }
      }
    }
    else {

      terminalcorredor.clear();
      terminalcorredor.println();
      terminalcorredor.println();
      terminalcorredor.println();
      terminalcorredor.println();
      terminalcorredor.println("                        CORREDOR SEM PROGRAMAÇÃO");
      terminalcorredor.println();
      terminalcorredor.println();
      terminalcorredor.flush();

    }
    terminalcorredor.println();
  }
}