Yurik72/ESPHap

NC relay/switch

Closed this issue · 1 comments

is it possible using the switch example to switch the relay from using NO to NC?

I think small changes will help you ,just change (inverse) value written to gpio
void set_switch(bool val){
Serial.println(String("set_switch:")+String(val?"True":"False"));
// digitalWrite(relay_gpio, val?HIGH:LOW);
digitalWrite(relay_gpio, val?LOW:HIGH);