freeze protect bug fix

pull/44/head
shaun feakes 2019-01-23 20:32:22 -06:00
parent 0bf72d3f5f
commit 3d7ee5a89f
8 changed files with 39 additions and 10 deletions

View File

@ -67,7 +67,7 @@ Designed to mimic AqualinkRS6 All Button keypad, and just like the keypad you ca
* http://aqualink.ip/simple.html <- (Anothr opion if you don't like the above)
* http://aqualink.ip/simulator.html <- (RS8 All Button Control Panel simulator)
#<a name="release"></a>
## Update in Release 1.2.5
## Update in Release 1.2.5a
* fix bug for MQTT freeze protect.
## Update in Release 1.2.4
* Small fix for Freeze Protect.

View File

@ -22,6 +22,8 @@
#define FREEZE_PROTECT "Freeze_Protect"
#define FREEZE_PROTECT_ENABELED FREEZE_PROTECT ENABELED_SUBT
#define BATTERY_STATE "Battery"
#define POOL_THERMO_TEMP_TOPIC BTN_POOL_HTR "/Temperature"
#define SPA_THERMO_TEMP_TOPIC BTN_SPA_HTR "/Temperature"
/*

View File

@ -117,7 +117,8 @@
#define LNG_MSG_FREEZE_PROTECTION_SET "FREEZE PROTECTION IS SET TO"
#define LNG_MSG_CLEANER_DELAY "CLEANER WILL TURN ON AFTER SAFETY DELAY"
#define LNG_MSG_BATTERY_LOW "BATTERY LOW"
//#define LNG_MSG_FREEZE_PROTECTION_ACTIVATED "FREEZE PROTECTION ACTIVATED"
#define LNG_MSG_FREEZE_PROTECTION_ACTIVATED "FREEZE PROTECTION IS ACTIVATED"
#define MSG_AIR_TEMP "AIR TEMP"
@ -133,7 +134,24 @@
#define LNG_MSG_WATER_TEMP1_SET "TEMP1 (HIGH TEMP) IS SET TO"
#define LNG_MSG_WATER_TEMP2_SET "TEMP2 (LOW TEMP) IS SET TO"
#define LNG_MSG_FREEZE_PROTECTION_ACTIVATED "FREEZE PROTECTION ACTIVATED"
/*
// All Messages listed in the manual, This is obviously not complete, but it's everything Jandy has published
BATTERY IS LOW, BATTERY LOCATED AT THE POWER CENTER
CLEANER CANNOT BE TURNED ON WHILE SPA IS ON
CLEANER CANNOT BE TURNED ON WHILE SPILLOVER IS ON
FREEZE PROTECTION ACTIVATED
SENSOR OPENED
POOL HEATER ENABLED
PUMP WILL REMAIN ON WHILE SPILLOVER IS ON
PUMP WILL TURN OFF AFTER COOL DOWN CYCLE
PUMP WILL TURN ON AFTER DELAY
SERVICE MODE IS ACTIVE
SENSOR SHORTED
SPA WILL TURN OFF AFTER COOL DOWN CYCLE
TIMED AUX ON, WILL TURN OFF AFTER 30 MINUTES
TIMEOUT MODE IS ACTIVE
SPILLOVER IS DISABLED WHILE SPA IS ON
*/
#define MSG_SWG_PCT "AQUAPURE" // AquaPure 55%
#define MSG_SWG_PPM "SALT" // Salt 3000 PPM

View File

@ -302,8 +302,6 @@ void processMessage(char *message)
}
}
else if (stristr(msg, LNG_MSG_FREEZE_PROTECTION_ACTIVATED) != NULL) {
// ADD Code Set FREEZE protection on (from enabeled).
// Need to figure out a way to turn know when it's off though before uncommeting.
_aqualink_data.frz_protect_state = ON;
freeze_msg_count = 0;
}
@ -866,6 +864,7 @@ void main_loop() {
_aqualink_data.temp_units = UNKNOWN;
_aqualink_data.single_device = false;
_aqualink_data.frz_protect_state = OFF;
_aqualink_data.battery = OK;
if (!start_net_services(&mgr, &_aqualink_data, &_config_parameters)) {

View File

@ -176,8 +176,10 @@ int build_device_JSON(struct aqualinkdata *aqdata, int programable_switch, char*
length += sprintf(buffer+length, "{\"type\": \"setpoint_freeze\", \"id\": \"%s\", \"name\": \"%s\", \"state\": \"%s\", \"status\": \"%s\", \"spvalue\": \"%.*f\", \"value\": \"%.*f\" },",
FREEZE_PROTECT,
"Freeze Protection",
JSON_OFF,
JSON_ENABLED,
//JSON_OFF,
aqdata->frz_protect_state==ON?JSON_ON:JSON_OFF,
//JSON_ENABLED,
aqdata->frz_protect_state==ON?LED2text(ON):LED2text(ENABLE),
((homekit)?2:0),
((homekit && aqdata->temp_units==FAHRENHEIT)?degFtoC(aqdata->frz_protect_set_point):aqdata->frz_protect_set_point),
((homekit)?2:0),
@ -335,7 +337,7 @@ int build_aqualink_status_JSON(struct aqualinkdata *aqdata, char* buffer, int si
}
//NSF Need to come back and read what the display states when Freeze protection is on
if ( aqdata->frz_protect_set_point != TEMP_UNKNOWN ) {
length += sprintf(buffer+length, ", \"%s\": \"%s\"", FREEZE_PROTECT, JSON_ENABLED);
length += sprintf(buffer+length, ", \"%s\": \"%s\"", FREEZE_PROTECT, aqdata->frz_protect_state==ON?JSON_ON:JSON_ENABLED);
}
length += sprintf(buffer+length, "}}" );

View File

@ -337,7 +337,8 @@ void mqtt_broadcast_aqualinkstate(struct mg_connection *nc)
if (_aqualink_data->frz_protect_set_point != TEMP_UNKNOWN && _aqualink_data->frz_protect_set_point != _last_mqtt_aqualinkdata.frz_protect_set_point) {
_last_mqtt_aqualinkdata.frz_protect_set_point = _aqualink_data->frz_protect_set_point;
send_mqtt_setpoint_msg(nc, FREEZE_PROTECT, _aqualink_data->frz_protect_set_point);
send_mqtt_string_msg(nc, FREEZE_PROTECT, _aqualink_data->frz_protect_state==ON?MQTT_ON:MQTT_OFF);
send_mqtt_string_msg(nc, FREEZE_PROTECT, _aqualink_data->frz_protect_state==ON?MQTT_ON:MQTT_OFF);
_last_mqtt_aqualinkdata.frz_protect_state = _aqualink_data->frz_protect_state;
send_mqtt_string_msg(nc, FREEZE_PROTECT_ENABELED, MQTT_ON);
/*
send_mqtt_string_msg(nc, FREEZE_PROTECT_ENABELED, MQTT_ON);
@ -352,6 +353,11 @@ void mqtt_broadcast_aqualinkstate(struct mg_connection *nc)
send_mqtt_string_msg(nc, FREEZE_PROTECT, _aqualink_data->frz_protect_state==ON?MQTT_ON:MQTT_OFF);
}
if (_aqualink_data->battery != _last_mqtt_aqualinkdata.battery) {
_last_mqtt_aqualinkdata.battery = _aqualink_data->battery;
send_mqtt_string_msg(nc, BATTERY_STATE, _aqualink_data->battery==OK?MQTT_ON:MQTT_OFF);
}
if (_aqualink_data->ar_swg_status == SWG_STATUS_ON) { // If the SWG is actually on
if (_aqualink_data->swg_percent != TEMP_UNKNOWN && (force_update || _aqualink_data->swg_percent != _last_mqtt_aqualinkdata.swg_percent)) {
_last_mqtt_aqualinkdata.swg_percent = _aqualink_data->swg_percent;
@ -1124,6 +1130,8 @@ void start_mqtt(struct mg_mgr *mgr) {
_last_mqtt_aqualinkdata.aqualinkleds[i].state = LED_S_UNKNOWN;
}
_last_mqtt_aqualinkdata.ar_swg_status = SWG_STATUS_UNKNOWN;
_last_mqtt_aqualinkdata.battery = -1;
_last_mqtt_aqualinkdata.frz_protect_state = -1;
_mqtt_exit_flag = false; // set here to stop multiple connects, if it fails truley fails it will get set to false.
}
}

Binary file not shown.

View File

@ -1,4 +1,4 @@
#define AQUALINKD_NAME "Aqualink Daemon"
#define AQUALINKD_VERSION "1.2.5"
#define AQUALINKD_VERSION "1.2.5a"