Skip to content

Commit

Permalink
Merge pull request #39 from netmindz/aux
Browse files Browse the repository at this point in the history
Aux/Blower support
  • Loading branch information
netmindz authored Oct 21, 2023
2 parents 0b5894c + 459a488 commit 1bd461d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
10 changes: 8 additions & 2 deletions sensor/src/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
#define STATUS_WAITING_PANEL 4
16 changes: 16 additions & 0 deletions sensor/src/sensor.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit 1bd461d

Please sign in to comment.