2.3.9 development

pull/360/head^2
sfeakes 2024-09-06 18:32:20 -05:00
parent bdbe315c10
commit eee110b043
49 changed files with 377 additions and 82 deletions

View File

@ -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
<!--
NEED TO FIX FOR THIS RELEASE.
* Pump by name and not ID. clean up code
* look at using 0x00 for no exit on serial errors / startup
* DONE look at virtual button support
* vbuton will need the PDA on iAQT protocol working.
* change dimmer to % from steps. (will make HASIO & Homekit easier)
* show Colorlight name in UI
* add config for homekit_f (panel in F homekin in C), F to F or C to C is fine.
* deprecate extended_device_id_programming
* show error is vbutton and no extended_device_id
# Updates in 2.3.9
-->
# 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
* <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
@ -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
<!--
NEED TO FIX FOR THIS RELEASE.
* Pump by name and not ID.
* look at using 0x00 for no exit on serial errors / startup
* Add 0x?? filter for debug_serial from aqmanager
<done> * MQTT ID is now using a lot longer name due to arm64/armhf
<done> * Ignore SWG 0 messages can now be removed since VSP is fixed.
<done> * Increase packet length due to below (also the print message)
Warning: RS Serial: Serial packet too large\
Warning: RS Serial: Read Jandy packet BAD PACKET To 0x33 of type Unknown '0x72' | HEX: 0x10|0x02|0x33|0x72|0x20|0x01|0x02|0x03|0x04|0x05|0x06|0x07|0x08|0x09|0x0a|0x0b|0x0c|0x0d|0x0e|0x0f|0x10|0x11|0x12|0x13|0x14|0x15|0x16|0x17|0x18|0x19|0x1.........\
-->
* 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.

BIN
release/aqualinkd-amd64 Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -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 <Label you want to see>
# button_??_label=Filter Pump <Label you want to see>
# button_??_dzidx=37 <Domoticz IDX>
# button_??_pumpID=0x60 <RS485 ID of VSP>
# button_??_pumpIndex=1 <Pump index Jandy panel is configured to use>
# button_??_pumpType=Pentair VF <Pump Type, one of the folowing :- JANDY ePUMP, Pentair VF, Pentair VS>
# button_??_pumpName=My Pump <Panel Rev Y supports renaming VSP, use the name here>
# button_??_lightMode=4 <Color light mode>
#
# 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

View File

@ -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

BIN
release/serial_logger-amd64 Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -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
#endif

View File

@ -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)

View File

@ -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_
#endif // AQ_SERIAL_H_

View File

@ -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;

View File

@ -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()
{

View File

@ -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;
}

View File

@ -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/<pause>device1/device2/device3/status/home/<repeat>
----------
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;
}

View File

@ -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;
}
}

View File

@ -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)"

View File

@ -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("<script type='text/javascript' src='extra/extra.js'></script>");

1
web/hk/Aux_V1-off.png Symbolic link
View File

@ -0,0 +1 @@
./switch-off.png

1
web/hk/Aux_V1-on.png Symbolic link
View File

@ -0,0 +1 @@
./switch-on.png

1
web/hk/Aux_V10-off.png Symbolic link
View File

@ -0,0 +1 @@
./switch-off.png

1
web/hk/Aux_V10-on.png Symbolic link
View File

@ -0,0 +1 @@
./switch-on.png

1
web/hk/Aux_V11-off.png Symbolic link
View File

@ -0,0 +1 @@
./switch-off.png

1
web/hk/Aux_V11-on.png Symbolic link
View File

@ -0,0 +1 @@
./switch-on.png

1
web/hk/Aux_V12-off.png Symbolic link
View File

@ -0,0 +1 @@
./switch-off.png

1
web/hk/Aux_V12-on.png Symbolic link
View File

@ -0,0 +1 @@
./switch-on.png

1
web/hk/Aux_V13-off.png Symbolic link
View File

@ -0,0 +1 @@
./switch-off.png

1
web/hk/Aux_V13-on.png Symbolic link
View File

@ -0,0 +1 @@
./switch-on.png

1
web/hk/Aux_V14-off.png Symbolic link
View File

@ -0,0 +1 @@
./switch-off.png

1
web/hk/Aux_V14-on.png Symbolic link
View File

@ -0,0 +1 @@
./switch-on.png

1
web/hk/Aux_V15-off.png Symbolic link
View File

@ -0,0 +1 @@
./switch-off.png

1
web/hk/Aux_V15-on.png Symbolic link
View File

@ -0,0 +1 @@
./switch-on.png

1
web/hk/Aux_V2-off.png Symbolic link
View File

@ -0,0 +1 @@
./switch-off.png

1
web/hk/Aux_V2-on.png Symbolic link
View File

@ -0,0 +1 @@
./switch-on.png

1
web/hk/Aux_V3-off.png Symbolic link
View File

@ -0,0 +1 @@
./switch-off.png

1
web/hk/Aux_V3-on.png Symbolic link
View File

@ -0,0 +1 @@
./switch-on.png

1
web/hk/Aux_V4-off.png Symbolic link
View File

@ -0,0 +1 @@
./switch-off.png

1
web/hk/Aux_V4-on.png Symbolic link
View File

@ -0,0 +1 @@
./switch-on.png

1
web/hk/Aux_V5-off.png Symbolic link
View File

@ -0,0 +1 @@
./switch-off.png

1
web/hk/Aux_V5-on.png Symbolic link
View File

@ -0,0 +1 @@
./switch-on.png

1
web/hk/Aux_V6-off.png Symbolic link
View File

@ -0,0 +1 @@
./switch-off.png

1
web/hk/Aux_V6-on.png Symbolic link
View File

@ -0,0 +1 @@
./switch-on.png

1
web/hk/Aux_V7-off.png Symbolic link
View File

@ -0,0 +1 @@
./switch-off.png

1
web/hk/Aux_V7-on.png Symbolic link
View File

@ -0,0 +1 @@
./switch-on.png

1
web/hk/Aux_V8-off.png Symbolic link
View File

@ -0,0 +1 @@
./switch-off.png

1
web/hk/Aux_V8-on.png Symbolic link
View File

@ -0,0 +1 @@
./switch-on.png

1
web/hk/Aux_V9-off.png Symbolic link
View File

@ -0,0 +1 @@
./switch-off.png

1
web/hk/Aux_V9-on.png Symbolic link
View File

@ -0,0 +1 @@
./switch-on.png