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

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

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