 //MQTT constants
 #define MQTTCLIENT_QOS2 1
 const char* mainTopic = "londonbridge";
-MQTT::QoS qos = MQTT::QOS2;
+MQTT::QoS qos = MQTT::QOS1;
 bool retained = true;
 
 //Room State

	//establish Ethernet connection
	Ethernet.begin(mac);
	//connect to MQTT broker
	connect();
	//set current room state to inactive
	currentRoomState = INACTIVE;
	publish("state", "inactive");
}

void loop() {
	if (!mqttClient.isConnected()) {
		connect();
	}
	checkSwitches();
}
	payloadlen = strlen(messageBuffer) + 1;

	//publish message
	Serial.print("Topic: ");
	Serial.println(topicBuffer);
	Serial.print("Message: ");
	Serial.println((char*)payload);
	int returnCode = mqttClient.publish(topicBuffer, payload, payloadlen, qos, retained);
	return returnCode;
}
