Hi! I delete / if was the problem but, seria no launch Here.
I try ==, equals, c.str()...
if (Serial2.available()) {
String tempString = "";
String respuesta = "";
while (Serial2.available() > 0) {
char receivedChar = Serial2.read();
if (receivedChar == '\n') {
respuesta = tempString;
tempString = "";
Serial.println(respuesta);
delay(1000); // Print the received message in the Serial monitor
} else {
tempString += receivedChar; // Append characters to the received message
}
}
respuesta.remove(0, 1);
Serial.println(respuesta);
if (respuesta == "/sube_persiana") {
//persiana
knx.groupWriteBool("2/0/0", 0);
}
if (respuesta == "/baja_persiana") {
//persiana
knx.groupWriteBool("2/0/0", 1);
}
if (respuesta.equals("enciende_luz_dormitorio")) {
//dormitorio
Serial.println("Here");
bool xd = true;
knx.groupWriteBool("1/0/1", xd);
}
if (respuesta == "/apaga_luz_dormitorio") {
//dormitorio
Serial.println(respuesta);
knx.groupWriteBool("1/0/1", 0);
}
if (respuesta == "/enciende_luz_salon") {
//salon
knx.groupWriteBool("1/0/0", 1);
}
if (respuesta == "/apaga_luz_salon") {
//salon
knx.groupWriteBool("1/0/0", 0);
}
}
}