diff --git a/README.md b/README.md
index 0d114073..de39019a 100644
--- a/README.md
+++ b/README.md
@@ -111,7 +111,30 @@ 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
+
+
+# Updates in 2.3.9 (dev 0.1) -> Under development
+* Added support for One Touch Buttons & Custom Virtual Buttons (new in Jandy Rev Yg).
+ * look at `virtual_button??_label` in aqualinkd.conf
+ * have to use AqualinkTouch protocol for `extended_device_id` 0x31->0x33 in aqualinkd.conf
+* PDA panel Rev 6.0 or newer that do not have a Jandy iAqualink device attached can use the AqualinkTouch protocol rather than PDA protocol.
+ * This is faster, more reliable and does not intefear with the physical PDA device (like existing implimentation)
+ * Please consider this very much BETA at the moment.
+ * use `rssa_device_id=0x33` in aqualinkd.conf
+
+# Updates in Release 2.3.8
* WARNING 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
@@ -123,17 +146,7 @@ Designed to mimic AqualinkRS devices, used to fully configure the master control
* Updates to serial_logger.
* Changes to aqmanager for adding more options for decoding protocols.
* Support for packets changes from panels REV Yg
-
+* Support VSP by label (not pump number), REV Yg
# Updates in Release 2.3.7
* Fix for Pentair VSP losing connection & bouncing SWG to 0 and back.
diff --git a/release/aqualinkd-amd64 b/release/aqualinkd-amd64
new file mode 100755
index 00000000..a8fa4025
Binary files /dev/null and b/release/aqualinkd-amd64 differ
diff --git a/release/aqualinkd-arm64 b/release/aqualinkd-arm64
index 7dac5096..e568f5e4 100755
Binary files a/release/aqualinkd-arm64 and b/release/aqualinkd-arm64 differ
diff --git a/release/aqualinkd-armhf b/release/aqualinkd-armhf
index c6458fb3..36c46e0b 100755
Binary files a/release/aqualinkd-armhf and b/release/aqualinkd-armhf differ
diff --git a/release/aqualinkd.conf b/release/aqualinkd.conf
index 4d8d3930..a341dc07 100755
--- a/release/aqualinkd.conf
+++ b/release/aqualinkd.conf
@@ -211,11 +211,12 @@ use_panel_aux_labels=no
# These are all the button labels / options / pump and light configurations you want to use.
# Simply change these to your setup, valid options for wach button are :-
# None of these are mandatory unless you have PDA or RS16 panel, then _label is mandatory
-# button_??_label=Filter Pump
+# button_??_label=Filter Pump
# button_??_dzidx=37
# button_??_pumpID=0x60
# button_??_pumpIndex=1
# button_??_pumpType=Pentair VF
+# button_??_pumpName=My Pump
# button_??_lightMode=4
#
# In most cases the label is just what you want to see in web UI/MQTT/API. ie you don't need to use Jandy's labeling. There are 2 exaeptions to the labeling listed below
@@ -289,3 +290,16 @@ button_11_label=Spa Heater
button_12_label=Solar Heater
+# Virtual buttons.
+# To use these you must have extended_device_id set to AqualnkTouch protocol, ie 0x31, 0x31, 0x32, 0x33
+# These are the One Touch buttons. By default below are the labels
+# Panels rev Yg and newer support custom virtual buttons as well, simply add these here
+# Add the ones you would like to use below, making sure to
+# a) Sequential order of the button number starting 01
+# b) Label must be IDENTICAL to how it's displayed on a AqualinkTouch device (or web)
+#
+#virtual_button_01_label=Spa Mode
+#virtual_button_02_label=Clean Mode
+#virtual_button_03_label = OneTouch 4
+#virtual_button_04_label = OneTouch 5
+#virtual_button_05_label = OneTouch 6
\ No newline at end of file
diff --git a/release/install.sh b/release/install.sh
index 8d4a40f9..7e678815 100755
--- a/release/install.sh
+++ b/release/install.sh
@@ -129,6 +129,20 @@ else
fi
fi
+# V2.3.9 has kind-a breaking change for config.js, so check existing and rename if needed
+# we added Aux_V? to the button list
+if [ -f "$WEBLocation/config.js" ]; then
+ # Test is if has AUX_V1 in file
+ if ! grep -q Aux_V1 ./config.js; then
+ $dateext=`date +%Y%m%d_%H_%M_%S`
+ echo "AqualinkD web config is old, making copy to $WEBLocation/config.js.$dateext"
+ echo "Please make changes to new version $WEBLocation/config.js"
+ mv $WEBLocation/config.js $WEBLocation/config.js.$dateext
+ fi
+fi
+
+
+
# copy files to locations, but only copy cfg if it doesn;t already exist
cp $BUILD/$SOURCEBIN $BINLocation/$BIN
diff --git a/release/serial_logger-amd64 b/release/serial_logger-amd64
new file mode 100755
index 00000000..e83e1581
Binary files /dev/null and b/release/serial_logger-amd64 differ
diff --git a/release/serial_logger-arm64 b/release/serial_logger-arm64
index 1a7a6022..6c6875ad 100755
Binary files a/release/serial_logger-arm64 and b/release/serial_logger-arm64 differ
diff --git a/release/serial_logger-armhf b/release/serial_logger-armhf
index dd788cb7..854861aa 100755
Binary files a/release/serial_logger-armhf and b/release/serial_logger-armhf differ
diff --git a/source/aq_panel.c b/source/aq_panel.c
index b683b6fa..f410f11f 100644
--- a/source/aq_panel.c
+++ b/source/aq_panel.c
@@ -48,29 +48,48 @@ char *name2label(char *str)
}
// This has NOT been tested.
-uint8_t getPanelSupport( char *rev_string, int rev_len)
+uint16_t getPanelSupport( char *rev_string, int rev_len)
{
- uint8_t supported = 0;
+ uint16_t supported = 0;
char REV[5];
+ if (! rsm_get_revision(REV, rev_string, rev_len) ) {
+ LOG(PANL_LOG,LOG_ERR, "Couldn't get panel revision from '%s'\n",rev_string);
+ return 0; // No point in continue
+ } else if (REV[0] > 90 || REV[0] < 65) { // > Z or < A
+ LOG(PANL_LOG,LOG_WARNING, "Panel revision is not understood '%s', please report this issue");
+ }
+
+
// Get the actual rev letter
- if ( rsm_get_revision(REV, rev_string, rev_len) ) {
+ //if ( rsm_get_revision(REV, rev_string, rev_len) ) {
// Rev >=I == one touch protocol
// Rev >=O == VSP
// Rev >=Q == iaqualink touch protocol.
// REv >= P == chemlink
- // Rev >= HH serial adapter.
+ // Rev >= I serial adapter.
+ // Rev >= F == Dommer. But need serial protocol so set to I
// 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
+ // Rec >= T.2 == more color lights
+ // Rev >= Q Aqualink Touch protocol
+ // Rev >= R iAqualink (wifi adapter) protocol
+ // Rev >= L PC Dock
+ // Rev >= W pump label (not number)
+ // Rev >= Yg Virtual Device called Label Auxiliraries
+
+ if (REV[0] > 89 || ( REV[0] == 89 && REV[1] >= 103))
+ supported |= RSP_SUP_VBTN;
- // Rev Yg (and maybe before) has Pump label (not number), and also Virtual Device called Label Auxiliraries
if (REV[0] >= 81) // Q in ascii
- supported |= RSP_SUP_IAQT;
+ supported |= RSP_SUP_AQLT;
+
+ if (REV[0] >= 82) // R
+ supported |= RSP_SUP_IAQL;
if (REV[0] >= 80) // P in ascii
supported |= RSP_SUP_CHEM;
@@ -78,25 +97,22 @@ 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
+ 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;
+ supported |= RSP_SUP_RSSA;
+ supported |= RSP_SUP_SWG;
+ }
- if (REV[0] >= 77) // M in ascii
- supported |= REP_SUP_CLIT1;
+ if (REV[0] >= 76) // L in ascii
+ supported |= RSP_SUP_CLIT;
- if (REV[0] >= 78) // N in ascii
- supported |= REP_SUP_CLIT2;
+ if (REV[0] >= 73) // I in ascii, dimmer came out in F, but we use the serial adapter to set, so use that as support
+ supported |= RSP_SUP_DLIT;
- 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;
+ //if (REV[0] > 84 || (REV[0] == 84 && REV[1] == 64 && REV[2] >= 50) ) // T in ascii (or T and . and 2 )
+ // supported |= RSP_SUP_CLIT4;
- }
+ //}
return supported;
}
@@ -164,7 +180,6 @@ setPanel("RS-8 Combo");
}
*/
-
char _panelString[60];
void setPanelString()
{
@@ -309,6 +324,43 @@ void setPanelByName(struct aqualinkdata *aqdata, const char *str)
setPanel(aqdata, rs, size, combo, dual);
}
+aqkey *addVirtualButton(struct aqualinkdata *aqdata, char *label, int vindex) {
+ if (aqdata->total_buttons + 1 >= TOTAL_BUTTONS) {
+ return NULL;
+ }
+ if (aqdata->virtual_button_start <= 0) {
+ aqdata->virtual_button_start = aqdata->total_buttons;
+ }
+ aqkey *button = &aqdata->aqbuttons[aqdata->total_buttons++];
+
+ //aqdata->aqbuttons[index].led = ;
+ //aqdata->aqbuttons[index].led->state = LED_S_UNKNOWN;
+ //aqdata->aqbuttons[index].label = // copy label;
+ //aqdata->aqbuttons[index].name = // aux_v?; ? is vindex
+ //aqdata->aqbuttons[index].code = NUL;
+ //aqdata->aqbuttons[index].dz_idx = DZ_NULL_IDX;
+ //aqdata->aqbuttons[index].special_mask = 0;
+
+ aqled *led = malloc(sizeof(aqled));
+ button->led = led;
+
+ char *name = malloc(sizeof(char*) * 10);
+ snprintf(name, 9, "%s%d", BTN_VAUX, vindex);
+ button->name = name;
+
+ if (strlen(label) <= 0) {
+ button->label = name;
+ } else {
+ button->label = label;
+ }
+ button->code = NUL;
+ button->dz_idx = DZ_NULL_IDX;
+ button->special_mask |= VIRTUAL_BUTTON; // Could change to special mask vbutton
+
+ return button;
+}
+
+
// 4,6,8,10,12,14
void initPanelButtons(struct aqualinkdata *aqdata, bool rs, int size, bool combo, bool dual) {
@@ -556,9 +608,9 @@ void initPanelButtons(struct aqualinkdata *aqdata, bool rs, int size, bool combo
aqdata->aqbuttons[index].special_mask = 0;
index++;
+ // Set the sizes for button index
aqdata->total_buttons = index;
-
- //aqdata->single_device = !combo;
+ aqdata->virtual_button_start = 0;
#ifdef AQ_RS16
aqdata->rs16_vbutton_start = 13 - (combo?0:1);
@@ -696,6 +748,15 @@ bool setDeviceState(struct aqualinkdata *aqdata, int deviceIndex, bool isON, req
//set_light_mode("0", deviceIndex); // 0 means use current light mode
programDeviceLightMode(aqdata, 0, deviceIndex); // 0 means use current light mode
}
+ } else if (button->special_mask & VIRTUAL_BUTTON) {
+ // Virtual buttons only supported with Aqualink Touch
+ if (isIAQT_ENABLED) {
+ char msg[PTHREAD_ARG];
+ sprintf(msg, "%-5d%-5d", deviceIndex, (isON == false ? OFF : ON));
+ aq_programmer(AQ_SET_IAQTOUCH_DEVICE_ON_OFF, msg, aqdata);
+ } else {
+ LOG(PANL_LOG, LOG_ERR, "Can only use Aqualink Touch protocol for Virtual Buttons");
+ }
} else if ( source == NET_DZMQTT && isRSSA_ENABLED ) {
// 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
@@ -1349,4 +1410,4 @@ void initButtons_OLD_RS16(struct aqualinkdata *aqdata)
}
-#endif
\ No newline at end of file
+#endif
diff --git a/source/aq_panel.h b/source/aq_panel.h
index 8ce2066a..f3a6e571 100644
--- a/source/aq_panel.h
+++ b/source/aq_panel.h
@@ -33,15 +33,18 @@
// Bitmask for pannel support against board rev
// used in getPanelSupport()
-#define RSP_SUP_ONET (1 << 0)
-#define RSP_SUP_IAQT (1 << 1)
-#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)
+#define RSP_SUP_ONET (1 << 0)
+#define RSP_SUP_AQLT (1 << 1) // Aqualink Touch
+#define RSP_SUP_IAQL (1 << 2 ) // iAqualink Wifi
+#define RSP_SUP_RSSA (1 << 3 ) // RS Serial Adapter
+#define RSP_SUP_VSP (1 << 4)
+#define RSP_SUP_CHEM (1 << 5) // chem feeder
+#define RSP_SUP_TSCHEM (1 << 6 ) // true sense chem reader
+#define RSP_SUP_SWG (1 << 7) // Salt water generator
+#define RSP_SUP_CLIT (1 << 8) // color lights
+#define RSP_SUP_DLIT (1 << 9) // dimmer lights
+#define RSP_SUP_VBTN (1 << 10) // Virtual button
+#define RSP_SUP_PLAB (1 << 11) // Pump VSP by Label and not number
//void initButtons(struct aqualinkdata *aqdata);
@@ -59,7 +62,9 @@ void addPanelIAQTouchInterface();
void addPanelRSserialAdapterInterface();
void changePanelToExtendedIDProgramming();
-uint8_t getPanelSupport( char *rev_string, int rev_len);
+uint16_t getPanelSupport( char *rev_string, int rev_len);
+
+aqkey *addVirtualButton(struct aqualinkdata *aqdata, char *label, int vindex);
//void panneltest();
#define isPDA_PANEL ((_aqconfig_.paneltype_mask & RSP_PDA) == RSP_PDA)
diff --git a/source/aq_serial.h b/source/aq_serial.h
index ec4fd1ff..ba556f0e 100644
--- a/source/aq_serial.h
+++ b/source/aq_serial.h
@@ -246,6 +246,8 @@ DEV_UNKNOWN_MASK = 0xF8; // Unknown mask, used to reset values
#define BTN_TEMP1_HTR "Temp1_Heater"
#define BTN_TEMP2_HTR "Temp2_Heater"
+#define BTN_VAUX "Aux_V" // A number will be appended
+
#ifdef AQ_RS16
#define BTN_AUXB1 "Aux_B1"
#define BTN_AUXB2 "Aux_B2"
@@ -582,4 +584,4 @@ bool onetouch_mode();
//void send_test_cmd(int fd, unsigned char destination, unsigned char b1, unsigned char b2, unsigned char b3);
//void send_command(int fd, unsigned char destination, unsigned char b1, unsigned char b2, unsigned char b3);
//void send_messaged(int fd, unsigned char destination, char *message);
-#endif // AQ_SERIAL_H_
\ No newline at end of file
+#endif // AQ_SERIAL_H_
diff --git a/source/aqualink.h b/source/aqualink.h
index 19e02859..1fddd1e0 100644
--- a/source/aqualink.h
+++ b/source/aqualink.h
@@ -66,6 +66,8 @@ bool checkAqualinkTime(); // Only need to externalise this for PDA
#define MAX_PUMPS 4
#define MAX_LIGHTS 4
+bool isVirtualButtonEnabled();
+
enum {
FAHRENHEIT,
CELSIUS,
@@ -93,7 +95,7 @@ typedef struct aqualinkkey
#define PROGRAM_LIGHT (1 << 1)
#define TIMER_ACTIVE (1 << 2)
//#define DIMMER_LIGHT (1 << 3) // NOT USED (Use PROGRAM_LIGHT or type LC_DIMMER)
-
+#define VIRTUAL_BUTTON (1 << 4)
//typedef struct ProgramThread ProgramThread; // Definition is later
struct programmingthread {
@@ -242,6 +244,7 @@ struct aqualinkdata
aqled aqualinkleds[TOTAL_LEDS];
aqkey aqbuttons[TOTAL_BUTTONS];
unsigned short total_buttons;
+ unsigned short virtual_button_start;
int air_temp;
int pool_temp;
int spa_temp;
diff --git a/source/aqualinkd.c b/source/aqualinkd.c
index 42c884f0..6b52f1f1 100644
--- a/source/aqualinkd.c
+++ b/source/aqualinkd.c
@@ -127,6 +127,10 @@ void intHandler(int sig_num)
#endif
}
+bool isVirtualButtonEnabled() {
+ return _aqualink_data.virtual_button_start>0?true:false;
+}
+
// Should move to panel.
bool checkAqualinkTime()
{
diff --git a/source/config.c b/source/config.c
index 9c483113..ec9fcedb 100644
--- a/source/config.c
+++ b/source/config.c
@@ -693,7 +693,7 @@ bool setConfigValue(struct aqualinkdata *aqdata, char *param, char *value) {
//pump->pumpType = EPUMP; // For testing let the interface set this
}
} else {
- LOG(AQUA_LOG,LOG_ERR, "Config error, VSP Pumps limited to %d, ignoring %s'\n",MAX_PUMPS,param);
+ LOG(AQUA_LOG,LOG_ERR, "Config error, VSP Pumps limited to %d, ignoring : %s",MAX_PUMPS,param);
}
rtn=true;
} else if (strncasecmp(param + 9, "_pumpIndex", 10) == 0) { //button_01_pumpIndex=1
@@ -701,7 +701,7 @@ bool setConfigValue(struct aqualinkdata *aqdata, char *param, char *value) {
if (pump != NULL) {
pump->pumpIndex = strtoul(value, NULL, 10);
} else {
- LOG(AQUA_LOG,LOG_ERR, "Config error, VSP Pumps limited to %d, ignoring %s'\n",MAX_PUMPS,param);
+ LOG(AQUA_LOG,LOG_ERR, "Config error, VSP Pumps limited to %d, ignoring : %s",MAX_PUMPS,param);
}
rtn=true;
} else if (strncasecmp(param + 9, "_pumpType", 9) == 0) {
@@ -715,7 +715,7 @@ bool setConfigValue(struct aqualinkdata *aqdata, char *param, char *value) {
else if ( stristr(value, "Jandy ePump") != 0)
pump->pumpType = EPUMP;
} else {
- LOG(AQUA_LOG,LOG_ERR, "Config error, VSP Pumps limited to %d, ignoring %s'\n",MAX_PUMPS,param);
+ LOG(AQUA_LOG,LOG_ERR, "Config error, VSP Pumps limited to %d, ignoring : %s",MAX_PUMPS,param);
}
rtn=true;
} else if (strncasecmp(param + 9, "_pumpName", 9) == 0) { //button_01_pumpIndex=1
@@ -724,32 +724,30 @@ bool setConfigValue(struct aqualinkdata *aqdata, char *param, char *value) {
//pump->pumpName = cleanalloc(value);
strncpy(pump->pumpName ,cleanwhitespace(value), PUMP_NAME_LENGTH-1);
} else {
- LOG(AQUA_LOG,LOG_ERR, "Config error, VSP Pumps limited to %d, ignoring %s'\n",MAX_PUMPS,param);
+ LOG(AQUA_LOG,LOG_ERR, "Config error, VSP Pumps limited to %d, ignoring : %s",MAX_PUMPS,param);
}
rtn=true;
}
- /*
- } else if (strncasecmp(param + 9, "_pumpID", 7) == 0) {
- //aqdata->aqbuttons[num].pda_label = cleanalloc(value);
- //96 to 111 = Pentair, 120 to 123 = Jandy
- if (pi < MAX_PUMPS) {
- aqdata->pumps[pi].button = &aqdata->aqbuttons[num];
- aqdata->pumps[pi].pumpID = strtoul(cleanalloc(value), NULL, 16);
- aqdata->pumps[pi].pumpIndex = pi+1;
- //aqdata->pumps[pi].buttonID = num;
- if (aqdata->pumps[pi].pumpID < 119)
- aqdata->pumps[pi].ptype = PENTAIR;
- else
- aqdata->pumps[pi].ptype = JANDY;
- pi++;
-
+#if defined AQ_IAQTOUCH
+ } else if (strncasecmp(param, "virtual_button_", 15) == 0) {
+ rtn=true;
+ if (_aqconfig_.paneltype_mask == 0) {
+ // ERROR the vbutton will be irnored.
+ LOG(AQUA_LOG,LOG_WARNING, "Config error, Panel type mush be definied before adding a virtual_button, ignored setting : %s",param);
+ } else if (_aqconfig_.extended_device_id < 0x30 || _aqconfig_.extended_device_id > 0x33 ) {
+ LOG(AQUA_LOG,LOG_WARNING, "Config error, extended_device_id must on of the folowing (0x30,0x31,0x32,0x33), ignored setting : %s",param);
+ } else if (strncasecmp(param + 17, "_label", 6) == 0) {
+ int num = strtoul(param + 15, NULL, 10);
+ char *label = cleanalloc(value);
+ aqkey *button = addVirtualButton(aqdata, label, num);
+ if (button != NULL) {
+ button->special_mask |= VIRTUAL_BUTTON;
} else {
- LOG(AQUA_LOG,LOG_ERR, "Config error, VSP Pumps limited to %d, ignoring %s'\n",MAX_PUMPS,param);
+ LOG(AQUA_LOG,LOG_WARNING, "Error with '%s', total buttons=%d, config has %d already, ignoring!\n",param, TOTAL_BUTTONS, aqdata->total_buttons+1);
}
- rtn=true;
- } else if (strncasecmp(param + 9, "_pumpIndex", 10) == 0) { //button_01_pumpIndex=1
- }*/
+ }
}
+#endif
return rtn;
}
diff --git a/source/iaqtouch.c b/source/iaqtouch.c
index ee26a98c..e6947e99 100644
--- a/source/iaqtouch.c
+++ b/source/iaqtouch.c
@@ -28,6 +28,9 @@
#include "rs_msg_utils.h"
#include "devices_jandy.h"
+
+#define NEW_POLL_CYCLE
+
void temp_debugprintExtraInfo(unsigned char *pk, int length);
@@ -284,6 +287,61 @@ void processTableMessage(unsigned char *message, int length)
LOG(IAQT_LOG,LOG_ERR, "Run out of IAQT table buffer, need %d have %d\n",(int)message[5],IAQ_MSG_TABLE_LINES);
}
+// aqualinkd button found and updated, AQstart & AQend are index of aqualinkd button array
+void updateAQButtonFromPageButton(struct aqualinkdata *aq_data, struct iaqt_page_button *pageButton, int AQstartIndex, int AQendIndex)
+{
+
+ for (int i = AQstartIndex; i < AQendIndex; i++)
+ {
+ //LOG(IAQT_LOG,LOG_DEBUG, "Button compare '%s' to '%s'\n",pageButton->name, aq_data->aqbuttons[i].label);
+
+ int rtn = -1;
+ // If we are loading HOME page then simply button name is the label ie "Aux3"
+ // If loading DEVICES? page then button name + status is "Aux3 OFF "
+ if (_currentPageLoading == IAQ_PAGE_HOME)
+ rtn = rsm_strmatch((const char *)pageButton->name, aq_data->aqbuttons[i].label);
+ else
+ rtn = rsm_strmatch_ignore((const char *)pageButton->name, aq_data->aqbuttons[i].label, 5); // 5 = 3 chars and 2 spaces ' OFF '
+
+ if (rtn == 0)
+ {
+ if (rtn == 0)
+ {
+ LOG(IAQT_LOG,LOG_DEBUG, "*** Found Status for %s state 0x%02hhx\n", aq_data->aqbuttons[i].label, pageButton->state);
+ switch(pageButton->state) {
+ case 0x00:
+ if (aq_data->aqbuttons[i].led->state != OFF) {
+ aq_data->aqbuttons[i].led->state = OFF;
+ aq_data->updated = true;
+ }
+ break;
+ case 0x01:
+ if (aq_data->aqbuttons[i].led->state != ON) {
+ aq_data->aqbuttons[i].led->state = ON;
+ aq_data->updated = true;
+ }
+ break;
+ case 0x02:
+ if (aq_data->aqbuttons[i].led->state != FLASH) {
+ aq_data->aqbuttons[i].led->state = FLASH;
+ aq_data->updated = true;
+ }
+ break;
+ case 0x03:
+ if (aq_data->aqbuttons[i].led->state != ENABLE) {
+ aq_data->aqbuttons[i].led->state = ENABLE;
+ aq_data->updated = true;
+ }
+ break;
+ default:
+ LOG(IAQT_LOG,LOG_NOTICE, "Unknown state 0x%02hhx for button %s\n",pageButton->state,pageButton->name);
+ break;
+ }
+ }
+ }
+ }
+}
+
void processPageButton(unsigned char *message, int length, struct aqualinkdata *aq_data)
{
struct iaqt_page_button *button;
@@ -328,8 +386,22 @@ void processPageButton(unsigned char *message, int length, struct aqualinkdata *
// This get's called or every device state change in PDA mode, since we page over all the devices.
// So capture and update the device state
+ if (isPDA_PANEL) {
+ updateAQButtonFromPageButton(aq_data,button,0,aq_data->total_buttons);
+ } else {
+#ifdef AQ_RS16
+ if ( PANEL_SIZE() >= 16) {
+ updateAQButtonFromPageButton(aq_data,button,aq_data->rs16_vbutton_start,aq_data->rs16_vbutton_end + 1);
+ }
+#endif
+ if ( isVirtualButtonEnabled() ) {
+ updateAQButtonFromPageButton(aq_data,button,aq_data->virtual_button_start,aq_data->total_buttons);
+ }
+ }
- if (isPDA_PANEL || PANEL_SIZE() >= 16 ) {
+/*
+ // NSF Add virtual button support below. ( || aq_data->virtual_button_start > 0 )
+ if (isPDA_PANEL || PANEL_SIZE() >= 16) {
int start = 0;
int end = aq_data->total_buttons;
@@ -388,7 +460,7 @@ void processPageButton(unsigned char *message, int length, struct aqualinkdata *
}
}
}
- }
+ } */
}
@@ -684,16 +756,17 @@ void processPage(struct aqualinkdata *aq_data)
dp = 2;
//LOG(IAQT_LOG,LOG_INFO, "Devices Page #1:-\n");
debugPrintButtons(_devicePageButtons[dp]);
-
+#ifndef NEW_POLL_CYCLE
// If Button 15 has type 0x02 then we have previous, if 0x00 nothing (previous send code KEY_IAQTCH_PREV_PAGE)
// If Button 16 has type 0x03 then we have next, if 0x00 nothing (next send code KEY_IAQTCH_NEXT_PAGE)
- if ( (isPDA_PANEL || PANEL_SIZE() >= 16) && !in_iaqt_programming_mode(aq_data) ) {
+ if ( (isPDA_PANEL || isVirtualButtonEnabled() || PANEL_SIZE() >= 16) && !in_iaqt_programming_mode(aq_data) ) {
if (_devicePageButtons[dp][16].type == 0x03) {
iaqt_queue_cmd(KEY_IAQTCH_NEXT_PAGE);
} else {
iaqt_queue_cmd(KEY_IAQTCH_STATUS);
}
}
+#endif
break;
case IAQ_PAGE_COLOR_LIGHT:
//LOG(IAQT_LOG,LOG_INFO, "Color Light Page :-\n");
@@ -793,7 +866,7 @@ void processPage(struct aqualinkdata *aq_data)
}
}
-#define REQUEST_STATUS_POLL_COUNT 50
+#define REQUEST_STATUS_POLL_COUNT 10
bool process_iaqtouch_packet(unsigned char *packet, int length, struct aqualinkdata *aq_data)
{
@@ -931,8 +1004,67 @@ bool process_iaqtouch_packet(unsigned char *packet, int length, struct aqualinkd
/*
NEED TO ALTERNATE SEND KEY_IAQTCH_HOMEP_KEY08 KEY and KEY_IAQTCH_STATUS BELOW FOR PDA
*/
+
// Standard ack/poll
if (packet[3] == CMD_IAQ_POLL) {
+
+#ifdef NEW_POLL_CYCLE
+/*
+// loop device/device1/device2/device3/status/home/
+----------
+if not programming && poll packet {
+ if home page end loaded {
+ reset counter
+ goto device page.
+ }
+
+ if (counter 5 ) {
+ if device goto device 1
+ else if device1 goto device2
+ else if device2 goto device3
+ else if device3 goto status
+ else if status goto Home
+ }
+ increase counter
+}*/
+ if (in_programming_mode(aq_data) == false) {
+ if (_currentPage == IAQ_PAGE_HOME) {
+ iaqt_queue_cmd(KEY_IAQTCH_HOMEP_KEY08);
+ cnt = 0;
+ }
+ //if ( (isPDA_PANEL || isVirtualButtonEnabled() || PANEL_SIZE() >= 16) && !in_iaqt_programming_mode(aq_data) ) {
+ // Just sent Status Page request if none of the above are active
+ //}
+ // After we send devices page in above if statment, kick us through a loop of
+ // devices devices1 devices2 devices2 status.
+ uint8_t nextPageRequestKey = KEY_IAQTCH_HOME;
+
+ if (cnt++ > REQUEST_STATUS_POLL_COUNT) {
+ switch(_currentPage) {
+ case IAQ_PAGE_DEVICES:
+ case IAQ_PAGE_DEVICES_REV_Yg:
+ if (_devicePageButtons[0][16].type == 0x03)
+ nextPageRequestKey = KEY_IAQTCH_NEXT_PAGE;
+ else
+ nextPageRequestKey = KEY_IAQTCH_STATUS;
+ break;
+ case IAQ_PAGE_DEVICES2:
+ if (_devicePageButtons[1][16].type == 0x03)
+ nextPageRequestKey = KEY_IAQTCH_NEXT_PAGE;
+ else
+ nextPageRequestKey = KEY_IAQTCH_STATUS;
+ break;
+ case IAQ_PAGE_DEVICES3:
+ if (_devicePageButtons[1][16].type == 0x03)
+ nextPageRequestKey = KEY_IAQTCH_NEXT_PAGE;
+ else
+ nextPageRequestKey = KEY_IAQTCH_STATUS;
+ break;
+ }
+ iaqt_queue_cmd(nextPageRequestKey);
+ }
+ }
+#else
//LOG(IAQT_LOG,LOG_DEBUG, "poll count %d\n",cnt);
// Load status page every 50 messages
if (cnt++ > REQUEST_STATUS_POLL_COUNT && in_programming_mode(aq_data) == false ) {
@@ -962,6 +1094,7 @@ bool process_iaqtouch_packet(unsigned char *packet, int length, struct aqualinkd
// -5 seems to be too quick for VSP/GPM so using 10
cnt = REQUEST_STATUS_POLL_COUNT - 10;
}
+#endif
// On poll no need to kick programming threads
return false;
}
diff --git a/source/rs_msg_utils.c b/source/rs_msg_utils.c
index e4a1b10d..a5adb7ce 100644
--- a/source/rs_msg_utils.c
+++ b/source/rs_msg_utils.c
@@ -54,6 +54,9 @@ Pull revision from string examples
' REV. O.2 '
'B0029221 REV T.0.1'
' REV T.0.1'
+
+AllButton: Control Panel version B0316823 REV Yg
+
*/
bool rsm_get_revision(char *dest, const char *src, int src_len)
{
@@ -493,4 +496,4 @@ int rsm_HHMM2min(char *message) {
int min = strtoul(message+3, &ptr, 10);
return (hour*60)+min;
-}
\ No newline at end of file
+}
diff --git a/source/version.h b/source/version.h
index e4e36011..7affed8c 100644
--- a/source/version.h
+++ b/source/version.h
@@ -2,4 +2,4 @@
#define AQUALINKD_NAME "Aqualink Daemon"
#define AQUALINKD_SHORT_NAME "AqualinkD"
-#define AQUALINKD_VERSION "2.3.8"
+#define AQUALINKD_VERSION "2.3.9 (dev 0.1)"
diff --git a/web/config.js b/web/config.js
index 76eff02f..a2bf0a1a 100644
--- a/web/config.js
+++ b/web/config.js
@@ -3,7 +3,7 @@
// If the device isn't listed below is will NOT be shown.
// For a complete list returned from your particular aqualinkd instance
// use the below URL and look at the ID value for each device.
- // http://aqualink.ip.address/?command=devices
+ // http://aqualink.ip.address/api/devices
var devices = [
"Filter_Pump",
"Spa_Mode",
@@ -38,6 +38,21 @@
"CHEM/ORP",
"Solar_Heater",
"Extra_Aux",
+ "Aux_V1",
+ "Aux_V2",
+ "Aux_V3",
+ "Aux_V4",
+ "Aux_V5",
+ "Aux_V6",
+ "Aux_V7",
+ "Aux_V8",
+ "Aux_V9",
+ "Aux_V10",
+ "Aux_V11",
+ "Aux_V12",
+ "Aux_V13",
+ "Aux_V14",
+ "Aux_V15",
];
// This get's picked up by dynamic_config.js and used as mode 0
@@ -142,4 +157,4 @@
// REMOVE THIS.
//document.writeln("");
-
\ No newline at end of file
+
diff --git a/web/hk/Aux_V1-off.png b/web/hk/Aux_V1-off.png
new file mode 120000
index 00000000..5f60636b
--- /dev/null
+++ b/web/hk/Aux_V1-off.png
@@ -0,0 +1 @@
+./switch-off.png
\ No newline at end of file
diff --git a/web/hk/Aux_V1-on.png b/web/hk/Aux_V1-on.png
new file mode 120000
index 00000000..6afbc0bf
--- /dev/null
+++ b/web/hk/Aux_V1-on.png
@@ -0,0 +1 @@
+./switch-on.png
\ No newline at end of file
diff --git a/web/hk/Aux_V10-off.png b/web/hk/Aux_V10-off.png
new file mode 120000
index 00000000..5f60636b
--- /dev/null
+++ b/web/hk/Aux_V10-off.png
@@ -0,0 +1 @@
+./switch-off.png
\ No newline at end of file
diff --git a/web/hk/Aux_V10-on.png b/web/hk/Aux_V10-on.png
new file mode 120000
index 00000000..6afbc0bf
--- /dev/null
+++ b/web/hk/Aux_V10-on.png
@@ -0,0 +1 @@
+./switch-on.png
\ No newline at end of file
diff --git a/web/hk/Aux_V11-off.png b/web/hk/Aux_V11-off.png
new file mode 120000
index 00000000..5f60636b
--- /dev/null
+++ b/web/hk/Aux_V11-off.png
@@ -0,0 +1 @@
+./switch-off.png
\ No newline at end of file
diff --git a/web/hk/Aux_V11-on.png b/web/hk/Aux_V11-on.png
new file mode 120000
index 00000000..6afbc0bf
--- /dev/null
+++ b/web/hk/Aux_V11-on.png
@@ -0,0 +1 @@
+./switch-on.png
\ No newline at end of file
diff --git a/web/hk/Aux_V12-off.png b/web/hk/Aux_V12-off.png
new file mode 120000
index 00000000..5f60636b
--- /dev/null
+++ b/web/hk/Aux_V12-off.png
@@ -0,0 +1 @@
+./switch-off.png
\ No newline at end of file
diff --git a/web/hk/Aux_V12-on.png b/web/hk/Aux_V12-on.png
new file mode 120000
index 00000000..6afbc0bf
--- /dev/null
+++ b/web/hk/Aux_V12-on.png
@@ -0,0 +1 @@
+./switch-on.png
\ No newline at end of file
diff --git a/web/hk/Aux_V13-off.png b/web/hk/Aux_V13-off.png
new file mode 120000
index 00000000..5f60636b
--- /dev/null
+++ b/web/hk/Aux_V13-off.png
@@ -0,0 +1 @@
+./switch-off.png
\ No newline at end of file
diff --git a/web/hk/Aux_V13-on.png b/web/hk/Aux_V13-on.png
new file mode 120000
index 00000000..6afbc0bf
--- /dev/null
+++ b/web/hk/Aux_V13-on.png
@@ -0,0 +1 @@
+./switch-on.png
\ No newline at end of file
diff --git a/web/hk/Aux_V14-off.png b/web/hk/Aux_V14-off.png
new file mode 120000
index 00000000..5f60636b
--- /dev/null
+++ b/web/hk/Aux_V14-off.png
@@ -0,0 +1 @@
+./switch-off.png
\ No newline at end of file
diff --git a/web/hk/Aux_V14-on.png b/web/hk/Aux_V14-on.png
new file mode 120000
index 00000000..6afbc0bf
--- /dev/null
+++ b/web/hk/Aux_V14-on.png
@@ -0,0 +1 @@
+./switch-on.png
\ No newline at end of file
diff --git a/web/hk/Aux_V15-off.png b/web/hk/Aux_V15-off.png
new file mode 120000
index 00000000..5f60636b
--- /dev/null
+++ b/web/hk/Aux_V15-off.png
@@ -0,0 +1 @@
+./switch-off.png
\ No newline at end of file
diff --git a/web/hk/Aux_V15-on.png b/web/hk/Aux_V15-on.png
new file mode 120000
index 00000000..6afbc0bf
--- /dev/null
+++ b/web/hk/Aux_V15-on.png
@@ -0,0 +1 @@
+./switch-on.png
\ No newline at end of file
diff --git a/web/hk/Aux_V2-off.png b/web/hk/Aux_V2-off.png
new file mode 120000
index 00000000..5f60636b
--- /dev/null
+++ b/web/hk/Aux_V2-off.png
@@ -0,0 +1 @@
+./switch-off.png
\ No newline at end of file
diff --git a/web/hk/Aux_V2-on.png b/web/hk/Aux_V2-on.png
new file mode 120000
index 00000000..6afbc0bf
--- /dev/null
+++ b/web/hk/Aux_V2-on.png
@@ -0,0 +1 @@
+./switch-on.png
\ No newline at end of file
diff --git a/web/hk/Aux_V3-off.png b/web/hk/Aux_V3-off.png
new file mode 120000
index 00000000..5f60636b
--- /dev/null
+++ b/web/hk/Aux_V3-off.png
@@ -0,0 +1 @@
+./switch-off.png
\ No newline at end of file
diff --git a/web/hk/Aux_V3-on.png b/web/hk/Aux_V3-on.png
new file mode 120000
index 00000000..6afbc0bf
--- /dev/null
+++ b/web/hk/Aux_V3-on.png
@@ -0,0 +1 @@
+./switch-on.png
\ No newline at end of file
diff --git a/web/hk/Aux_V4-off.png b/web/hk/Aux_V4-off.png
new file mode 120000
index 00000000..5f60636b
--- /dev/null
+++ b/web/hk/Aux_V4-off.png
@@ -0,0 +1 @@
+./switch-off.png
\ No newline at end of file
diff --git a/web/hk/Aux_V4-on.png b/web/hk/Aux_V4-on.png
new file mode 120000
index 00000000..6afbc0bf
--- /dev/null
+++ b/web/hk/Aux_V4-on.png
@@ -0,0 +1 @@
+./switch-on.png
\ No newline at end of file
diff --git a/web/hk/Aux_V5-off.png b/web/hk/Aux_V5-off.png
new file mode 120000
index 00000000..5f60636b
--- /dev/null
+++ b/web/hk/Aux_V5-off.png
@@ -0,0 +1 @@
+./switch-off.png
\ No newline at end of file
diff --git a/web/hk/Aux_V5-on.png b/web/hk/Aux_V5-on.png
new file mode 120000
index 00000000..6afbc0bf
--- /dev/null
+++ b/web/hk/Aux_V5-on.png
@@ -0,0 +1 @@
+./switch-on.png
\ No newline at end of file
diff --git a/web/hk/Aux_V6-off.png b/web/hk/Aux_V6-off.png
new file mode 120000
index 00000000..5f60636b
--- /dev/null
+++ b/web/hk/Aux_V6-off.png
@@ -0,0 +1 @@
+./switch-off.png
\ No newline at end of file
diff --git a/web/hk/Aux_V6-on.png b/web/hk/Aux_V6-on.png
new file mode 120000
index 00000000..6afbc0bf
--- /dev/null
+++ b/web/hk/Aux_V6-on.png
@@ -0,0 +1 @@
+./switch-on.png
\ No newline at end of file
diff --git a/web/hk/Aux_V7-off.png b/web/hk/Aux_V7-off.png
new file mode 120000
index 00000000..5f60636b
--- /dev/null
+++ b/web/hk/Aux_V7-off.png
@@ -0,0 +1 @@
+./switch-off.png
\ No newline at end of file
diff --git a/web/hk/Aux_V7-on.png b/web/hk/Aux_V7-on.png
new file mode 120000
index 00000000..6afbc0bf
--- /dev/null
+++ b/web/hk/Aux_V7-on.png
@@ -0,0 +1 @@
+./switch-on.png
\ No newline at end of file
diff --git a/web/hk/Aux_V8-off.png b/web/hk/Aux_V8-off.png
new file mode 120000
index 00000000..5f60636b
--- /dev/null
+++ b/web/hk/Aux_V8-off.png
@@ -0,0 +1 @@
+./switch-off.png
\ No newline at end of file
diff --git a/web/hk/Aux_V8-on.png b/web/hk/Aux_V8-on.png
new file mode 120000
index 00000000..6afbc0bf
--- /dev/null
+++ b/web/hk/Aux_V8-on.png
@@ -0,0 +1 @@
+./switch-on.png
\ No newline at end of file
diff --git a/web/hk/Aux_V9-off.png b/web/hk/Aux_V9-off.png
new file mode 120000
index 00000000..5f60636b
--- /dev/null
+++ b/web/hk/Aux_V9-off.png
@@ -0,0 +1 @@
+./switch-off.png
\ No newline at end of file
diff --git a/web/hk/Aux_V9-on.png b/web/hk/Aux_V9-on.png
new file mode 120000
index 00000000..6afbc0bf
--- /dev/null
+++ b/web/hk/Aux_V9-on.png
@@ -0,0 +1 @@
+./switch-on.png
\ No newline at end of file