need help with EspAlexa Library to turn on off relay
Project detail
I am using Espalexa library on Nodemcu (ESP8266). Project is working and being detected by Alexa (Echo Dot 4th Gen). Echo responding with OK, status of device is also shown as ON in mobile app, but neither the relay trigged nor LED is ON. I have following code to trigger relay and led:
void firstLightChanged(uint8_t brightness) {
if (brightness == 255){
Serial.print(“Device 1 ON”);
digitalWrite(LED1, HIGH);
digitalWrite(RELAY_PIN, HIGH);
}
else
{
Serial.print(“Device 1 Off”);
digitalWrite(LED1, LOW);
digitalWrite(RELAY_PIN, LOW);
}
I have also declared the Relay Pin and LED1, but its not working.