@@ -0,0 +1,1075 @@
+from time import sleep%0Afrom threading import Thread%0Aimport paho.mqtt.client as mqtt%0A%0AMQTT_ADDRESS = %22localhost%22%0A%0A%0A%0A# The callback for when the client receives a CONNACK response from the server.%0Adef on_connect(client, userdata, flags, rc):%0A    print(%22Connected with result code %22+str(rc) + %22%5Cn%22)%0A%0Adef on_message(client, userdata, msg):%0A    print(msg.topic+%22 %22+str(msg.payload) + %22%5Cn%22)%0A%0Adef ecsMqttMonitor():%0A    mqttClient = mqtt.Client()%0A    mqttClient.on_connect = on_connect%0A    mqttClient.on_message = on_message%0A    mqttClient.connect(MQTT_ADDRESS)%0A    mqttClient.subscribe(%22ECS/temp%22)%0A    mqttClient.loop_forever()%0A   %0A    %0Adef calendarMonitor():%0A    while True:%0A        print %22second thread%22%0A        sleep(1)%0A        %0Adef heatMgr():%0A    mqttClient = mqtt.Client()%0A    mqttClient.on_connect = on_connect%0A    mqttClient.on_message = on_message%0A    mqttClient.connect(MQTT_ADDRESS)%0A    mqttClient.loop_start()%0A    %0At = Thread(target=ecsMqttMonitor, args=())%0At.start()%0At2 = Thread(target=calendarMonitor, args=())%0At2.start()%0At3 = Thread(target=heatMgr, args=())%0At3.start()

add ECS manager that will hold all threads