request sketch for relay with button up/down (no push button)

  • This post is deleted!

  • Contest Winner

    @rayan said:
    If i do understand you correctly you want to toggle the relay when the switch is toggled regardless which state it is in?
    If so just remove the && state == LOW and the relay whill be toggled each time stateChagened toggles

    if ( stateChanged ) {
            if ( ledState == LOW ) {
              ledState = HIGH;
            } else {
              ledState = LOW;

Log in to reply

Looks like your connection to MySensors Forum was lost, please wait while we try to reconnect.