void userAutoSave() { 
  EVERY_MS(600000) { 
    if (eeprom_flag) {
//      EEPROM.write(77,EFFECT);
      EEPROM.write(71,FIRE_STEP);
      EEPROM.write(72,HUE_START);
      EEPROM.write(73,MIN_BRIGHT);
      EEPROM.write(74,MAX_BRIGHT);
      EEPROM.write(75,FIRE_DELAY);
      EEPROM.write(76,OFFflag);
      FOR_i(0,col_alarms) {
        EEPROM.put(100+i*10,alarms[i].on_off);
        EEPROM.put(101+i*10,alarms[i].alarm_time);
        EEPROM.put(105+i*10,alarms[i].alarm_action);
        EEPROM.put(107+i*10,alarms[i].flags.flags);
      }
      EEPROM.commit();
      eeprom_flag=false;
    }
  }
}

void usertimeClientupdate() { 
    EVERY_MS(3600000) timeClient.update(); 
}

void userWiFiReconect() { 
   EVERY_MS(600000) { 
    if (WiFi.status() != WL_CONNECTED) {
      WiFi.disconnect();
      WiFi.begin(AP_SSID, AP_PASS);
    }
  }  
}


void userTimeRead() {
  EVERY_MS(1000)
  { 
    hour   = timeClient.getHours();
    minute = timeClient.getMinutes();
    dayofweek = timeClient.getDay();
    FOR_i(0,col_alarms) alarms[i].alarm_start(hour,minute);
    hub_update();
  }
}
