diff --git a/src/user_code.cpp b/src/user_code.cpp index 2816e3e..93ffdc2 100644 --- a/src/user_code.cpp +++ b/src/user_code.cpp @@ -55,7 +55,7 @@ void user_init() elcd.print("page dashboard"); elcd_sendstop(); memcpy(AC_LOCK_TOPIC, MQTT_BASE_TOPIC, 20); - strcat(AC_LOCK_TOPIC, "/ac/lock/set"); + strcat(AC_LOCK_TOPIC, "/ac/set/lock"); memcpy(AC_LOCK_REPORT_TOPIC, MQTT_BASE_TOPIC, 20); strcat(AC_LOCK_REPORT_TOPIC, "/ac/lock"); ac_lock = ESPMega_FRAM.read8(AC_LOCK_ADDRESS); @@ -252,6 +252,7 @@ void ac_update_lcd() { void ac_lock_callback(String topic, String payload) { + Serial.println("INPAYLOAD"); if (payload.equals("lock")) { ac_lock = true; @@ -272,7 +273,7 @@ void ac_lock_callback(String topic, String payload) } void ac_lock_report() { - mqtt_client.publish(AC_LOCK_REPORT_TOPIC,ac_lock?"lock":"unlock"); + //mqtt_client.publish(AC_LOCK_REPORT_TOPIC,ac_lock?"lock":"unlock"); } void elcd_sendstop() { @@ -294,7 +295,8 @@ void pwm_update_lcd() { } void mqtt_connected_user_callback() { - mqtt.subscribe(AC_LOCK_TOPIC, ac_lock_callback); + Serial.println("User Subscribing"); + mqtt.subscribe(String(AC_LOCK_TOPIC), ac_lock_callback); ac_lock_report(); }