@kacper_zet Try moving this code from receive to void loop and add a check to see if the status has changed from it's last state. Maybe then it will work for you. digitalWrite(message.getSensor()-1+RELAY_PIN, message.getBool()?RELAY_ON:RELAY_OFF); // Store state in eeprom //saveState(message.getSensor(), message.getBool()); // Write some debug info Serial.print("Incoming change for sensor:"); Serial.print(message.getSensor()); Serial.print(", New status: "); Serial.println(message.getBool()); If not then it might be HA relsted and I can't help with that.