                 phase = IDLE;
                 if (roofState == STOPPING)
                 {
-                    logger("STOPPED");
+                    logger("STATE=STOPPED");
                     roofState = STOPPED;
                 }
                 else if (roofState == OPENING)
                 {
-                    logger(String("OPENED,DURATION=") + (millis()-moveStartTime));
+                    logger(String("STATE=OPENED,DURATION=") + (millis()-moveStartTime));
                     roofState = OPEN;
                 }
                 else if (roofState == CLOSING)
                 {
-                    logger("TIGHTENING");
+                    logger("STATE=TIGHTENING");
                     phase = CLOSE_TIGHTLY;
                 }
             }

            roofState = CLOSED;
            phase = IDLE;
            encoderPosition = 0;
            logger(String("CLOSED,DURATION=") + (millis()-moveStartTime));
        } else if (roofState != CLOSED && roofState != OPEN) {
            roofState = ERROR;
            phase = IDLE;

        motorShield.setM1Speed(0);
        motorShield.setM2Speed(0);
        if (phase != IDLE) {
            logger("CMD=EMERGENCYSTOP");
        }
        phase = IDLE;
        roofState = STOPPED;
