 void change_light()
 {
   digitalWrite(RELAY_PIN, bRelayState);
-  bUpdated = false;
 }
 
 void run_lightcmd_isr()

  pinMode(RELAY_PIN, OUTPUT);
  pinMode(BUTTON_PIN, INPUT_PULLUP);

  attachInterrupt(BUTTON_PIN, run_lightcmd_isr, RISING);

  ticker.attach(0.2, tick);


void loop()
{
  if ((millis() - lastRelayActionmillis) > BETWEEN_RELAY_ACTIVE)
  {
    bRelayReady = true;
  }
  else
  {
    bRelayReady = false;
  }

  if (bUpdated)
  {
    if (bRelayReady)
    {
      change_light();
      lastRelayActionmillis = millis();
      bUpdated = false;
    }
    else
    {
      bUpdated = false;
    }
  }

  if (WiFi.status() == WL_CONNECTED)
