Skip to content

Commit

Permalink
2.3.9 development
Browse files Browse the repository at this point in the history
  • Loading branch information
sfeakes committed Sep 6, 2024
1 parent bdbe315 commit eee110b
Show file tree
Hide file tree
Showing 49 changed files with 377 additions and 82 deletions.
37 changes: 25 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down
Binary file added 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.
16 changes: 15 additions & 1 deletion release/aqualinkd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
14 changes: 14 additions & 0 deletions release/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file added 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.
111 changes: 86 additions & 25 deletions source/aq_panel.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,55 +48,71 @@ 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;

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;
}
Expand Down Expand Up @@ -164,7 +180,6 @@ setPanel("RS-8 Combo");
}
*/


char _panelString[60];
void setPanelString()
{
Expand Down Expand Up @@ -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) {

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1349,4 +1410,4 @@ void initButtons_OLD_RS16(struct aqualinkdata *aqdata)

}

#endif
#endif
25 changes: 15 additions & 10 deletions source/aq_panel.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion source/aq_serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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_
5 changes: 4 additions & 1 deletion source/aqualink.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions source/aqualinkd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
Loading

0 comments on commit eee110b

Please sign in to comment.