 {
   setTargetTemp(param.asStr());
 }
+
+String getTime() {
+ return " @" + Time.format(time, TIME_FORMAT_ISO8601_FULL);
+}

  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);
}


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

    currentTemp = tmpFloat;
    currentTempString = String(currentTemp);
    //Particle.publish(APP_NAME, "New current temp: " + currentTempString, 60, PRIVATE);
    Particle.publish(PUSHBULLET_NOTIF, "New current temp: " + currentTempString + getTime(), 60, PRIVATE);
    return 0;
  } else {
    //Particle.publish(APP_NAME, "ERROR: Failed to set new current temp to " + newCurrentTemp, 60, PRIVATE);
    Particle.publish(PUSHBULLET_NOTIF, "ERROR: Failed to set new current temp to " + newCurrentTemp + getTime(), 60, PRIVATE);
    return -1;
  }
}
