From 67a24e11e6fe16f433a987666e2cc619c3373a83 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Tue, 18 Jul 2023 15:38:00 +0100 Subject: [PATCH 1/2] Start adding code for AUX/Blower option --- sensor/src/constants.h | 8 +++++++- sensor/src/sensor.ino | 16 ++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/sensor/src/constants.h b/sensor/src/constants.h index 9ea0834..1484171 100644 --- a/sensor/src/constants.h +++ b/sensor/src/constants.h @@ -3,7 +3,7 @@ //#define COMMAND_TOGGLE "fb066666666609f6c2" #define COMMAND_TIME "fb0664d4060003fc76" #define COMMAND_CHANGE_MODE "fb0603450e0004fb3c" -// #define COMMAND_BLOWER "fb06666666660af5f4" +#define COMMAND_AUX "fb06666666660af5f4" // TODO: FIXME - Not actual value #define COMMAND_JET1 "fb060343060006f9a2" // TODO: fix me - swapped to tmjo's panel as mine was one char short in my notes #define COMMAND_JET2 "fb060343060007f8b0" // TODO: fix me - swapped to tmjo's panel as mine was one char short in my notes #define COMMAND_EMPTY "fb0603450e0000ff74" @@ -25,3 +25,9 @@ #else #define PUMP2_STATE_HIGH 1 #endif + +#ifdef AUX_DUAL_SPEED +#define AUX_STATE_HIGH 2 +#else +#define AUX_STATE_HIGH 1 +#endif diff --git a/sensor/src/sensor.ino b/sensor/src/sensor.ino index 3ab6977..472eadc 100644 --- a/sensor/src/sensor.ino +++ b/sensor/src/sensor.ino @@ -73,6 +73,7 @@ SoftwareSerial tub; // Uncomment if you have dual-speed pump // #define PUMP1_DUAL_SPEED // #define PUMP2_DUAL_SPEED +// #define AUX_DUAL_SPEED // ************************************************************************************************ // End of config @@ -97,6 +98,7 @@ HASelect tubMode("mode"); HASensorNumber uptime("uptime"); HASelect pump1("pump1"); HASelect pump2("pump2"); +HASelect aux("aux"); HABinarySensor heater("heater"); HASwitch light("light"); HASensorNumber tubpower("tubpower", HANumber::PrecisionP1); @@ -166,6 +168,10 @@ void onPumpSwitchStateChanged(int8_t index, HASelect* sender) { command = COMMAND_JET2; options = PUMP2_STATE_HIGH + 1; } + else if (sender->getName() == "Aux") { + command = COMMAND_AUX; + options = AUX_STATE_HIGH + 1; + } setOption(currentIndex, index, options, command); } @@ -349,6 +355,16 @@ void setup() { pump2.setIcon("mdi:chart-bubble"); pump2.onCommand(onPumpSwitchStateChanged); + aux.setName("Aux"); +#ifdef AUX_DUAL_SPEED + aux.setOptions("Off;Medium;High"); +#else + aux.setOptions("Off;High"); +#endif + aux.setIcon("mdi:chart-bubble"); + aux.onCommand(onPumpSwitchStateChanged); + + heater.setName("Heater"); heater.setIcon("mdi:radiator"); light.setName("Light"); From c8ffd8c150d8a647260e109b6e24fb10817b16ea Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Sat, 21 Oct 2023 18:45:41 +0100 Subject: [PATCH 2/2] Correct command for AUX --- sensor/src/constants.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sensor/src/constants.h b/sensor/src/constants.h index 1484171..30a8138 100644 --- a/sensor/src/constants.h +++ b/sensor/src/constants.h @@ -3,7 +3,7 @@ //#define COMMAND_TOGGLE "fb066666666609f6c2" #define COMMAND_TIME "fb0664d4060003fc76" #define COMMAND_CHANGE_MODE "fb0603450e0004fb3c" -#define COMMAND_AUX "fb06666666660af5f4" // TODO: FIXME - Not actual value +#define COMMAND_AUX "fb0603450e000af5c0" #define COMMAND_JET1 "fb060343060006f9a2" // TODO: fix me - swapped to tmjo's panel as mine was one char short in my notes #define COMMAND_JET2 "fb060343060007f8b0" // TODO: fix me - swapped to tmjo's panel as mine was one char short in my notes #define COMMAND_EMPTY "fb0603450e0000ff74"