 
 // Variables to be exposed to the API
 int           relayOn =               0;
-unsigned long relayOnSince =          0;
 int           computerOn =            0;
-unsigned long computerOnSince =       0;
 int           relayOffWhenPowerDown = 0;
 
 // Functions to be exposed to the API

  if (millis() > lastPowerCheck + POWER_CHECK_FREQUENCY) {
    if (relayOn && relayOffWhenPowerDown && !computerOn) {
      //It looks like we're shutdown, but lets make sure.
      delay(500);
      if (digitalRead(POWER_LED) == 0) {
        //OK then, power off Relay.
        delay(2000);


  // Expose variables to REST API
  rest.variable("relayOn",&relayOn);
  rest.variable("computerOn",&computerOn);
  rest.variable("relayOffWhenPowerDown",&relayOffWhenPowerDown);

  // Function to be exposed
