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 1 commit
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
8 changes: 7 additions & 1 deletion 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 "fb06666666660af5f4" // TODO: FIXME - Not actual value
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have a valid FB for this @tmjo ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I just checked. The FB - in my tub at least - is the same as for Pump2 (which I don't have, or which is my Aux). Since mine is not working (but I can toggle it on and off on the panel) I have obviously not paid enough attention to it.

Anyways, commands are same as we have for Pump2. What I discovered when testing it today is that the status for Aux is not the same as for Pump2. It is in fact in the character before:

fa143339304300006100000080020e0c66000000000039 --> Aux off
fa1433393043c0006100000480020e0d6600000000008e --> Aux on (notice c after our 43/degC)

I made a small hack and then the HA pump2 selector was working, but perhaps it is better to add a separate one.

As you see there is also a change in the unknown bytes going from 8002 to 48002. This was repeated a few times, but I don't know what it means. Perhaps it could be an indicator of what aux is actually running? Dunno.

#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 @@ -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
16 changes: 16 additions & 0 deletions sensor/src/sensor.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
Expand Down Expand Up @@ -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);
}

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