Skip to content

Commit

Permalink
Release 2.3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
sfeakes committed Sep 3, 2024
1 parent d945d43 commit bdbe315
Show file tree
Hide file tree
Showing 22 changed files with 290 additions and 56 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ AQ_RS16 = true
AQ_PDA = true
AQ_ONETOUCH = true
AQ_IAQTOUCH = true
AQ_MANAGER =true
AQ_MANAGER = true

#AQ_RS_EXTRA_OPTS = false
#AQ_CONTAINER = false // this is for compiling for containers
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ Designed to mimic AqualinkRS devices, used to fully configure the master control
* Create iAqualink Touch Simulator
* Probably decoded enough protocols for AuqlinkD to self configure.


<!--
* NEED TO FIX for PDA and iAQT protocol.
* Not always doing on/off
Expand All @@ -110,7 +111,10 @@ Designed to mimic AqualinkRS devices, used to fully configure the master control
# Call for Help.
* The only Jandy devices I have not decoded yet are LX heater & Chemical Feeder. If you have either of these devices and are willing to post some logs, please let me know, or post in the [Discussions area](https://github.com/sfeakes/AqualinkD/discussions)

# Updates in 2.3.8 (Dev)
# Updates in 2.3.8
* <b>WARNING</b> Breaking change if you use dimmer (please change button_??_lightMode from 6 to 10)
* Fixed bugs with particular Jandy panel versions and color lights.
* Added support for more color lights, and sped up programming
* Code & Repo refactor
* Decoded more Pentair VSP pump status.
* Changed VSP pump status handling (display more in web UI).
Expand Down
Binary file removed release/aqualinkd-amd64
Binary file not shown.
Binary file modified release/aqualinkd-arm64
Binary file not shown.
Binary file modified release/aqualinkd-armhf
Binary file not shown.
2 changes: 1 addition & 1 deletion release/aqualinkd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ use_panel_aux_labels=no
# button_01_pumpIndex=1
# If you have assigned this pump an index number in your Aqualink control panel, (Between 1 & 4), put it here for VSP, RPM, Primp information to be captured.
#
# button_xx_lightMode = (0=Aqualink program, 1=Jandy, 2=Jandy LED, 3=SAm/SAL, 4=Color Logic, 5=Intellibrite, 6=Dimmer)
# button_xx_lightMode = (0=Aqualink program, 1=Jandy, 2=Jandy LED, 3=SAm/SAL, 4=Color Logic, 5=Intellibrite, 6=Hayw Univ Color, 7,8,9(future), 10=Dimmer)
#
# Below are settings for standard buttons on RS-8 Combo panel used as example.
button_01_label=Filter Pump
Expand Down
Binary file removed release/serial_logger-amd64
Binary file not shown.
Binary file modified release/serial_logger-arm64
Binary file not shown.
Binary file modified release/serial_logger-armhf
Binary file not shown.
8 changes: 8 additions & 0 deletions source/allbutton.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ void processLEDstate(struct aqualinkdata *aq_data)
LOG(ALLB_LOG,LOG_NOTICE, "%s = %d", aq_data->aqbuttons[i].name, aq_data->aqualinkleds[i].state);
}
*/
#ifdef CLIGHT_PANEL_FIX // Use state from RSSD protocol for color light if it's on.
for (int i=0; i < aq_data->num_lights; i++) {
if ( aq_data->lights[i].RSSDstate == ON && aq_data->lights[i].button->led->state != ON ) {
aq_data->lights[i].button->led->state = aq_data->lights[i].RSSDstate;
//LOG(ALLB_LOG,LOG_WARNING,"Fix Jandy bug, color light '%s' is on, setting status to match!\n", aq_data->lights[i].button->label);
}
}
#endif
}

void setUnits(char *msg, struct aqualinkdata *aq_data)
Expand Down
60 changes: 59 additions & 1 deletion source/aq_panel.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ uint8_t getPanelSupport( char *rev_string, int rev_len)
// Rev >=Q == iaqualink touch protocol.
// REv >= P == chemlink
// Rev >= HH serial adapter.
// Rev >= L == JandyColors Smart Light Control
// Rev >= MMM = 12V JandyColor Lights (also light dimmer)
// Rev >= N Hayward ColorLogic LED Light
// Rev >= O.1== Jandy WaterColors LED ( 9 colors )
// Rev >= T.0.1 == limited color light
// Rec >= T.2 == full color lights

// Rev Yg (and maybe before) has Pump label (not number), and also Virtual Device called Label Auxiliraries
if (REV[0] >= 81) // Q in ascii
Expand All @@ -71,13 +77,25 @@ uint8_t getPanelSupport( char *rev_string, int rev_len)

if (REV[0] >= 79) // O in ascii
supported |= RSP_SUP_VSP;

if (REV[0] >= 73) // I in ascii
supported |= RSP_SUP_ONET;

if (REV[0] > 72 || (REV[0] == 72 && REV[1] == 72) ) // H in ascii
supported |= RSP_SUP_SERA;

if (REV[0] >= 77) // M in ascii
supported |= REP_SUP_CLIT1;

if (REV[0] >= 78) // N in ascii
supported |= REP_SUP_CLIT2;

if (REV[0] >= 79) // O in ascii
supported |= REP_SUP_CLIT3;

if (REV[0] > 84 || (REV[0] == 84 && REV[1] == 64 && REV[2] >= 50) ) // T in ascii (or T and . and 2 )
supported |= REP_SUP_CLIT4;

}

return supported;
Expand Down Expand Up @@ -302,6 +320,7 @@ void initPanelButtons(struct aqualinkdata *aqdata, bool rs, int size, bool combo
aqdata->aqbuttons[index].code = KEY_PUMP;
aqdata->aqbuttons[index].dz_idx = DZ_NULL_IDX;
aqdata->aqbuttons[index].special_mask = 0;
aqdata->aqbuttons[index].rssd_code = RS_SA_PUMP;
index++;

if (combo) {
Expand All @@ -312,6 +331,7 @@ void initPanelButtons(struct aqualinkdata *aqdata, bool rs, int size, bool combo
aqdata->aqbuttons[index].code = KEY_SPA;
aqdata->aqbuttons[index].dz_idx = DZ_NULL_IDX;
aqdata->aqbuttons[index].special_mask = 0;
aqdata->aqbuttons[index].rssd_code = RS_SA_SPA;
index++;
}

Expand All @@ -322,6 +342,7 @@ void initPanelButtons(struct aqualinkdata *aqdata, bool rs, int size, bool combo
aqdata->aqbuttons[index].code = KEY_AUX1;
aqdata->aqbuttons[index].dz_idx = DZ_NULL_IDX;
aqdata->aqbuttons[index].special_mask = 0;
aqdata->aqbuttons[index].rssd_code = RS_SA_AUX1;
index++;

aqdata->aqbuttons[index].led = &aqdata->aqualinkleds[4-1];
Expand All @@ -331,6 +352,7 @@ void initPanelButtons(struct aqualinkdata *aqdata, bool rs, int size, bool combo
aqdata->aqbuttons[index].code = KEY_AUX2;
aqdata->aqbuttons[index].dz_idx = DZ_NULL_IDX;
aqdata->aqbuttons[index].special_mask = 0;
aqdata->aqbuttons[index].rssd_code = RS_SA_AUX2;
index++;

aqdata->aqbuttons[index].led = &aqdata->aqualinkleds[3-1];
Expand All @@ -340,6 +362,7 @@ void initPanelButtons(struct aqualinkdata *aqdata, bool rs, int size, bool combo
aqdata->aqbuttons[index].code = KEY_AUX3;
aqdata->aqbuttons[index].dz_idx = DZ_NULL_IDX;
aqdata->aqbuttons[index].special_mask = 0;
aqdata->aqbuttons[index].rssd_code = RS_SA_AUX3;
index++;


Expand All @@ -351,6 +374,7 @@ void initPanelButtons(struct aqualinkdata *aqdata, bool rs, int size, bool combo
aqdata->aqbuttons[index].code = KEY_AUX4;
aqdata->aqbuttons[index].dz_idx = DZ_NULL_IDX;
aqdata->aqbuttons[index].special_mask = 0;
aqdata->aqbuttons[index].rssd_code = RS_SA_AUX4;
index++;

aqdata->aqbuttons[index].led = &aqdata->aqualinkleds[8-1];
Expand All @@ -360,6 +384,7 @@ void initPanelButtons(struct aqualinkdata *aqdata, bool rs, int size, bool combo
aqdata->aqbuttons[index].code = KEY_AUX5;
aqdata->aqbuttons[index].dz_idx = DZ_NULL_IDX;
aqdata->aqbuttons[index].special_mask = 0;
aqdata->aqbuttons[index].rssd_code = RS_SA_AUX5;
index++;
}

Expand All @@ -371,6 +396,7 @@ void initPanelButtons(struct aqualinkdata *aqdata, bool rs, int size, bool combo
aqdata->aqbuttons[index].code = KEY_AUX6;
aqdata->aqbuttons[index].dz_idx = DZ_NULL_IDX;
aqdata->aqbuttons[index].special_mask = 0;
aqdata->aqbuttons[index].rssd_code = RS_SA_AUX6;
index++;

aqdata->aqbuttons[index].led = &aqdata->aqualinkleds[1-1];
Expand All @@ -380,6 +406,7 @@ void initPanelButtons(struct aqualinkdata *aqdata, bool rs, int size, bool combo
aqdata->aqbuttons[index].code = KEY_AUX7;
aqdata->aqbuttons[index].dz_idx = DZ_NULL_IDX;
aqdata->aqbuttons[index].special_mask = 0;
aqdata->aqbuttons[index].rssd_code = RS_SA_AUX7;
index++;
}
#ifdef AQ_RS16
Expand All @@ -401,6 +428,7 @@ void initPanelButtons(struct aqualinkdata *aqdata, bool rs, int size, bool combo
aqdata->aqbuttons[index].code = KEY_AUXB1;
aqdata->aqbuttons[index].dz_idx = DZ_NULL_IDX;
aqdata->aqbuttons[index].special_mask = 0;
aqdata->aqbuttons[index].rssd_code = RS_SA_AUX8;
index++;

aqdata->aqbuttons[index].led = &aqdata->aqualinkleds[12-1];
Expand All @@ -410,6 +438,7 @@ void initPanelButtons(struct aqualinkdata *aqdata, bool rs, int size, bool combo
aqdata->aqbuttons[index].code = KEY_AUXB2;
aqdata->aqbuttons[index].dz_idx = DZ_NULL_IDX;
aqdata->aqbuttons[index].special_mask = 0;
aqdata->aqbuttons[index].rssd_code = RS_SA_AUX9;
index++;

aqdata->aqbuttons[index].led = &aqdata->aqualinkleds[1-1];
Expand All @@ -419,6 +448,7 @@ void initPanelButtons(struct aqualinkdata *aqdata, bool rs, int size, bool combo
aqdata->aqbuttons[index].code = KEY_AUXB3;
aqdata->aqbuttons[index].dz_idx = DZ_NULL_IDX;
aqdata->aqbuttons[index].special_mask = 0;
aqdata->aqbuttons[index].rssd_code = RS_SA_AUX10;
index++;

aqdata->aqbuttons[index].led = &aqdata->aqualinkleds[13-1];
Expand All @@ -428,6 +458,7 @@ void initPanelButtons(struct aqualinkdata *aqdata, bool rs, int size, bool combo
aqdata->aqbuttons[index].code = KEY_AUXB4;
aqdata->aqbuttons[index].dz_idx = DZ_NULL_IDX;
aqdata->aqbuttons[index].special_mask = 0;
aqdata->aqbuttons[index].rssd_code = RS_SA_AUX11;
index++;
}

Expand All @@ -439,6 +470,7 @@ void initPanelButtons(struct aqualinkdata *aqdata, bool rs, int size, bool combo
aqdata->aqbuttons[index].code = KEY_AUXB5;
aqdata->aqbuttons[index].dz_idx = DZ_NULL_IDX;
aqdata->aqbuttons[index].special_mask = 0;
aqdata->aqbuttons[index].rssd_code = RS_SA_AUX12;
index++;

aqdata->aqbuttons[index].led = &aqdata->aqualinkleds[22-1]; // doesn't actually exist
Expand All @@ -448,6 +480,7 @@ void initPanelButtons(struct aqualinkdata *aqdata, bool rs, int size, bool combo
aqdata->aqbuttons[index].code = KEY_AUXB6;
aqdata->aqbuttons[index].dz_idx = DZ_NULL_IDX;
aqdata->aqbuttons[index].special_mask = 0;
aqdata->aqbuttons[index].rssd_code = RS_SA_AUX13;
index++;

aqdata->aqbuttons[index].led = &aqdata->aqualinkleds[23-1]; // doesn't actually exist
Expand All @@ -456,6 +489,7 @@ void initPanelButtons(struct aqualinkdata *aqdata, bool rs, int size, bool combo
aqdata->aqbuttons[index].name = BTN_AUXB7;
aqdata->aqbuttons[index].code = KEY_AUXB7;
aqdata->aqbuttons[index].dz_idx = DZ_NULL_IDX;
aqdata->aqbuttons[index].rssd_code = RS_SA_AUX14;
index++;

aqdata->aqbuttons[index].led = &aqdata->aqualinkleds[24-1]; // doesn't actually exist
Expand All @@ -465,6 +499,7 @@ void initPanelButtons(struct aqualinkdata *aqdata, bool rs, int size, bool combo
aqdata->aqbuttons[index].code = KEY_AUXB8;
aqdata->aqbuttons[index].dz_idx = DZ_NULL_IDX;
aqdata->aqbuttons[index].special_mask = 0;
aqdata->aqbuttons[index].rssd_code = RS_SA_AUX15;
index++;
}
#endif // AQ_RS16
Expand All @@ -479,6 +514,7 @@ void initPanelButtons(struct aqualinkdata *aqdata, bool rs, int size, bool combo
aqdata->aqbuttons[index].code = KEY_AUX6;
aqdata->aqbuttons[index].dz_idx = DZ_NULL_IDX;
aqdata->aqbuttons[index].special_mask = 0;
aqdata->aqbuttons[index].rssd_code = RS_SA_AUX6;
index++;
}
//Dual panels (2/10 & 2/14) have no AUX7, they go from AUX6 to AUXB1, but the keycodes are the same as other panels
Expand Down Expand Up @@ -664,9 +700,17 @@ bool setDeviceState(struct aqualinkdata *aqdata, int deviceIndex, bool isON, req
// Domoticz has a bad habbit of resending the same state back to us, when we use the PRESTATE_ONOFF option
// since allbutton (default) is stateless, and rssaadapter is statefull, use rssaadapter for any domoricz requests
set_aqualink_rssadapter_aux_state(deviceIndex, isON);
} else if (button->special_mask & PROGRAM_LIGHT && isRSSA_ENABLED) {
// If off and program light, use the RS serial adapter since that is overiding the state now.
set_aqualink_rssadapter_aux_state(deviceIndex, isON);
} else {
aq_send_allb_cmd(button->code);
}

#ifdef CLIGHT_PANEL_FIX
if (isRSSA_ENABLED) {get_aqualink_rssadapter_colorlight_statuses(aqdata);}
#endif

// Pre set device to state, next status will correct if state didn't take, but this will stop multiple ON messages setting on/off
//#ifdef PRESTATE_ONOFF
if (_aqconfig_.device_pre_state) {
Expand Down Expand Up @@ -750,6 +794,20 @@ void programDeviceLightMode(struct aqualinkdata *aqdata, int value, int button)
_aqconfig_.light_programming_initial_off,
_aqconfig_.light_programming_mode );
aq_programmer(AQ_SET_LIGHTPROGRAM_MODE, buf, aqdata);
} else if (isRSSA_ENABLED && light->lightType != LC_DIMMER) {
unsigned char rssd_value = value;
set_aqualink_rssadapter_aux_extended_state(light->button, rssd_value);
} else if (isRSSA_ENABLED && light->lightType == LC_DIMMER) {
// Dimmer needs to be turned on first
set_aqualink_rssadapter_aux_extended_state(light->button, RS_SA_ON);
// Value 1 = 25, 1 = 50, 3 = 75, 4 = 100 (need to convert value into binary)
if (value >= 1 && value <= 4) {
// If value is not on of those vales, then ignore
unsigned char rssd_value = value * 25;
set_aqualink_rssadapter_aux_extended_state(light->button, rssd_value);
} else {
LOG(PANL_LOG,LOG_ERR, "Light mode %d is not valid for '%s'\n",value, light->button->label);
}
} else {
//sprintf(buf, "%-5s%-5d%-5d",value, button, light->lightType);
sprintf(buf, "%-5d%-5d%-5d",value, button, light->lightType);
Expand Down
5 changes: 5 additions & 0 deletions source/aq_panel.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@
#define RSP_SUP_VSP (1 << 2)
#define RSP_SUP_CHEM (1 << 3)
#define RSP_SUP_SERA (1 << 4) // Serial adapter
#define REP_SUP_CLIT1 (1 << 5) // color lights (first suppoer)
#define REP_SUP_CLIT2 (1 << 6) // color lights
#define REP_SUP_CLIT3 (1 << 7) // color lights
#define REP_SUP_CLIT4 (1 << 8) // Full color lights (T.2)


//void initButtons(struct aqualinkdata *aqdata);
void setPanelByName(struct aqualinkdata *aqdata, const char *str);
Expand Down
2 changes: 1 addition & 1 deletion source/aq_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ void send_packet(int fd, unsigned char *packet, int length)
//LOG(RSSD_LOG,LOG_DEBUG_SERIAL, "Serial write %d bytes\n",length-2);
//LOG(RSSD_LOG,LOG_DEBUG, "Serial write %d bytes, type 0x%02hhx cmd 0x%02hhx\n",length-2,packet[5],packet[6]);
if (_aqconfig_.log_protocol_packets || getLogLevel(RSSD_LOG) >= LOG_DEBUG_SERIAL)
logPacketWrite(&packet[1], length-2);
logPacketWrite(&packet[1], length-1);
/*
if (getLogLevel(PDA_LOG) == LOG_DEBUG) {
char buff[1024];
Expand Down
11 changes: 11 additions & 0 deletions source/aqualink.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#endif


#define CLIGHT_PANEL_FIX // Overcome bug in some jandy panels where color light status of on is not in LED status

#define TIME_CHECK_INTERVAL 3600
//#define TIME_CHECK_INTERVAL 100 // DEBUG ONLY
#define ACCEPTABLE_TIME_DIFF 120
Expand Down Expand Up @@ -81,6 +83,7 @@ typedef struct aqualinkkey
// char *pda_label;
//#endif
unsigned char code;
unsigned char rssd_code;
int dz_idx;
uint8_t special_mask;
} aqkey;
Expand Down Expand Up @@ -199,6 +202,10 @@ typedef enum clight_type {
LC_SAL,
LC_CLOGIG,
LC_INTELLIB,
LC_HAYWCL,
LC_SPARE_1,
LC_SPARE_2,
LC_SPARE_3,
LC_DIMMER,
NUMBER_LIGHT_COLOR_TYPES // This is used to size and count so add more prior to this
} clight_type;
Expand All @@ -216,6 +223,7 @@ typedef struct clightd
clight_type lightType;
aqkey *button;
int currentValue;
aqledstate RSSDstate; // state from rs serial adapter
} clight_detail;


Expand Down Expand Up @@ -305,6 +313,9 @@ struct aqualinkdata
struct timespec last_active_time;
struct timespec start_active_time;
#endif

// Overcome color light bug, by reconnecting allbutton panel.
//bool reconnectAllButton;
};


Expand Down
11 changes: 11 additions & 0 deletions source/aqualinkd.c
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,16 @@ int startup(char *self, char *cfgFile)
_aqualink_data.aqbuttons[i].name, _aqualink_data.aqbuttons[i].label, ext);
}
}
/*
for (i=0; i < _aqualink_data.total_buttons; i++)
{
LOG(AQUA_LOG,LOG_NOTICE, "Button index=%d, label=%s, code=0x%02hhx, rssd code=0x%02hhx\n",
i,
_aqualink_data.aqbuttons[i].label,
_aqualink_data.aqbuttons[i].code,
_aqualink_data.aqbuttons[i].rssd_code);
}
*/

if (_aqconfig_.deamonize == true)
{
Expand Down Expand Up @@ -878,6 +888,7 @@ void main_loop()

for (i=0; i < MAX_LIGHTS; i++) {
_aqualink_data.lights[i].currentValue = TEMP_UNKNOWN;
_aqualink_data.lights[i].RSSDstate = OFF;
}

if (_aqconfig_.force_swg == true) {
Expand Down
Loading

0 comments on commit bdbe315

Please sign in to comment.