diff --git a/sensor/src/constants.h b/sensor/src/constants.h index ddd8e60..5375ead 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 "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" @@ -26,8 +26,14 @@ #define PUMP2_STATE_HIGH 1 #endif +#ifdef AUX_DUAL_SPEED +#define AUX_STATE_HIGH 2 +#else +#define AUX_STATE_HIGH 1 +#endif + #define STATUS_BOOT 0 #define STATUS_WIFI 2 #define STATUS_OK 1 #define STATUS_WAITING_DATA 3 -#define STATUS_WAITING_PANEL 4 \ No newline at end of file +#define STATUS_WAITING_PANEL 4 diff --git a/sensor/src/sensor.ino b/sensor/src/sensor.ino index f90687b..caf9824 100644 --- a/sensor/src/sensor.ino +++ b/sensor/src/sensor.ino @@ -88,6 +88,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 @@ -112,6 +113,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); @@ -207,6 +209,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); } @@ -443,6 +449,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");