Skip to content

Commit a7fbef4

Browse files
committed
Clear Quota button
1 parent 6472368 commit a7fbef4

File tree

4 files changed

+20
-19
lines changed

4 files changed

+20
-19
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ This controller has a built-in webserver which allows you to configure the contr
117117
* **Total Commands**. Total number of writes made by this Arduino controller since the date and time recorded in **Stats since ...**.
118118
* **Daily Average**. Daily average EEPROM writes, should be bellow 19. Calculated from internal date of the heat pump, so if you change the date in heat pump settings, it is recommended to reset the Daikin EEPROM Writes counter.
119119
* **Yesterday**. Number of writes made yesterday, updated at midnight. Should not significantly exceed average writes per day.
120-
* **Today**. Number of writes made today / out of daily **EEPROM Write Quota**. If you reach the quota and you really need more, you can temporarily (!) increase it in the **P1P2 Settings**
120+
* **Today**. Number of writes made today / out of daily **EEPROM Write Quota**. If you reach the quota and you still need to send a P1/P2 write command, you can **Clear Quota**
121121

122122
**Write Command**. You can send a P1/P2 write command directly from web interface, for testing or reverse-engineering P1/P2 write commands. The format of the write command send via web interface is identical to the command sent via UDP:
123123
* **Packet Type**. The first byte is the packet type. Only supported packet types are listed in the drop-down menu.

arduino-altherma-controller/04-webserver.ino

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ enum action_type : byte {
1212
ACT_RESET_STATS, // Reset P1P2 Read Statistics
1313
ACT_CONNECT, // Connect Controller
1414
ACT_DISCONNECT, // Disconnect Controller
15+
ACT_CLEAR_QUOTA, // Clear Daikin EEPROM Writes Daily Quota
1516
ACT_WEB // Restart webserver
1617
};
1718
enum action_type action;
@@ -358,6 +359,9 @@ void processPost(EthernetClient &client) {
358359
case ACT_DISCONNECT:
359360
controllerAddr = DISCONNECTED;
360361
break;
362+
case ACT_CLEAR_QUOTA:
363+
data.eepromDaikin.today = 0;
364+
break;
361365
default:
362366
break;
363367
}

arduino-altherma-controller/05-pages.ino

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,8 @@ void jsonVal(ChunkedPrint &chunked, const byte JSONKEY) {
839839
chunked.print(data.eepromDaikin.today);
840840
chunked.print(F(" / "));
841841
chunked.print(data.config.writeQuota);
842-
chunked.print(F(" Today (total / quota)"));
842+
chunked.print(F(" Today (total / quota) "));
843+
tagButton(chunked, F("Clear Quota"), ACT_CLEAR_QUOTA, true);
843844
}
844845
break;
845846
case JSON_CONTROLLER:
@@ -861,34 +862,30 @@ void jsonVal(ChunkedPrint &chunked, const byte JSONKEY) {
861862
chunked.print(controllerAddr, HEX);
862863
chunked.print(F(") "));
863864
if (data.config.controllerMode == CONTROL_MANUAL) {
864-
tagButton(chunked, F("Disable write"), ACT_DISCONNECT, true);
865+
tagButton(chunked, F("Disable Write"), ACT_DISCONNECT, true);
865866
}
866867
} else {
867868
chunked.print(F("(read only) "));
868869
if (data.config.controllerMode == CONTROL_MANUAL) {
869870
if (controllerAddr == CONNECTING) {
870871
tagButton(chunked, F("Connecting"), ACT_CONNECT, false);
871872
} else {
872-
tagButton(chunked, F("Enable write"), ACT_CONNECT, availableSlot);
873+
tagButton(chunked, F("Enable Write"), ACT_CONNECT, availableSlot);
873874
}
874875
}
875876
}
876877
chunked.print(F("<br>"));
877-
for (byte j = 0; j < 2; j++) { // list "Other device" in loop 0 and "Add. device can be connected" in loop 1
878-
for (byte i = 0; i < 16; i++) {
879-
if ((FxRequests[i] == 0) // Skip address Fx if no 00Fx30 request was made (address Fx not supported by the pump)
880-
|| ((0xF0 | i) == controllerAddr) // Skip address Fx if this device uses address Fx
881-
|| (j == 0 && FxRequests[i] >= 0)
882-
|| (j == 1 && FxRequests[i] != F0THRESHOLD)) continue;
883-
if (FxRequests[i] < 0) {
884-
chunked.print(F("Another device is connected"));
885-
} else if (FxRequests[i] == F0THRESHOLD) {
886-
chunked.print(F("Additional device can be connected"));
887-
}
888-
chunked.print(F(" (address 0xF"));
889-
chunked.print(i, HEX);
890-
chunked.print(F(")<br>"));
878+
for (byte i = 0; i < 16; i++) {
879+
if ((FxRequests[i] == 0) // Skip address Fx if no 00Fx30 request was made (address Fx not supported by the pump)
880+
|| ((0xF0 | i) == controllerAddr)) continue; // Skip address Fx if this device uses address Fx
881+
if (FxRequests[i] < 0) {
882+
chunked.print(F("Another device is connected"));
883+
} else if (FxRequests[i] == F0THRESHOLD) {
884+
chunked.print(F("Additional device can be connected"));
891885
}
886+
chunked.print(F(" (address 0xF"));
887+
chunked.print(i, HEX);
888+
chunked.print(F(")<br>"));
892889
}
893890
if (!availableSlot) {
894891
chunked.print(F("Additional device not supported by the pump"));

arduino-altherma-controller/arduino-altherma-controller.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
v1.0 2023-04-18 Major upgrade: web interface, store settings in EEPROM, P1P2 error counters
99
v2.0 2023-08-25 Manual MAC, Daikin EEPROM write daily quota, Simplify Arduino EEPROM read / write, Tools page
1010
v2.1 2023-09-17 Improve advanced settings, disable DHCP renewal fallback
11-
v3.0 2023-XX-XX Function comments. Remove "Disabled" Controller mode (only Manual; Auto),
11+
v3.0 2024-XX-XX Function comments. Remove "Disabled" Controller mode (only Manual; Auto),
1212
improved automatic connection to the P1P2 bus, connect to any peripheral address
1313
between 0xF0 to 0xFF (depends on Altherma model), show other controllers and available addresses.
1414
*/

0 commit comments

Comments
 (0)