In the past I made light control project with wemos d1 mini (ESP8266), relay and act. But after two years something happening with wemos board ant I need to change it. So I decided use ESP EASY instead Arduino IDE for new wemos board.
In the proper operating system I can control light with physical switch on the wall and with Home assistant that means that I can turn On and off light how I want.
For the beginner it's not so easy make Rules configuration on ESP Easy, so I need help for it. I want to make this if else logic ( it is taken from the system that preceded ).
Code: Select all
if((GPIO12 == 1 && GPIO14 == 0)||(GPIO12 == 0 && GPIO14 == 1)){
if ( (msgString == "1")) {
digitalWrite(GPIO12,LOW);
}
if ( msgString == "0") {
digitalWrite(GPIO12,HIGH);
}
}
else{
if ( (msgString == "1")) {
digitalWrite(GPIO12,HIGH);
}
if ( msgString == "0") {
digitalWrite(GPIO12,LOW);
}
}
}