Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work in progress - Aux/Blower support #39

Merged
merged 3 commits into from
Oct 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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