 const int timeZone = 9;
 time_t prevDisplay = 0;
 
+// send reset info
+String getResetInfo;
+int ResetInfo = LOW;
+
 void ICACHE_RAM_ATTR callback(char* intopic, byte* inpayload, unsigned int length);
-WiFiClient wifiClient;
-PubSubClient client(mqtt_server, 1883, callback, wifiClient);
+WiFiClientSecure sslclient;
+PubSubClient client(mqtt_server, 8883, callback, sslclient);
 WiFiUDP udp;
 
-volatile bool bnest_isr = false;
-
-void ICACHE_RAM_ATTR nest_isr() {
-  bnest_isr = true;
+volatile bool bnest_isr_cool = false;
+volatile bool bnest_isr_heat = false;
+
+void ICACHE_RAM_ATTR nest_isr_cool() {
+  bnest_isr_cool = true;
+}
+
+void ICACHE_RAM_ATTR nest_isr_heat() {
+  bnest_isr_heat = true;
 }
 
 bool ICACHE_RAM_ATTR sendmqttMsg(const char* topictosend, String payloadtosend, bool retain = false)

	clientName += macToStr(mac);
	clientName += "-";
	clientName += String(micros() & 0xff, 16);
	
	configTime(9 * 3600, 0, "pool.ntp.org", "time.nist.gov");
	

#define COOL_PIN 5
#define HEAT_PIN 4

#include "/usr/local/src/aptls_setting.h"
const char* reporting_topic = "esp8266/nestbridge";
const char* topic_ac_cmd    = "esp8266/cmd/ac";
const char* hellotopic      = "HELLO";

IPAddress mqtt_server = MQTT_SERVER;

