Skip to content

Commit bdbe315

Browse files
committed
Release 2.3.8
1 parent d945d43 commit bdbe315

22 files changed

+290
-56
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ AQ_RS16 = true
1313
AQ_PDA = true
1414
AQ_ONETOUCH = true
1515
AQ_IAQTOUCH = true
16-
AQ_MANAGER =true
16+
AQ_MANAGER = true
1717

1818
#AQ_RS_EXTRA_OPTS = false
1919
#AQ_CONTAINER = false // this is for compiling for containers

README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ Designed to mimic AqualinkRS devices, used to fully configure the master control
8787
* Create iAqualink Touch Simulator
8888
* Probably decoded enough protocols for AuqlinkD to self configure.
8989

90+
9091
<!--
9192
* NEED TO FIX for PDA and iAQT protocol.
9293
* Not always doing on/off
@@ -110,7 +111,10 @@ Designed to mimic AqualinkRS devices, used to fully configure the master control
110111
# Call for Help.
111112
* 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)
112113

113-
# Updates in 2.3.8 (Dev)
114+
# Updates in 2.3.8
115+
* <b>WARNING</b> Breaking change if you use dimmer (please change button_??_lightMode from 6 to 10)
116+
* Fixed bugs with particular Jandy panel versions and color lights.
117+
* Added support for more color lights, and sped up programming
114118
* Code & Repo refactor
115119
* Decoded more Pentair VSP pump status.
116120
* Changed VSP pump status handling (display more in web UI).

release/aqualinkd-amd64

-535 KB
Binary file not shown.

release/aqualinkd-arm64

4.79 KB
Binary file not shown.

release/aqualinkd-armhf

480 Bytes
Binary file not shown.

release/aqualinkd.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ use_panel_aux_labels=no
260260
# button_01_pumpIndex=1
261261
# 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.
262262
#
263-
# button_xx_lightMode = (0=Aqualink program, 1=Jandy, 2=Jandy LED, 3=SAm/SAL, 4=Color Logic, 5=Intellibrite, 6=Dimmer)
263+
# 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)
264264
#
265265
# Below are settings for standard buttons on RS-8 Combo panel used as example.
266266
button_01_label=Filter Pump

release/serial_logger-amd64

-76.4 KB
Binary file not shown.

release/serial_logger-arm64

0 Bytes
Binary file not shown.

release/serial_logger-armhf

0 Bytes
Binary file not shown.

source/allbutton.c

+8
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ void processLEDstate(struct aqualinkdata *aq_data)
4747
LOG(ALLB_LOG,LOG_NOTICE, "%s = %d", aq_data->aqbuttons[i].name, aq_data->aqualinkleds[i].state);
4848
}
4949
*/
50+
#ifdef CLIGHT_PANEL_FIX // Use state from RSSD protocol for color light if it's on.
51+
for (int i=0; i < aq_data->num_lights; i++) {
52+
if ( aq_data->lights[i].RSSDstate == ON && aq_data->lights[i].button->led->state != ON ) {
53+
aq_data->lights[i].button->led->state = aq_data->lights[i].RSSDstate;
54+
//LOG(ALLB_LOG,LOG_WARNING,"Fix Jandy bug, color light '%s' is on, setting status to match!\n", aq_data->lights[i].button->label);
55+
}
56+
}
57+
#endif
5058
}
5159

5260
void setUnits(char *msg, struct aqualinkdata *aq_data)

source/aq_panel.c

+59-1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ uint8_t getPanelSupport( char *rev_string, int rev_len)
6161
// Rev >=Q == iaqualink touch protocol.
6262
// REv >= P == chemlink
6363
// Rev >= HH serial adapter.
64+
// Rev >= L == JandyColors Smart Light Control
65+
// Rev >= MMM = 12V JandyColor Lights (also light dimmer)
66+
// Rev >= N Hayward ColorLogic LED Light
67+
// Rev >= O.1== Jandy WaterColors LED ( 9 colors )
68+
// Rev >= T.0.1 == limited color light
69+
// Rec >= T.2 == full color lights
6470

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

7278
if (REV[0] >= 79) // O in ascii
7379
supported |= RSP_SUP_VSP;
74-
80+
7581
if (REV[0] >= 73) // I in ascii
7682
supported |= RSP_SUP_ONET;
7783

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

87+
if (REV[0] >= 77) // M in ascii
88+
supported |= REP_SUP_CLIT1;
89+
90+
if (REV[0] >= 78) // N in ascii
91+
supported |= REP_SUP_CLIT2;
92+
93+
if (REV[0] >= 79) // O in ascii
94+
supported |= REP_SUP_CLIT3;
95+
96+
if (REV[0] > 84 || (REV[0] == 84 && REV[1] == 64 && REV[2] >= 50) ) // T in ascii (or T and . and 2 )
97+
supported |= REP_SUP_CLIT4;
98+
8199
}
82100

83101
return supported;
@@ -302,6 +320,7 @@ void initPanelButtons(struct aqualinkdata *aqdata, bool rs, int size, bool combo
302320
aqdata->aqbuttons[index].code = KEY_PUMP;
303321
aqdata->aqbuttons[index].dz_idx = DZ_NULL_IDX;
304322
aqdata->aqbuttons[index].special_mask = 0;
323+
aqdata->aqbuttons[index].rssd_code = RS_SA_PUMP;
305324
index++;
306325

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

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

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

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

345368

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

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

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

376402
aqdata->aqbuttons[index].led = &aqdata->aqualinkleds[1-1];
@@ -380,6 +406,7 @@ void initPanelButtons(struct aqualinkdata *aqdata, bool rs, int size, bool combo
380406
aqdata->aqbuttons[index].code = KEY_AUX7;
381407
aqdata->aqbuttons[index].dz_idx = DZ_NULL_IDX;
382408
aqdata->aqbuttons[index].special_mask = 0;
409+
aqdata->aqbuttons[index].rssd_code = RS_SA_AUX7;
383410
index++;
384411
}
385412
#ifdef AQ_RS16
@@ -401,6 +428,7 @@ void initPanelButtons(struct aqualinkdata *aqdata, bool rs, int size, bool combo
401428
aqdata->aqbuttons[index].code = KEY_AUXB1;
402429
aqdata->aqbuttons[index].dz_idx = DZ_NULL_IDX;
403430
aqdata->aqbuttons[index].special_mask = 0;
431+
aqdata->aqbuttons[index].rssd_code = RS_SA_AUX8;
404432
index++;
405433

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

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

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

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

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

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

461495
aqdata->aqbuttons[index].led = &aqdata->aqualinkleds[24-1]; // doesn't actually exist
@@ -465,6 +499,7 @@ void initPanelButtons(struct aqualinkdata *aqdata, bool rs, int size, bool combo
465499
aqdata->aqbuttons[index].code = KEY_AUXB8;
466500
aqdata->aqbuttons[index].dz_idx = DZ_NULL_IDX;
467501
aqdata->aqbuttons[index].special_mask = 0;
502+
aqdata->aqbuttons[index].rssd_code = RS_SA_AUX15;
468503
index++;
469504
}
470505
#endif // AQ_RS16
@@ -479,6 +514,7 @@ void initPanelButtons(struct aqualinkdata *aqdata, bool rs, int size, bool combo
479514
aqdata->aqbuttons[index].code = KEY_AUX6;
480515
aqdata->aqbuttons[index].dz_idx = DZ_NULL_IDX;
481516
aqdata->aqbuttons[index].special_mask = 0;
517+
aqdata->aqbuttons[index].rssd_code = RS_SA_AUX6;
482518
index++;
483519
}
484520
//Dual panels (2/10 & 2/14) have no AUX7, they go from AUX6 to AUXB1, but the keycodes are the same as other panels
@@ -664,9 +700,17 @@ bool setDeviceState(struct aqualinkdata *aqdata, int deviceIndex, bool isON, req
664700
// Domoticz has a bad habbit of resending the same state back to us, when we use the PRESTATE_ONOFF option
665701
// since allbutton (default) is stateless, and rssaadapter is statefull, use rssaadapter for any domoricz requests
666702
set_aqualink_rssadapter_aux_state(deviceIndex, isON);
703+
} else if (button->special_mask & PROGRAM_LIGHT && isRSSA_ENABLED) {
704+
// If off and program light, use the RS serial adapter since that is overiding the state now.
705+
set_aqualink_rssadapter_aux_state(deviceIndex, isON);
667706
} else {
668707
aq_send_allb_cmd(button->code);
669708
}
709+
710+
#ifdef CLIGHT_PANEL_FIX
711+
if (isRSSA_ENABLED) {get_aqualink_rssadapter_colorlight_statuses(aqdata);}
712+
#endif
713+
670714
// Pre set device to state, next status will correct if state didn't take, but this will stop multiple ON messages setting on/off
671715
//#ifdef PRESTATE_ONOFF
672716
if (_aqconfig_.device_pre_state) {
@@ -750,6 +794,20 @@ void programDeviceLightMode(struct aqualinkdata *aqdata, int value, int button)
750794
_aqconfig_.light_programming_initial_off,
751795
_aqconfig_.light_programming_mode );
752796
aq_programmer(AQ_SET_LIGHTPROGRAM_MODE, buf, aqdata);
797+
} else if (isRSSA_ENABLED && light->lightType != LC_DIMMER) {
798+
unsigned char rssd_value = value;
799+
set_aqualink_rssadapter_aux_extended_state(light->button, rssd_value);
800+
} else if (isRSSA_ENABLED && light->lightType == LC_DIMMER) {
801+
// Dimmer needs to be turned on first
802+
set_aqualink_rssadapter_aux_extended_state(light->button, RS_SA_ON);
803+
// Value 1 = 25, 1 = 50, 3 = 75, 4 = 100 (need to convert value into binary)
804+
if (value >= 1 && value <= 4) {
805+
// If value is not on of those vales, then ignore
806+
unsigned char rssd_value = value * 25;
807+
set_aqualink_rssadapter_aux_extended_state(light->button, rssd_value);
808+
} else {
809+
LOG(PANL_LOG,LOG_ERR, "Light mode %d is not valid for '%s'\n",value, light->button->label);
810+
}
753811
} else {
754812
//sprintf(buf, "%-5s%-5d%-5d",value, button, light->lightType);
755813
sprintf(buf, "%-5d%-5d%-5d",value, button, light->lightType);

source/aq_panel.h

+5
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@
3838
#define RSP_SUP_VSP (1 << 2)
3939
#define RSP_SUP_CHEM (1 << 3)
4040
#define RSP_SUP_SERA (1 << 4) // Serial adapter
41+
#define REP_SUP_CLIT1 (1 << 5) // color lights (first suppoer)
42+
#define REP_SUP_CLIT2 (1 << 6) // color lights
43+
#define REP_SUP_CLIT3 (1 << 7) // color lights
44+
#define REP_SUP_CLIT4 (1 << 8) // Full color lights (T.2)
45+
4146

4247
//void initButtons(struct aqualinkdata *aqdata);
4348
void setPanelByName(struct aqualinkdata *aqdata, const char *str);

source/aq_serial.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,7 @@ void send_packet(int fd, unsigned char *packet, int length)
872872
//LOG(RSSD_LOG,LOG_DEBUG_SERIAL, "Serial write %d bytes\n",length-2);
873873
//LOG(RSSD_LOG,LOG_DEBUG, "Serial write %d bytes, type 0x%02hhx cmd 0x%02hhx\n",length-2,packet[5],packet[6]);
874874
if (_aqconfig_.log_protocol_packets || getLogLevel(RSSD_LOG) >= LOG_DEBUG_SERIAL)
875-
logPacketWrite(&packet[1], length-2);
875+
logPacketWrite(&packet[1], length-1);
876876
/*
877877
if (getLogLevel(PDA_LOG) == LOG_DEBUG) {
878878
char buff[1024];

source/aqualink.h

+11
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
#endif
1919

2020

21+
#define CLIGHT_PANEL_FIX // Overcome bug in some jandy panels where color light status of on is not in LED status
22+
2123
#define TIME_CHECK_INTERVAL 3600
2224
//#define TIME_CHECK_INTERVAL 100 // DEBUG ONLY
2325
#define ACCEPTABLE_TIME_DIFF 120
@@ -81,6 +83,7 @@ typedef struct aqualinkkey
8183
// char *pda_label;
8284
//#endif
8385
unsigned char code;
86+
unsigned char rssd_code;
8487
int dz_idx;
8588
uint8_t special_mask;
8689
} aqkey;
@@ -199,6 +202,10 @@ typedef enum clight_type {
199202
LC_SAL,
200203
LC_CLOGIG,
201204
LC_INTELLIB,
205+
LC_HAYWCL,
206+
LC_SPARE_1,
207+
LC_SPARE_2,
208+
LC_SPARE_3,
202209
LC_DIMMER,
203210
NUMBER_LIGHT_COLOR_TYPES // This is used to size and count so add more prior to this
204211
} clight_type;
@@ -216,6 +223,7 @@ typedef struct clightd
216223
clight_type lightType;
217224
aqkey *button;
218225
int currentValue;
226+
aqledstate RSSDstate; // state from rs serial adapter
219227
} clight_detail;
220228

221229

@@ -305,6 +313,9 @@ struct aqualinkdata
305313
struct timespec last_active_time;
306314
struct timespec start_active_time;
307315
#endif
316+
317+
// Overcome color light bug, by reconnecting allbutton panel.
318+
//bool reconnectAllButton;
308319
};
309320

310321

source/aqualinkd.c

+11
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,16 @@ int startup(char *self, char *cfgFile)
694694
_aqualink_data.aqbuttons[i].name, _aqualink_data.aqbuttons[i].label, ext);
695695
}
696696
}
697+
/*
698+
for (i=0; i < _aqualink_data.total_buttons; i++)
699+
{
700+
LOG(AQUA_LOG,LOG_NOTICE, "Button index=%d, label=%s, code=0x%02hhx, rssd code=0x%02hhx\n",
701+
i,
702+
_aqualink_data.aqbuttons[i].label,
703+
_aqualink_data.aqbuttons[i].code,
704+
_aqualink_data.aqbuttons[i].rssd_code);
705+
}
706+
*/
697707

698708
if (_aqconfig_.deamonize == true)
699709
{
@@ -878,6 +888,7 @@ void main_loop()
878888

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

883894
if (_aqconfig_.force_swg == true) {

0 commit comments

Comments
 (0)