 
 #define SENSOR_ID "ALARM1"
 
-#define ALARM_RELAY_PIN        D6
- 
+#define ALARM_LED_RELAY_PIN        D5
+#define ALARM_BUZ_RELAY_PIN        D1 
 
 
 

#define MQTT_PORT 1883

//Constants
const char TV_STATE_OFF = 1;
const char TV_STATE_ON  = 2;
const char ALARM_ON  =  '2';
const char ALARM_OFF =  '1';

void processAlarmStateMsg(char* topic, byte* payload, unsigned int length)
{

  Serial.print("Checking if state topic");
  if(String(topic) == "ALARM1/cmd"){
	  Serial.println("Received Alarm change message");
       if ((char)payload[0] == ALARM_ON){
		    Serial.println("ALARM ON received");

			  switchAlarmOn();
			
	     }
       else if ((char)payload[0] == ALARM_OFF){
        Serial.println("ALARM OFF received");

        switchAlarmOff();
      
       }
		 else {

}


void switchAlarmLedOn(){
    
  Serial.println("Switching Alarm LED ON");
  digitalWrite(ALARM_LED_RELAY_PIN, HIGH);

}
void switchAlarmLedOff(){
    
  Serial.println("Switching Alarm LED OFF");
  digitalWrite(ALARM_LED_RELAY_PIN, LOW);

}
void switchAlarmBuzOn(){
    
  Serial.println("Switching Alarm BUZ ON");
  digitalWrite(ALARM_BUZ_RELAY_PIN, HIGH);

}
void switchAlarmBuzOff(){
    
  Serial.println("Switching Alarm BUZ OFF");
  digitalWrite(ALARM_BUZ_RELAY_PIN, LOW);

}
void loop() {
