 // MQTT server deliveres data to the Domoticz server running on a same Raspberry Pi
 {
 
-  // Create MQTT topic and convert it to char array
-	String topicStr = "/actions/domoticz/";
-	topicStr.concat(topicID);
-	topicStr.toCharArray(topic, topicStr.length()+1);
-
 	// Convert payload to char array
 	payload.toCharArray(msg, payload.length()+1);
 

		Serial.println();
	}
	else
		Serial.println(F("Publishing to MQTT broker failed..."));
}

// mqttCallback function handles message arrived on subscribed MQTT topic(s)
void mqttCallback(char* topic, byte* payload, unsigned int length) {

  Serial.println("MQTT callback received");

  //Create a String from the received payload (char array)
  String callBackPayload = "";
  int i;

  for (i = 0; i < length; i++)
	{
		//Serial.print((char)payload[i]);
		callBackPayload += (char)payload[i];
	}

  // Act according to received payload
  if (callBackPayload == "On") // Siren to be set On
  {
	  Serial.println(F("Siren turned On"));
	  digitalWrite(sirenPin, HIGH);
	  Alarm.timerOnce(sirenWatchDogTimer, sirenOffFunction); // Timer is set which will turn off siren after sirenWatchDogTimer period has elapsed
  }
  else if (callBackPayload == "Off" && digitalRead(sirenPin) == LOW) // No actions needed if siren is already off
  {
	  Serial.println(F("Siren is already off. No actions needed!"));
  }
  else if (callBackPayload == "Off") // Siren to be set Off
    {
  	  sirenOffFunction();
    }
  else // Not valid state. No actions to be taken
  {
	  Serial.print(F("Following not valid data received. No actions to be taken:"));
	  Serial.println(callBackPayload);
  }
}


    }

	//Publish payload to MQTT broker
	if (mqttClient.publish(MQTT_TOPIC, msg))
	{
		Serial.print("Following data published to MQTT broker: ");
		Serial.print(topic);
