mirror of https://github.com/sfeakes/AqualinkD.git
Update
parent
767745c97d
commit
3732ec81c6
15
aq_serial.h
15
aq_serial.h
|
@ -38,12 +38,16 @@
|
|||
*/
|
||||
#define PENTAIR_DEC_PUMP_MIN 96 // 0x60
|
||||
#define PENTAIR_DEC_PUMP_MAX 111 // 0x6F
|
||||
#define JANDY_DEC_PUMP_MIN 120 // 0x80
|
||||
#define JANDY_DEC_PUMP_MAX 123 // 0x83
|
||||
#define JANDY_DEC_SWG_MIN 80 // 0x50
|
||||
#define JANDY_DEC_SWG_MAX 83 // 0x53
|
||||
#define JANDY_DEC_PUMP_MIN 120 // 0x78
|
||||
#define JANDY_DEC_PUMP_MAX 123 // 0x7b
|
||||
#define JANDY_DEC_JXI_MIN 104 // 0x68
|
||||
#define JANDY_DEC_JXI_MAX 107 // 0x6B
|
||||
#define JANDY_DEC_LX_MIN 56 // 0x38
|
||||
#define JANDY_DEC_LX_MAX 59 // 0x3B
|
||||
#define JANDY_DEC_LX_MIN 56 // 0x38
|
||||
#define JANDY_DEC_LX_MAX 59 // 0x3B
|
||||
#define JANDY_DEC_CHEM_MIN 128 // 0x80
|
||||
#define JANDY_DEC_CHEM_MAX 131 // 0x83
|
||||
|
||||
|
||||
// PACKET DEFINES Jandy
|
||||
|
@ -441,7 +445,8 @@ typedef enum {
|
|||
DRS_SWG,
|
||||
DRS_EPUMP,
|
||||
DRS_JXI,
|
||||
DRS_LX
|
||||
DRS_LX,
|
||||
DRS_CHEM
|
||||
} rsDeviceType;
|
||||
|
||||
typedef enum {
|
||||
|
|
|
@ -1329,6 +1329,7 @@ int startup(char *self, char *cfgFile)
|
|||
LOG(AQUA_LOG,LOG_NOTICE, "Read vsfPump direct = %s\n", bool2text(READ_RSDEV_vsfPUMP));
|
||||
LOG(AQUA_LOG,LOG_NOTICE, "Read JXi heater direct = %s\n", bool2text(READ_RSDEV_JXI));
|
||||
LOG(AQUA_LOG,LOG_NOTICE, "Read LX heater direct = %s\n", bool2text(READ_RSDEV_LX));
|
||||
LOG(AQUA_LOG,LOG_NOTICE, "Read Chem Feeder direct = %s\n", bool2text(READ_RSDEV_CHEM));
|
||||
|
||||
if (READ_RSDEV_SWG && _aqconfig_.swg_zero_ignore != DEFAULT_SWG_ZERO_IGNORE_COUNT)
|
||||
LOG(AQUA_LOG,LOG_NOTICE, "Ignore SWG 0 msg count = %d\n", _aqconfig_.swg_zero_ignore);
|
||||
|
|
6
config.c
6
config.c
|
@ -575,6 +575,12 @@ bool setConfigValue(struct aqualinkdata *aqdata, char *param, char *value) {
|
|||
else
|
||||
_aqconfig_.read_RS485_devmask &= ~READ_RS485_JAN_LX;
|
||||
rtn=true;
|
||||
} else if (strncasecmp (param, "read_RS485_Chem", 14) == 0) {
|
||||
if (text2bool(value))
|
||||
_aqconfig_.read_RS485_devmask |= READ_RS485_JAN_CHEM;
|
||||
else
|
||||
_aqconfig_.read_RS485_devmask &= ~READ_RS485_JAN_CHEM;
|
||||
rtn=true;
|
||||
} else if (strncasecmp (param, "use_panel_aux_labels", 20) == 0) {
|
||||
_aqconfig_.use_panel_aux_labels = text2bool(value);
|
||||
rtn=true;
|
||||
|
|
3
config.h
3
config.h
|
@ -30,6 +30,7 @@
|
|||
#define READ_RS485_PEN_PUMP (1 << 2) // 4 Pentair Pump
|
||||
#define READ_RS485_JAN_JXI (1 << 3) // Jandy JX & LXi heater
|
||||
#define READ_RS485_JAN_LX (1 << 4) // Jandy LX heater
|
||||
#define READ_RS485_JAN_CHEM (1 << 5) // Jandy Chemical Feeder
|
||||
|
||||
struct aqconfig
|
||||
{
|
||||
|
@ -117,7 +118,7 @@ struct aqconfig _aqconfig_;
|
|||
#define READ_RSDEV_vsfPUMP ((_aqconfig_.read_RS485_devmask & READ_RS485_PEN_PUMP) == READ_RS485_PEN_PUMP)
|
||||
#define READ_RSDEV_JXI ((_aqconfig_.read_RS485_devmask & READ_RS485_JAN_JXI) == READ_RS485_JAN_JXI)
|
||||
#define READ_RSDEV_LX ((_aqconfig_.read_RS485_devmask & READ_RS485_JAN_LX) == READ_RS485_JAN_LX)
|
||||
|
||||
#define READ_RSDEV_CHEM ((_aqconfig_.read_RS485_devmask & READ_RS485_JAN_CHEM) == READ_RS485_JAN_CHEM)
|
||||
|
||||
#define isPDA_IAQT (_aqconfig_.device_id == 0x33)
|
||||
//#define isPDA ((_aqconfig_.paneltype_mask & RSP_PDA) == RSP_PDA)
|
||||
|
|
128
devices_jandy.c
128
devices_jandy.c
|
@ -39,6 +39,7 @@ bool processJandyPacket(unsigned char *packet_buffer, int packet_length, struct
|
|||
static rsDeviceType interestedInNextAck = DRS_NONE;
|
||||
static unsigned char previous_packet_to = NUL; // bad name, it's not previous, it's previous that we were interested in.
|
||||
int rtn = false;
|
||||
|
||||
// We received the ack from a Jandy device we are interested in
|
||||
if (packet_buffer[PKT_DEST] == DEV_MASTER && interestedInNextAck != DRS_NONE)
|
||||
{
|
||||
|
@ -54,6 +55,14 @@ bool processJandyPacket(unsigned char *packet_buffer, int packet_length, struct
|
|||
{
|
||||
rtn = processPacketFromJandyJXiHeater(packet_buffer, packet_length, aqdata, previous_packet_to);
|
||||
}
|
||||
else if (interestedInNextAck == DRS_LX)
|
||||
{
|
||||
rtn = processPacketFromJandyLXHeater(packet_buffer, packet_length, aqdata, previous_packet_to);
|
||||
}
|
||||
else if (interestedInNextAck == DRS_CHEM)
|
||||
{
|
||||
rtn = processPacketFromJandyChemFeeder(packet_buffer, packet_length, aqdata, previous_packet_to);
|
||||
}
|
||||
interestedInNextAck = DRS_NONE;
|
||||
previous_packet_to = NUL;
|
||||
}
|
||||
|
@ -71,7 +80,7 @@ bool processJandyPacket(unsigned char *packet_buffer, int packet_length, struct
|
|||
interestedInNextAck = DRS_NONE;
|
||||
previous_packet_to = NUL;
|
||||
}
|
||||
else if (READ_RSDEV_SWG && packet_buffer[PKT_DEST] == SWG_DEV_ID)
|
||||
else if (READ_RSDEV_SWG && packet_buffer[PKT_DEST] >= JANDY_DEC_SWG_MIN && packet_buffer[PKT_DEST] <= JANDY_DEC_SWG_MAX)
|
||||
{
|
||||
interestedInNextAck = DRS_SWG;
|
||||
rtn = processPacketToSWG(packet_buffer, packet_length, aqdata, _aqconfig_.swg_zero_ignore);
|
||||
|
@ -83,7 +92,7 @@ bool processJandyPacket(unsigned char *packet_buffer, int packet_length, struct
|
|||
rtn = processPacketToJandyPump(packet_buffer, packet_length, aqdata);
|
||||
previous_packet_to = packet_buffer[PKT_DEST];
|
||||
}
|
||||
else if (READ_RSDEV_JXI && packet_buffer[PKT_DEST] >= JANDY_DEC_LX_MIN && packet_buffer[PKT_DEST] <= JANDY_DEC_LX_MAX)
|
||||
else if (READ_RSDEV_JXI && packet_buffer[PKT_DEST] >= JANDY_DEC_JXI_MIN && packet_buffer[PKT_DEST] <= JANDY_DEC_JXI_MAX)
|
||||
{
|
||||
interestedInNextAck = DRS_JXI;
|
||||
rtn = processPacketToJandyJXiHeater(packet_buffer, packet_length, aqdata);
|
||||
|
@ -95,6 +104,12 @@ bool processJandyPacket(unsigned char *packet_buffer, int packet_length, struct
|
|||
rtn = processPacketToJandyLXHeater(packet_buffer, packet_length, aqdata);
|
||||
previous_packet_to = packet_buffer[PKT_DEST];
|
||||
}
|
||||
else if (READ_RSDEV_CHEM && packet_buffer[PKT_DEST] >= JANDY_DEC_CHEM_MIN && packet_buffer[PKT_DEST] <= JANDY_DEC_CHEM_MAX)
|
||||
{
|
||||
interestedInNextAck = DRS_CHEM;
|
||||
rtn = processPacketToJandyChemFeeder(packet_buffer, packet_length, aqdata);
|
||||
previous_packet_to = packet_buffer[PKT_DEST];
|
||||
}
|
||||
else
|
||||
{
|
||||
interestedInNextAck = DRS_NONE;
|
||||
|
@ -114,13 +129,13 @@ bool processPacketToSWG(unsigned char *packet, int packet_length, struct aqualin
|
|||
static int swg_zero_cnt = 0;
|
||||
bool changedAnything = false;
|
||||
|
||||
if (getLogLevel(DJAN_LOG) == LOG_DEBUG) {
|
||||
// Only log if we are jandy debug move and not serial (otherwise it'll print twice)
|
||||
if (getLogLevel(DJAN_LOG) == LOG_DEBUG && getLogLevel(RSSD_LOG) < LOG_DEBUG ) {
|
||||
char buff[1024];
|
||||
beautifyPacket(buff, packet, packet_length, false);
|
||||
LOG(DJAN_LOG,LOG_DEBUG, "%s", buff);
|
||||
beautifyPacket(buff, packet, packet_length, true);
|
||||
LOG(DJAN_LOG,LOG_DEBUG, "To SWG: %s", buff);
|
||||
}
|
||||
|
||||
|
||||
// Only read message from controller to SWG to set SWG Percent if we are not programming, as we might be changing this
|
||||
if (packet[3] == CMD_PERCENT && aqdata->active_thread.thread_id == 0 && packet[4] != 0xFF) {
|
||||
// In service or timeout mode SWG set % message is very strange. AR %% | HEX: 0x10|0x02|0x50|0x11|0xff|0x72|0x10|0x03|
|
||||
|
@ -166,10 +181,11 @@ bool processPacketFromSWG(unsigned char *packet, int packet_length, struct aqual
|
|||
bool changedAnything = false;
|
||||
_swg_noreply_cnt = 0;
|
||||
|
||||
if (getLogLevel(DJAN_LOG) == LOG_DEBUG) {
|
||||
// Only log if we are jandy debug move and not serial (otherwise it'll print twice)
|
||||
if (getLogLevel(DJAN_LOG) == LOG_DEBUG && getLogLevel(RSSD_LOG) < LOG_DEBUG ) {
|
||||
char buff[1024];
|
||||
beautifyPacket(buff, packet, packet_length, true);
|
||||
LOG(DJAN_LOG,LOG_DEBUG, "%s", buff);
|
||||
LOG(DJAN_LOG,LOG_DEBUG, "From SWG: %s", buff);
|
||||
}
|
||||
|
||||
if (packet[PKT_CMD] == CMD_PPM) {
|
||||
|
@ -529,6 +545,12 @@ bool processPacketToJandyPump(unsigned char *packet_buffer, int packet_length, s
|
|||
|
||||
Type 0x1F and cmd 0x45 is RPM = 39 * (256) + 96 / 4 = 2520 or Byte 8 * 265 + Byte 7 / 4
|
||||
*/
|
||||
// Only log if we are jandy debug move and not serial (otherwise it'll print twice)
|
||||
if (getLogLevel(DJAN_LOG) == LOG_DEBUG && getLogLevel(RSSD_LOG) < LOG_DEBUG ) {
|
||||
char msg[1000];
|
||||
beautifyPacket(msg, packet_buffer, packet_length, true);
|
||||
LOG(DJAN_LOG, LOG_DEBUG, "To ePump: %s\n", msg);
|
||||
}
|
||||
|
||||
// If type 0x45 and 0x44 set to interested in next command.
|
||||
if (packet_buffer[3] == CMD_EPUMP_RPM) {
|
||||
|
@ -537,11 +559,8 @@ bool processPacketToJandyPump(unsigned char *packet_buffer, int packet_length, s
|
|||
} else if (packet_buffer[3] == CMD_EPUMP_WATTS) {
|
||||
LOG(DJAN_LOG, LOG_DEBUG, "ControlPanel request Pump ID 0x%02hhx get watts\n",packet_buffer[PKT_DEST]);
|
||||
}
|
||||
|
||||
if (getLogLevel(DJAN_LOG) >= LOG_DEBUG) {
|
||||
char msg[1000];
|
||||
beautifyPacket(msg, packet_buffer, packet_length, true);
|
||||
LOG(DJAN_LOG, LOG_DEBUG, "To ePump: %s\n", msg);
|
||||
|
||||
if (getLogLevel(DJAN_LOG) == LOG_DEBUG) {
|
||||
//find pump for message
|
||||
for (int i=0; i < aqdata->num_pumps; i++) {
|
||||
if (aqdata->pumps[i].pumpID == packet_buffer[PKT_DEST]) {
|
||||
|
@ -558,6 +577,14 @@ bool processPacketFromJandyPump(unsigned char *packet_buffer, int packet_length,
|
|||
{
|
||||
bool found=false;
|
||||
|
||||
// Only log if we are jandy debug move and not serial (otherwise it'll print twice)
|
||||
if (getLogLevel(DJAN_LOG) == LOG_DEBUG && getLogLevel(RSSD_LOG) < LOG_DEBUG ) {
|
||||
char msg[1000];
|
||||
//logMessage(LOG_DEBUG, "Need to log ePump message here for future\n");
|
||||
beautifyPacket(msg, packet_buffer, packet_length, true);
|
||||
LOG(DJAN_LOG, LOG_DEBUG, "From ePump: %s\n", msg);
|
||||
}
|
||||
|
||||
if (packet_buffer[3] == CMD_EPUMP_STATUS && packet_buffer[4] == CMD_EPUMP_RPM) {
|
||||
for (int i = 0; i < MAX_PUMPS; i++) {
|
||||
if ( aqdata->pumps[i].prclType == JANDY && aqdata->pumps[i].pumpID == previous_packet_to ) {
|
||||
|
@ -583,12 +610,7 @@ bool processPacketFromJandyPump(unsigned char *packet_buffer, int packet_length,
|
|||
LOG(DJAN_LOG, LOG_NOTICE, "Jandy Pump found at ID 0x%02hhx with WATTS %d, but not configured, information ignored!\n",previous_packet_to, (packet_buffer[EP_HI_B_WAT] * 256) + packet_buffer[EP_LO_B_WAT]);
|
||||
}
|
||||
|
||||
if (getLogLevel(DJAN_LOG) >= LOG_DEBUG) {
|
||||
char msg[1000];
|
||||
//logMessage(LOG_DEBUG, "Need to log ePump message here for future\n");
|
||||
beautifyPacket(msg, packet_buffer, packet_length, true);
|
||||
LOG(DJAN_LOG, LOG_DEBUG, "From ePump: %s\n", msg);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -605,6 +627,14 @@ void processMissingAckPacketFromJandyPump(unsigned char destination, struct aqua
|
|||
|
||||
bool processPacketToJandyJXiHeater(unsigned char *packet_buffer, int packet_length, struct aqualinkdata *aqdata)
|
||||
{
|
||||
|
||||
if (getLogLevel(DJAN_LOG) == LOG_DEBUG && getLogLevel(RSSD_LOG) < LOG_DEBUG ) {
|
||||
char msg[1000];
|
||||
//logMessage(LOG_DEBUG, "Need to log ePump message here for future\n");
|
||||
beautifyPacket(msg, packet_buffer, packet_length, true);
|
||||
LOG(DJAN_LOG, LOG_DEBUG, "To JXi: %s\n", msg);
|
||||
}
|
||||
|
||||
if (packet_buffer[3] != CMD_JXI_PING) {
|
||||
// Not sure what this message is, so ignore
|
||||
// Maybe print a messsage.
|
||||
|
@ -624,24 +654,24 @@ bool processPacketToJandyJXiHeater(unsigned char *packet_buffer, int packet_leng
|
|||
*/
|
||||
|
||||
if (packet_buffer[5] != aqdata->pool_htr_set_point) {
|
||||
LOG(DJAN_LOG, LOG_DEBUG, "LXi pool setpoint %d, Pool heater sp %s (changing to LXi)\n", packet_buffer[5], aqdata->pool_htr_set_point);
|
||||
LOG(DJAN_LOG, LOG_DEBUG, "JXi pool setpoint %d, Pool heater sp %d (changing to LXi)\n", packet_buffer[5], aqdata->pool_htr_set_point);
|
||||
aqdata->pool_htr_set_point = packet_buffer[5];
|
||||
}
|
||||
|
||||
if (packet_buffer[6] != aqdata->spa_htr_set_point) {
|
||||
LOG(DJAN_LOG, LOG_DEBUG, "LXi spa setpoint %d, Spa heater sp %s (changing to LXi)\n", packet_buffer[5], aqdata->spa_htr_set_point);
|
||||
aqdata->spa_htr_set_point = packet_buffer[5];
|
||||
LOG(DJAN_LOG, LOG_DEBUG, "JXi spa setpoint %d, Spa heater sp %d (changing to LXi)\n", packet_buffer[6], aqdata->spa_htr_set_point);
|
||||
aqdata->spa_htr_set_point = packet_buffer[6];
|
||||
}
|
||||
|
||||
if (packet_buffer[7] != 0xff && packet_buffer[4] != 0x00) {
|
||||
if (packet_buffer[4] == 0x11 || packet_buffer[4] == 0x19) {
|
||||
if (aqdata->pool_temp != packet_buffer[7]) {
|
||||
LOG(DJAN_LOG, LOG_DEBUG, "LXi pool water temp %d, pool water temp %s (changing to LXi)\n", packet_buffer[7], aqdata->pool_temp);
|
||||
LOG(DJAN_LOG, LOG_DEBUG, "JXi pool water temp %d, pool water temp %d (changing to LXi)\n", packet_buffer[7], aqdata->pool_temp);
|
||||
aqdata->pool_temp = packet_buffer[7];
|
||||
}
|
||||
} else if (packet_buffer[4] == 0x12 || packet_buffer[4] == 0x1a) {
|
||||
if (aqdata->spa_temp != packet_buffer[7]) {
|
||||
LOG(DJAN_LOG, LOG_DEBUG, "LXi spa water temp %d, spa water temp %s (changing to LXi)\n", packet_buffer[7], aqdata->spa_temp);
|
||||
LOG(DJAN_LOG, LOG_DEBUG, "JXi spa water temp %d, spa water temp %d (changing to LXi)\n", packet_buffer[7], aqdata->spa_temp);
|
||||
aqdata->spa_temp = packet_buffer[7];
|
||||
}
|
||||
}
|
||||
|
@ -724,13 +754,20 @@ void getJandyHeaterErrorMQTT(struct aqualinkdata *aqdata, char *message)
|
|||
?x?? Pump fault
|
||||
0x08 AUX Monitor
|
||||
*/
|
||||
sprintf(message, "FAULT");
|
||||
sprintf(message, "FAULT 0x%02hhx",aqdata->heater_err_status);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool processPacketFromJandyJXiHeater(unsigned char *packet_buffer, int packet_length, struct aqualinkdata *aqdata, const unsigned char previous_packet_to)
|
||||
{
|
||||
if (getLogLevel(DJAN_LOG) == LOG_DEBUG && getLogLevel(RSSD_LOG) < LOG_DEBUG ) {
|
||||
char msg[1000];
|
||||
//logMessage(LOG_DEBUG, "Need to log ePump message here for future\n");
|
||||
beautifyPacket(msg, packet_buffer, packet_length, true);
|
||||
LOG(DJAN_LOG, LOG_DEBUG, "From JXi: %s\n", msg);
|
||||
}
|
||||
|
||||
if (packet_buffer[3] != CMD_JXI_STATUS) {
|
||||
// Not sure what this message is, so ignore
|
||||
// Maybe print a messsage.
|
||||
|
@ -785,7 +822,7 @@ bool processPacketToJandyLXHeater(unsigned char *packet_buffer, int packet_lengt
|
|||
int length = 0;
|
||||
|
||||
beautifyPacket(msg, packet_buffer, packet_length, true);
|
||||
LOG(DJAN_LOG, LOG_INFO, "To LX Heater: %s\n", msg);
|
||||
LOG(DJAN_LOG, LOG_INFO, "To LX: %s\n", msg);
|
||||
|
||||
length += sprintf(msg+length, "Last panel info ");
|
||||
|
||||
|
@ -814,7 +851,7 @@ bool processPacketFromJandyLXHeater(unsigned char *packet_buffer, int packet_len
|
|||
int length = 0;
|
||||
|
||||
beautifyPacket(msg, packet_buffer, packet_length, true);
|
||||
LOG(DJAN_LOG, LOG_INFO, "From LX Heater: %s\n", msg);
|
||||
LOG(DJAN_LOG, LOG_INFO, "From LX: %s\n", msg);
|
||||
|
||||
length += sprintf(msg+length, "Last panel info ");
|
||||
|
||||
|
@ -836,6 +873,43 @@ bool processPacketFromJandyLXHeater(unsigned char *packet_buffer, int packet_len
|
|||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool processPacketToJandyChemFeeder(unsigned char *packet_buffer, int packet_length, struct aqualinkdata *aqdata)
|
||||
{
|
||||
char msg[1000];
|
||||
int length = 0;
|
||||
|
||||
beautifyPacket(msg, packet_buffer, packet_length, true);
|
||||
LOG(DJAN_LOG, LOG_INFO, "To Chem: %s\n", msg);
|
||||
|
||||
length += sprintf(msg+length, "Last panel info ");
|
||||
|
||||
length += sprintf(msg+length, ", pH=%f, ORP=%d",aqdata->ph, aqdata->orp);
|
||||
|
||||
LOG(DJAN_LOG, LOG_INFO, "%s\n", msg);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool processPacketFromJandyChemFeeder(unsigned char *packet_buffer, int packet_length, struct aqualinkdata *aqdata, const unsigned char previous_packet_to){
|
||||
char msg[1000];
|
||||
int length = 0;
|
||||
|
||||
beautifyPacket(msg, packet_buffer, packet_length, true);
|
||||
LOG(DJAN_LOG, LOG_INFO, "From Chem: %s\n", msg);
|
||||
|
||||
length += sprintf(msg+length, "Last panel info ");
|
||||
|
||||
length += sprintf(msg+length, ", pH=%f, ORP=%d",aqdata->ph, aqdata->orp);
|
||||
|
||||
LOG(DJAN_LOG, LOG_INFO, "%s\n", msg);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
// JXi Heater
|
||||
|
|
|
@ -19,6 +19,9 @@ bool processPacketToJandyJXiHeater(unsigned char *packet_buffer, int packet_leng
|
|||
bool processPacketFromJandyLXHeater(unsigned char *packet_buffer, int packet_length, struct aqualinkdata *aqdata, const unsigned char previous_packet_to );
|
||||
bool processPacketToJandyLXHeater(unsigned char *packet_buffer, int packet_length, struct aqualinkdata *aqdata);
|
||||
|
||||
bool processPacketFromJandyChemFeeder(unsigned char *packet_buffer, int packet_length, struct aqualinkdata *aqdata, const unsigned char previous_packet_to );
|
||||
bool processPacketToJandyChemFeeder(unsigned char *packet_buffer, int packet_length, struct aqualinkdata *aqdata);
|
||||
|
||||
void get_swg_status_mqtt(struct aqualinkdata *aqdata, char *message, int *status, int *dzalert);
|
||||
aqledstate get_swg_led_state(struct aqualinkdata *aqdata);
|
||||
|
||||
|
|
|
@ -24,11 +24,20 @@
|
|||
#include "aq_serial.h"
|
||||
#include "devices_pentair.h"
|
||||
#include "utils.h"
|
||||
#include "packetLogger.h"
|
||||
|
||||
bool processPentairPacket(unsigned char *packet, int packet_length, struct aqualinkdata *aqdata)
|
||||
{
|
||||
bool changedAnything = false;
|
||||
int i;
|
||||
|
||||
// Only log if we are pentair debug move and not serial (otherwise it'll print twice)
|
||||
if (getLogLevel(DPEN_LOG) == LOG_DEBUG && getLogLevel(RSSD_LOG) < LOG_DEBUG ) {
|
||||
char buff[1024];
|
||||
beautifyPacket(buff, packet, packet_length, true);
|
||||
LOG(DPEN_LOG,LOG_DEBUG, "%s", buff);
|
||||
}
|
||||
|
||||
//ID's 96 to 111 = Pentair (or 0x60 to 0x6F)
|
||||
|
||||
// Need to find a better way to support pump index
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 198 KiB After Width: | Height: | Size: 143 KiB |
|
@ -1,5 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
|
||||
# Script to start AqualinkD inside container.
|
||||
|
||||
CONFDIR=/aquadconf
|
||||
AQUA_CONF=$CONFDIR/aqualinkd.conf
|
||||
|
||||
|
|
32
hassio.c
32
hassio.c
|
@ -17,12 +17,20 @@
|
|||
// NSF Need to find a better way, this is not thread safe, so don;t want to expost it from net_services.h.
|
||||
void send_mqtt(struct mg_connection *nc, const char *toppic, const char *message);
|
||||
|
||||
#define HASS_DEVICE "\"identifiers\": [\"" AQUALINKD_SHORT_NAME "\"], \"sw_version\": \"" AQUALINKD_VERSION "\", \"model\": \"" AQUALINKD_NAME "\", \"name\": \"AqualinkD\", \"manufacturer\": \"" AQUALINKD_SHORT_NAME "\", \"suggested_area\": \"pool\""
|
||||
#define HASS_DEVICE "\"identifiers\": " \
|
||||
"[\"" AQUALINKD_SHORT_NAME "\"]," \
|
||||
" \"sw_version\": \"" AQUALINKD_VERSION "\"," \
|
||||
" \"model\": \"" AQUALINKD_NAME "\"," \
|
||||
" \"name\": \"AqualinkD\"," \
|
||||
" \"manufacturer\": \"" AQUALINKD_SHORT_NAME "\"," \
|
||||
" \"suggested_area\": \"pool\""
|
||||
|
||||
#define HASS_AVAILABILITY "\"payload_available\" : \"1\",\"payload_not_available\" : \"0\",\"topic\": \"%s/" MQTT_LWM_TOPIC "\""
|
||||
#define HASS_AVAILABILITY "\"payload_available\" : \"1\"," \
|
||||
"\"payload_not_available\" : \"0\"," \
|
||||
"\"topic\": \"%s/" MQTT_LWM_TOPIC "\""
|
||||
|
||||
|
||||
char *HASSIO_CLIMATE_DISCOVER = "{"
|
||||
const char *HASSIO_CLIMATE_DISCOVER = "{"
|
||||
"\"device\": {" HASS_DEVICE "},"
|
||||
"\"availability\": {" HASS_AVAILABILITY "},"
|
||||
"\"type\": \"climate\","
|
||||
|
@ -47,7 +55,7 @@ char *HASSIO_CLIMATE_DISCOVER = "{"
|
|||
"\"retain\": false"
|
||||
"}";
|
||||
|
||||
char *HASSIO_FREEZE_PROTECT_DISCOVER = "{"
|
||||
const char *HASSIO_FREEZE_PROTECT_DISCOVER = "{"
|
||||
"\"device\": {" HASS_DEVICE "},"
|
||||
"\"availability\": {" HASS_AVAILABILITY "},"
|
||||
"\"type\": \"climate\","
|
||||
|
@ -68,7 +76,7 @@ char *HASSIO_FREEZE_PROTECT_DISCOVER = "{"
|
|||
"\"temperature_state_template\": \"{{ value_json }}\""
|
||||
"}";
|
||||
|
||||
char *HASSIO_SWG_DISCOVER = "{"
|
||||
const char *HASSIO_SWG_DISCOVER = "{"
|
||||
"\"device\": {" HASS_DEVICE "},"
|
||||
"\"availability\": {" HASS_AVAILABILITY "},"
|
||||
"\"type\": \"humidifier\","
|
||||
|
@ -91,7 +99,7 @@ char *HASSIO_SWG_DISCOVER = "{"
|
|||
// Need to add timer attributes to the switches, once figure out how to use in homeassistant
|
||||
// ie aqualinkd/Filter_Pump/timer/duration
|
||||
|
||||
char *HASSIO_SWITCH_DISCOVER = "{"
|
||||
const char *HASSIO_SWITCH_DISCOVER = "{"
|
||||
"\"device\": {" HASS_DEVICE "},"
|
||||
"\"availability\": {" HASS_AVAILABILITY "},"
|
||||
"\"type\": \"switch\","
|
||||
|
@ -108,7 +116,7 @@ char *HASSIO_SWITCH_DISCOVER = "{"
|
|||
"\"retain\": false"
|
||||
"}";
|
||||
|
||||
char *HASSIO_TEMP_SENSOR_DISCOVER = "{"
|
||||
const char *HASSIO_TEMP_SENSOR_DISCOVER = "{"
|
||||
"\"device\": {" HASS_DEVICE "},"
|
||||
"\"availability\": {" HASS_AVAILABILITY "},"
|
||||
"\"type\": \"sensor\","
|
||||
|
@ -121,7 +129,7 @@ char *HASSIO_TEMP_SENSOR_DISCOVER = "{"
|
|||
"\"icon\": \"%s\""
|
||||
"}";
|
||||
|
||||
char *HASSIO_SENSOR_DISCOVER = "{"
|
||||
const char *HASSIO_SENSOR_DISCOVER = "{"
|
||||
"\"device\": {" HASS_DEVICE "},"
|
||||
"\"availability\": {" HASS_AVAILABILITY "},"
|
||||
"\"type\": \"sensor\","
|
||||
|
@ -133,7 +141,7 @@ char *HASSIO_SENSOR_DISCOVER = "{"
|
|||
"\"icon\": \"%s\""
|
||||
"}";
|
||||
|
||||
char *HASSIO_ONOFF_SENSOR_DISCOVER = "{"
|
||||
const char *HASSIO_ONOFF_SENSOR_DISCOVER = "{"
|
||||
"\"device\": {" HASS_DEVICE "},"
|
||||
"\"availability\": {" HASS_AVAILABILITY "},"
|
||||
"\"type\": \"sensor\","
|
||||
|
@ -146,7 +154,7 @@ char *HASSIO_ONOFF_SENSOR_DISCOVER = "{"
|
|||
"\"icon\": \"%s\""
|
||||
"}";
|
||||
|
||||
char *HASSIO_PUMP_SENSOR_DISCOVER = "{"
|
||||
const char *HASSIO_PUMP_SENSOR_DISCOVER = "{"
|
||||
"\"device\": {" HASS_DEVICE "},"
|
||||
"\"availability\": {" HASS_AVAILABILITY "},"
|
||||
"\"type\": \"sensor\","
|
||||
|
@ -158,7 +166,7 @@ char *HASSIO_PUMP_SENSOR_DISCOVER = "{"
|
|||
"\"icon\": \"mdi:pump\""
|
||||
"}";
|
||||
|
||||
char *HASSIO_TEXT_SENSOR_DISCOVER = "{"
|
||||
const char *HASSIO_TEXT_SENSOR_DISCOVER = "{"
|
||||
"\"device\": {" HASS_DEVICE "},"
|
||||
"\"availability\": {" HASS_AVAILABILITY "},"
|
||||
"\"type\": \"sensor\","
|
||||
|
@ -168,7 +176,7 @@ char *HASSIO_TEXT_SENSOR_DISCOVER = "{"
|
|||
"\"icon\": \"mdi:card-text\""
|
||||
"}";
|
||||
|
||||
char *HASSIO_SWG_TEXT_SENSOR_DISCOVER = "{"
|
||||
const char *HASSIO_SWG_TEXT_SENSOR_DISCOVER = "{"
|
||||
"\"device\": {" HASS_DEVICE "},"
|
||||
"\"availability\": {" HASS_AVAILABILITY "},"
|
||||
"\"type\": \"sensor\","
|
||||
|
|
|
@ -160,7 +160,7 @@ struct iaqt_page_button *iaqtFindButtonByIndex(int index) {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
struct iaqt_page_button *iaqtFindButtonByLabel(char *label) {
|
||||
struct iaqt_page_button *iaqtFindButtonByLabel(const char *label) {
|
||||
int i;
|
||||
struct iaqt_page_button *buttons;
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ unsigned char iaqtThreadKickType();
|
|||
unsigned char iaqtCurrentPage();
|
||||
unsigned char iaqtCurrentPageLoading();
|
||||
bool wasiaqtThreadKickTypePage();
|
||||
struct iaqt_page_button *iaqtFindButtonByLabel(char *label);
|
||||
struct iaqt_page_button *iaqtFindButtonByLabel(const char *label);
|
||||
struct iaqt_page_button *iaqtFindButtonByIndex(int index);
|
||||
const char *iaqtGetMessageLine(int index);
|
||||
const char *iaqtGetTableInfoLine(int index);
|
||||
|
|
|
@ -862,7 +862,7 @@ void *get_aqualink_iaqtouch_setpoints( void *ptr )
|
|||
|
||||
// Get product info.
|
||||
send_aqt_cmd(KEY_IAQTCH_HELP);
|
||||
unsigned char page = waitfor_iaqt_nextPage(aq_data);
|
||||
waitfor_iaqt_nextPage(aq_data);
|
||||
|
||||
if ( goto_iaqt_page(IAQ_PAGE_SET_TEMP, aq_data) == false )
|
||||
goto f_end;
|
||||
|
@ -939,7 +939,7 @@ void *get_aqualink_iaqtouch_setpoints( void *ptr )
|
|||
|
||||
if (button != NULL) {
|
||||
LOG(IAQT_LOG,LOG_NOTICE, "Temperature units are '%s'\n",button->name);
|
||||
if (button->name[8] == 'C') {
|
||||
if (*button->name[8] == 'C') {
|
||||
aq_data->temp_units = CELSIUS;
|
||||
} else {
|
||||
aq_data->temp_units = FAHRENHEIT;
|
||||
|
|
Binary file not shown.
|
@ -91,6 +91,7 @@ device_id=0x0a
|
|||
#read_RS485_vsfPump = yes
|
||||
#read_RS485_JXi = yes
|
||||
#read_RS485_LX = yes
|
||||
#read_RS485_Chem = yes
|
||||
|
||||
# Keep the panel time synced with systemtime. Make sure to set systemtime / NTP correctly.
|
||||
keep_paneltime_synced = yes
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue