 
   //setup input
   pinMode(SONOFF_INPUT, INPUT);
-  attachInterrupt(SONOFF_BUTTON, toggleInputState, CHANGE);
+  attachInterrupt(SONOFF_INPUT, toggleInputState, CHANGE);
 
   //setup relay
   //TODO multiple relays

  switch (cmd) {
    case CMD_WAIT:
      break;
    case CMD_BUTTON_CHANGE:
      int currentState = digitalRead(SONOFF_BUTTON);
      if (currentState != buttonState) {
        if (buttonState == LOW && currentState == HIGH) {

          startPress = millis();
        }
        buttonState = currentState;
      }}
      break;

  }
