   char c_payload[length];
   memcpy(c_payload, payload, length);
   c_payload[length] = '\0';
+  
+  Serial.printf("<- %s: %s\n", topic, c_payload);
+  
+  if (String(topic).endsWith("alarm")) {
+    alarm(String(c_payload).toInt());
+  }
+}
 
-  Serial.printf("<- %s: %s\n", topic, c_payload);
+void alarm(bool value) {  
+  digitalWrite(LED_BUILTIN, !value);
 }
 
 void loop() {

void setup() {
  Serial.begin(115200);

  sprintf(stationID, "%d", ESP.getChipId());

  setup_wifi();


const char* ssid = "ssid";
const char* password = "password";
#define LED_BUILTIN 2

const char* mqtt_server = "mqtt_server";

