            * added blynk support
            * added minimumIdleTimer, to protect fan and heating/cooling elements
               from glitches
+ * changes in version 0.13:
+           * removing endOfCycleState since my HVAC does not need it
+           * adding time in notifications
 *******************************************************************************/
 
 #define PUSHBULLET_NOTIF "pushbulletGUST"

  if ( currentTemp >= (targetTemp + margin) ) {
    //Particle.publish(APP_NAME, "Desired temperature reached", 60, PRIVATE);
    Particle.publish(PUSHBULLET_NOTIF, "Desired temperature reached", 60, PRIVATE);
    thermostatStateMachine.transitionTo(endOfCycleState);
  }
}
void heatingExitFunction(){
  //Particle.publish(APP_NAME, "heatingExitFunction", 60, PRIVATE);
  Particle.publish(PUSHBULLET_NOTIF, "Heat off", 60, PRIVATE);
  myDigitalWrite(fan, HIGH);
  myDigitalWrite(heat, LOW);
  myDigitalWrite(cold, LOW);
}

void endOfCycleEnterFunction(){
  //Particle.publish(APP_NAME, "endOfCycleEnterFunction", 60, PRIVATE);
  myDigitalWrite(fan, HIGH);
  myDigitalWrite(heat, LOW);
  myDigitalWrite(cold, LOW);

  //start the timer of this cycle
  endOfCycleTimer = 0;
}
void endOfCycleUpdateFunction(){
  //time is up?
  if (endOfCycleTimer > END_OF_CYCLE_TIMEOUT) {
    thermostatStateMachine.transitionTo(idleState);
  }
}
void endOfCycleExitFunction(){
  //Particle.publish(APP_NAME, "endOfCycleExitFunction", 60, PRIVATE);
}


/*******************************************************************************
********************************************************************************

State initState = State( initEnterFunction, initUpdateFunction, initExitFunction );
State idleState = State( idleEnterFunction, idleUpdateFunction, idleExitFunction );
State heatingState = State( heatingEnterFunction, heatingUpdateFunction, heatingExitFunction );

//initialize state machine, start in state: Idle
FSM thermostatStateMachine = FSM(initState);
