   }
 }
 
+// Function that publishes birthMessage
+
+void publish_birth_message() {
+  // Publish the birthMessage
+  Serial.print("Publishing birth message ");
+  Serial.print(birthMessage);
+  Serial.print(" to ");
+  Serial.print(availabilityTopic);
+  Serial.println("...");
+  client.publish(availabilityTopic, birthMessage, true);
+}
+
 // Function that toggles the relevant relay-connected output pin
 
 void toggleRelay(int pin) {

    Serial.print("Publishing on-demand status update for ");
    Serial.print(door2_alias);
    Serial.println("!");
    publish_door2_status();
  }  
  else { Serial.println("Unrecognized action payload... taking no action!");

    Serial.print("Publishing on-demand status update for ");
    Serial.print(door1_alias);
    Serial.println("!");
    publish_birth_message();
    publish_door1_status();
  }
  else if (requestedDoor == mqtt_door2_action_topic && requestedAction == "OPEN") {
