mirror of https://github.com/sfeakes/AqualinkD.git
Update to doc
parent
0050ec8b11
commit
5ac773f6f0
12
README.md
12
README.md
|
@ -7,7 +7,17 @@ linux daemon to control Aqualink RS pool controllers. Provides web UI, MQTT clie
|
|||

|
||||
|
||||
## In Apple Home app.
|
||||

|
||||

|
||||
* (Salt Water Generator is configured as Thermostat as it's the closest homekit accessory type, so °=% and Cooling=Generating)
|
||||
* Full support for homekit scenes, so can make a "Spa scene" to turn spa on, set spa heater particular temperature, turn spa blower on, etc etc)
|
||||
|
||||
## Latest update in Release 1.0
|
||||
* Flash buttons on/off in homekit for enabeling / disabeling / cooldown period as they do on control panel
|
||||
* Full SWG support (setting %, not just reporting current state). Also reports Salt Cell status such as (no flow, low salt, high curent, clean cell, low voltage, water temp low, check PCB)
|
||||
* Update to thermostats.
|
||||
* Light show program mode should now support most vendors lights.
|
||||
* config changes for (spa temp as pool temp / light program mode options / enable homekit button flash)
|
||||
* updated to serial_logger.
|
||||
|
||||
# TL;DR Install
|
||||
## Quick instal if you are using Raspberry PI
|
||||
|
|
12
aq_mqtt.h
12
aq_mqtt.h
|
@ -9,13 +9,16 @@
|
|||
//#define POOL_SETPT_TOPIC "Pool_Heater/setpoint"
|
||||
//#define SPA_SETPT_TOPIC "Spa_Heater/setpoint"
|
||||
|
||||
#define ENABELED_SUBT "/enabeled"
|
||||
|
||||
#define SWG_TOPIC "SWG"
|
||||
#define SWG_PPM_TOPIC SWG_TOPIC "/PPM"
|
||||
#define SWG_ENABELED_TOPIC SWG_TOPIC "/enabeled"
|
||||
#define SWG_ENABELED_TOPIC SWG_TOPIC ENABELED_SUBT
|
||||
#define SWG_PERCENT_TOPIC SWG_TOPIC "/Percent"
|
||||
#define SWG_PERCENT_F_TOPIC SWG_TOPIC "/Percent_f"
|
||||
|
||||
|
||||
#define FREEZE_PROTECT "Freeze_Protect"
|
||||
#define FREEZE_PROTECT_ENABELED FREEZE_PROTECT ENABELED_SUBT
|
||||
|
||||
#define POOL_THERMO_TEMP_TOPIC BTN_POOL_HTR "/Temperature"
|
||||
#define SPA_THERMO_TEMP_TOPIC BTN_SPA_HTR "/Temperature"
|
||||
|
@ -31,7 +34,10 @@
|
|||
#define SWG_ON 2
|
||||
#define SWG_OFF 0
|
||||
|
||||
#define FREEZE_PROTECT "Freeze_Protect"
|
||||
#define MQTT_ON "1"
|
||||
#define MQTT_OFF "0"
|
||||
|
||||
|
||||
|
||||
// These need to be moved, but at present only aq_mqtt uses them, so there are here.
|
||||
// Also need to get the C values from aqualink manual and add those just incase
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 4.0 MiB |
|
@ -187,7 +187,7 @@ void send_mqtt_state_msg(struct mg_connection *nc, char *dev_name, aqledstate st
|
|||
static char mqtt_pub_topic[250];
|
||||
|
||||
sprintf(mqtt_pub_topic, "%s/%s",_aqualink_config->mqtt_aq_topic, dev_name);
|
||||
send_mqtt(nc, mqtt_pub_topic, (state==OFF?"0":"1"));
|
||||
send_mqtt(nc, mqtt_pub_topic, (state==OFF?MQTT_OFF:MQTT_ON));
|
||||
}
|
||||
|
||||
void send_mqtt_heater_state_msg(struct mg_connection *nc, char *dev_name, aqledstate state)
|
||||
|
@ -197,13 +197,13 @@ void send_mqtt_heater_state_msg(struct mg_connection *nc, char *dev_name, aqleds
|
|||
sprintf(mqtt_pub_topic, "%s/%s",_aqualink_config->mqtt_aq_topic, dev_name);
|
||||
|
||||
if (state == ENABLE) {
|
||||
send_mqtt(nc, mqtt_pub_topic, "0");
|
||||
sprintf(mqtt_pub_topic, "%s/%s/enabeled",_aqualink_config->mqtt_aq_topic, dev_name);
|
||||
send_mqtt(nc, mqtt_pub_topic, "1");
|
||||
send_mqtt(nc, mqtt_pub_topic, MQTT_OFF);
|
||||
sprintf(mqtt_pub_topic, "%s/%s/%s",ENABELED_SUBT,_aqualink_config->mqtt_aq_topic, dev_name);
|
||||
send_mqtt(nc, mqtt_pub_topic, MQTT_ON);
|
||||
} else {
|
||||
send_mqtt(nc, mqtt_pub_topic, (state==OFF?"0":"1"));
|
||||
sprintf(mqtt_pub_topic, "%s/%s/enabeled",_aqualink_config->mqtt_aq_topic, dev_name);
|
||||
send_mqtt(nc, mqtt_pub_topic, (state==OFF?"0":"1"));
|
||||
send_mqtt(nc, mqtt_pub_topic, (state==OFF?MQTT_OFF:MQTT_ON));
|
||||
sprintf(mqtt_pub_topic, "%s/%s/%s",ENABELED_SUBT,_aqualink_config->mqtt_aq_topic, dev_name);
|
||||
send_mqtt(nc, mqtt_pub_topic, (state==OFF?MQTT_OFF:MQTT_ON));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -254,13 +254,24 @@ void send_mqtt_float_msg(struct mg_connection *nc, char *dev_name, float value)
|
|||
sprintf(mqtt_pub_topic, "%s/%s", _aqualink_config->mqtt_aq_topic, dev_name);
|
||||
send_mqtt(nc, mqtt_pub_topic, msg);
|
||||
}
|
||||
|
||||
void send_mqtt_int_msg(struct mg_connection *nc, char *dev_name, int value) {
|
||||
send_mqtt_numeric_msg(nc, dev_name, value);
|
||||
/*
|
||||
static char mqtt_pub_topic[250];
|
||||
static char msg[10];
|
||||
|
||||
sprintf(msg, "%d", value);
|
||||
sprintf(mqtt_pub_topic, "%s/%s", _aqualink_config->mqtt_aq_topic, dev_name);
|
||||
send_mqtt(nc, mqtt_pub_topic, msg);
|
||||
*/
|
||||
}
|
||||
|
||||
void send_mqtt_string_msg(struct mg_connection *nc, char *dev_name, char *msg) {
|
||||
static char mqtt_pub_topic[250];
|
||||
|
||||
sprintf(mqtt_pub_topic, "%s/%s", _aqualink_config->mqtt_aq_topic, dev_name);
|
||||
send_mqtt(nc, mqtt_pub_topic, msg);
|
||||
}
|
||||
|
||||
|
||||
|
@ -301,21 +312,8 @@ void mqtt_broadcast_aqualinkstate(struct mg_connection *nc)
|
|||
if (_aqualink_data->spa_temp != TEMP_UNKNOWN && _aqualink_data->spa_temp != _last_mqtt_aqualinkdata.spa_temp) {
|
||||
send_mqtt_temp_msg(nc, SPA_TEMP_TOPIC, _aqualink_data->spa_temp);
|
||||
send_domoticz_mqtt_temp_msg(nc, _aqualink_config->dzidx_spa_water_temp, _aqualink_data->spa_temp);
|
||||
} /*else if (_aqualink_data->spa_temp == TEMP_UNKNOWN && _aqualink_config->report_zero_spa_temp ) {
|
||||
_aqualink_data->spa_temp = _last_mqtt_aqualinkdata.spa_temp = _aqualink_config->report_zero_spa_temp?32:_aqualink_data->pool_temp;
|
||||
} else if (_aqualink_data->pool_temp != TEMP_UNKNOWN && _aqualink_data->pool_temp != _last_mqtt_aqualinkdata.spa_temp && _aqualink_config->report_zero_spa_temp == false) {
|
||||
// Use Pool Temp is Spa is not available
|
||||
_last_mqtt_aqualinkdata.spa_temp = _aqualink_data->pool_temp;
|
||||
send_mqtt_temp_msg(nc, SPA_TEMP_TOPIC, _aqualink_data->spa_temp);
|
||||
send_domoticz_mqtt_temp_msg(nc, _aqualink_config->dzidx_spa_water_temp, _aqualink_data->spa_temp);
|
||||
} else if (_aqualink_data->pool_temp != TEMP_UNKNOWN && _aqualink_data->pool_temp != _last_mqtt_aqualinkdata.spa_temp) {
|
||||
// Use Pool Temp is Spa is not available
|
||||
_aqualink_data->spa_temp = _last_mqtt_aqualinkdata.spa_temp = _aqualink_config->report_zero_spa_temp?32:_aqualink_data->pool_temp;
|
||||
//_last_mqtt_aqualinkdata.spa_temp = _aqualink_data->pool_temp;
|
||||
send_mqtt_temp_msg(nc, SPA_TEMP_TOPIC, _aqualink_data->spa_temp);
|
||||
send_domoticz_mqtt_temp_msg(nc, _aqualink_config->dzidx_spa_water_temp, _aqualink_data->spa_temp);
|
||||
}
|
||||
*/
|
||||
|
||||
if (_aqualink_data->pool_htr_set_point != TEMP_UNKNOWN && _aqualink_data->pool_htr_set_point != _last_mqtt_aqualinkdata.pool_htr_set_point) {
|
||||
_last_mqtt_aqualinkdata.pool_htr_set_point = _aqualink_data->pool_htr_set_point;
|
||||
send_mqtt_setpoint_msg(nc, BTN_POOL_HTR, _aqualink_data->pool_htr_set_point);
|
||||
|
@ -327,11 +325,19 @@ void mqtt_broadcast_aqualinkstate(struct mg_connection *nc)
|
|||
_last_mqtt_aqualinkdata.spa_htr_set_point = _aqualink_data->spa_htr_set_point;
|
||||
send_mqtt_setpoint_msg(nc, BTN_SPA_HTR, _aqualink_data->spa_htr_set_point);
|
||||
}
|
||||
|
||||
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, MQTT_OFF); // Blindly send off, maybe change this in future if we can read whn freeze protect is active.
|
||||
/*
|
||||
send_mqtt_string_msg(nc, FREEZE_PROTECT_ENABELED, MQTT_ON);
|
||||
//send_domoticz_mqtt_temp_msg(nc, _aqualink_config->dzidx_rfz_protect, _aqualink_data->frz_protect_set_point);
|
||||
} else if (_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_string_msg(nc, FREEZE_PROTECT_ENABELED, MQTT_OFF);*/
|
||||
}
|
||||
|
||||
if (_aqualink_data->ar_swg_status == 0x00) { // 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;
|
||||
|
@ -699,10 +705,15 @@ void action_mqtt_message(struct mg_connection *nc, struct mg_mqtt_message *msg)
|
|||
}
|
||||
} else if (strncmp(pt1, FREEZE_PROTECT, strlen(FREEZE_PROTECT)) == 0) {
|
||||
if (val <= FREEZE_PT_MAX && val >= FREEZE_PT_MIN) {
|
||||
logMessage(LOG_INFO, "MQTT: request to set freeze protect to %.2fc\n", value);
|
||||
_aqualink_data->unactioned.type = FREEZE_SETPOINT;
|
||||
logMessage(LOG_INFO, "MQTT: request to set freeze protect to %.2fc\n", value);
|
||||
_aqualink_data->unactioned.type = FREEZE_SETPOINT;
|
||||
} else {
|
||||
logMessage(LOG_ERR, "MQTT: request to set freeze protect to %.2fc is outside of range\n", value);
|
||||
if (val > FREEZE_PT_MAX)
|
||||
_aqualink_data->unactioned.value = FREEZE_PT_MAX;
|
||||
else
|
||||
_aqualink_data->unactioned.value = FREEZE_PT_MIN;
|
||||
logMessage(LOG_ERR, "MQTT: request to set freeze protect to %.2fc/%df is outside range using %df\n", value, val, _aqualink_data->unactioned.value);
|
||||
_aqualink_data->unactioned.type = FREEZE_SETPOINT;
|
||||
}
|
||||
} else {
|
||||
// Not sure what the setpoint is, ignore.
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue