From bff5ef7ee77cbe4aa879927f5a6827728395a14c Mon Sep 17 00:00:00 2001 From: Gosun <28876168+frankol@users.noreply.github.com> Date: Mon, 23 Sep 2024 10:30:37 +0200 Subject: [PATCH 1/6] add bivalent heating --- HeishaMon/commands.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/HeishaMon/commands.h b/HeishaMon/commands.h index 6ed49d8d..eea0db73 100644 --- a/HeishaMon/commands.h +++ b/HeishaMon/commands.h @@ -60,7 +60,9 @@ unsigned int set_buffer_delta(char *msg, unsigned char *cmd, char *log_msg); unsigned int set_buffer(char *msg, unsigned char *cmd, char *log_msg); unsigned int set_heatingoffoutdoortemp(char *msg, unsigned char *cmd, char *log_msg); unsigned int set_gpio16state(char *msg, unsigned char *cmd, char *log_msg); - +unsigned int set_bivalent_mode(char *msg, unsigned char *cmd, char *log_msg); +unsigned int set_bivalent_start_temperature(char *msg, unsigned char *cmd, char *log_msg); +unsigned int set_bivalent_stop_temperature(char *msg, unsigned char *cmd, char *log_msg); //optional pcb commands unsigned int set_heat_cool_mode(char *msg, char *log_msg); @@ -112,6 +114,12 @@ const cmdStruct commands[] PROGMEM = { { "SetPowerfulMode", set_powerful_mode }, // set Heat pump operation mode 3 = DHW only, 0 = heat only, 1 = cool only, 2 = Auto, 4 = Heat+DHW, 5 = Cool+DHW, 6 = Auto + DHW { "SetOperationMode", set_operation_mode }, + // set Bivalent operation mode 0 = Off, 1 = Alternativ, 2 = A-Off, 3 = Parallel, 4 = P-Off, 5 = Parallel Advanced + { "SetBivalentMode", set_bivalent_mode }, + // bivalent start temp - set from -15C to 35C + { "SetBivalentStartTemperature", set_bivalent_start_temperature }, + // bivalent stop temp - set from -15C to 35C + { "SetBivalentStopTemperature", set_bivalent_stop_temperature }, // set DHW temperature by sending desired temperature between 40C-75C { "SetDHWTemp", set_DHW_temp }, // set heat/cool curves on z1 and z2 using a json input From b628cef5c3d15d8b9064468d4d5d91c3b0a4dc33 Mon Sep 17 00:00:00 2001 From: Gosun <28876168+frankol@users.noreply.github.com> Date: Mon, 23 Sep 2024 10:33:46 +0200 Subject: [PATCH 2/6] add bivalent heating --- HeishaMon/commands.cpp | 68 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/HeishaMon/commands.cpp b/HeishaMon/commands.cpp index d1f58462..e6efa536 100644 --- a/HeishaMon/commands.cpp +++ b/HeishaMon/commands.cpp @@ -205,6 +205,45 @@ unsigned int set_z2_cool_request_temperature(char *msg, unsigned char *cmd, char return sizeof(panasonicSendQuery); } +unsigned int set_bivalent_start_temperature(char *msg, unsigned char *cmd, char *log_msg) { + + String set_temperature_string(msg); + + byte request_temp = set_temperature_string.toInt() + 128; + + { + char tmp[256] = { 0 }; + snprintf_P(tmp, 255, PSTR("set bivalent start temperature to %d"), request_temp - 128 ); + memcpy(log_msg, tmp, sizeof(tmp)); + } + + { + memcpy_P(cmd, panasonicSendQuery, sizeof(panasonicSendQuery)); + cmd[66] = request_temp; + } + + return sizeof(panasonicSendQuery); +} +unsigned int set_bivalent_stop_temperature(char *msg, unsigned char *cmd, char *log_msg) { + + String set_temperature_string(msg); + + byte request_temp = set_temperature_string.toInt() + 128; + + { + char tmp[256] = { 0 }; + snprintf_P(tmp, 255, PSTR("set bivalent stop temperature to %d"), request_temp - 128 ); + memcpy(log_msg, tmp, sizeof(tmp)); + } + + { + memcpy_P(cmd, panasonicSendQuery, sizeof(panasonicSendQuery)); + cmd[68] = request_temp; + } + + return sizeof(panasonicSendQuery); +} + unsigned int set_force_DHW(char *msg, unsigned char *cmd, char *log_msg) { String set_force_DHW_string(msg); @@ -367,6 +406,35 @@ unsigned int set_operation_mode(char *msg, unsigned char *cmd, char *log_msg) { return sizeof(panasonicSendQuery); } +unsigned int set_bivalent_mode(char *msg, unsigned char *cmd, char *log_msg) { + + String set_bmode_string(msg); + + byte set_bmode; + switch (set_bmode_string.toInt()) { + case 0: set_bmode = 100; break; + case 1: set_bmode = 101; break; + case 2: set_bmode = 104; break; + case 3: set_bmode = 105; break; + case 4: set_bmode = 108; break; + case 5: set_bmode = 109; break; + default: set_bmode = 100; break; + } + + { + char tmp[256] = { 0 }; + snprintf_P(tmp, 255, PSTR("set bivalent mode to %d"), set_bmode); + memcpy(log_msg, tmp, sizeof(tmp)); + } + + { + memcpy_P(cmd, panasonicSendQuery, sizeof(panasonicSendQuery)); + cmd[26] = set_bmode + 1; + } + + return sizeof(panasonicSendQuery); +} + unsigned int set_curves(char *msg, unsigned char *cmd, char *log_msg) { memcpy_P(cmd, panasonicSendQuery, sizeof(panasonicSendQuery)); From caed5d34a285a74245a6eb3b152106816f3bbbaa Mon Sep 17 00:00:00 2001 From: Gosun <28876168+frankol@users.noreply.github.com> Date: Mon, 23 Sep 2024 10:38:47 +0200 Subject: [PATCH 3/6] add bivalent heating edit heat pump to match my id, add mixing valve opening --- HeishaMon/decode.h | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/HeishaMon/decode.h b/HeishaMon/decode.h index ec290e8e..d23cb044 100644 --- a/HeishaMon/decode.h +++ b/HeishaMon/decode.h @@ -97,7 +97,7 @@ static const byte knownModels[sizeof(Model) / sizeof(Model[0])][10] PROGMEM = { 0xE2, 0xCF, 0x0D, 0x77, 0x09, 0x12, 0xD0, 0x0B, 0x05, 0x11, //2 0xE2, 0xCF, 0x0C, 0x88, 0x05, 0x12, 0xD0, 0x0B, 0x97, 0x05, //3 0xE2, 0xCF, 0x0D, 0x85, 0x05, 0x12, 0xD0, 0x0C, 0x94, 0x05, //4 - 0xE2, 0xCF, 0x0D, 0x86, 0x05, 0x12, 0xD0, 0x0C, 0x95, 0x05, //5 + 0xE2, 0xCF, 0x0D, 0x86, 0x05, 0x12, 0xD0, 0x0E, 0x95, 0x05, //5 0xE2, 0xCF, 0x0D, 0x87, 0x05, 0x12, 0xD0, 0x0C, 0x96, 0x05, //6 0xE2, 0xCE, 0x0D, 0x71, 0x81, 0x72, 0xCE, 0x0C, 0x92, 0x81, //7 0x62, 0xD2, 0x0B, 0x43, 0x54, 0x42, 0xD2, 0x0B, 0x72, 0x66, //8 @@ -144,10 +144,10 @@ static const byte knownModels[sizeof(Model) / sizeof(Model[0])][10] PROGMEM = { 0xE2, 0xCF, 0x0D, 0x77, 0x09, 0x12, 0xD0, 0x0C, 0x05, 0x11, //49 }; -#define NUMBER_OF_TOPICS 119 //last topic number + 1 +#define NUMBER_OF_TOPICS 127 //last topic number + 1 #define NUMBER_OF_TOPICS_EXTRA 6 //last topic number + 1 #define NUMBER_OF_OPT_TOPICS 7 //last topic number + 1 -#define MAX_TOPIC_LEN 41 // max length + 1 +#define MAX_TOPIC_LEN 42 // max length + 1 static const char optTopics[][20] PROGMEM = { "Z1_Water_Pump", // OPT0 @@ -297,6 +297,14 @@ static const char topics[][MAX_TOPIC_LEN] PROGMEM = { "Second_Inlet_Temp", //TOP116 "Economizer_Outlet_Temp", //TOP117 "Second_Room_Thermostat_Temp",//TOP118 + "Bivalent_Heating_Start_Temperature",//TOP119 + "Bivalent_Heating_Parallel_Adv_Starttemp",//TOP120 + "Bivalent_Heating_Parallel_Adv_Stoptemp",//TOP121 + "Bivalent_Heating_Parallel_Adv_Start_Delay",//TOP122 + "Bivalent_Heating_Parallel_Adv_Stop_Delay",//TOP123 + "Bivalent_Heating_Setting",//TOP124 + "2_Zone_mixing_valve_1_opening",//TOP125 + "2_Zone_mixing_valve_2_opening",//TOP126 }; static const byte topicBytes[] PROGMEM = { //can store the index as byte (8-bit unsigned humber) as there aren't more then 255 bytes (actually only 203 bytes) to decode @@ -419,6 +427,14 @@ static const byte topicBytes[] PROGMEM = { //can store the index as byte (8-bit 126, //TOP116 127, //TOP117 128, //TOP118 + 65, //TOP119 + 66, //TOP120 + 68, //TOP121 + 67, //TOP122 + 69, //TOP123 + 26, //TOP124 + 177, //TOP125 + 178, //TOP126 }; @@ -553,6 +569,14 @@ static const topicFP topicFunctions[] PROGMEM = { getIntMinus128, //TOP116 getIntMinus128, //TOP117 getIntMinus128, //TOP118 + getIntMinus128, //TOP119 + getIntMinus128, //TOP120 + getIntMinus128, //TOP121 + getIntMinus1, //TOP122 + getIntMinus1, //TOP123 + getIntMinus1, //TOP124 + getIntMinus1, //TOP125 + getIntMinus1, //TOP126 }; static const char *DisabledEnabled[] PROGMEM = {"2", "Disabled", "Enabled"}; @@ -586,6 +610,7 @@ static const char *SolarModeDesc[] PROGMEM = {"3", "Disabled", "Buffer", "DHW"}; static const char *ZonesSensorType[] PROGMEM = {"4", "Water Temperature", "External Thermostat", "Internal Thermostat", "Thermistor"}; static const char *LiquidType[] PROGMEM = {"2", "Water", "Glycol"}; static const char *ExtPadHeaterType[] PROGMEM = {"3", "Disabled", "Type-A","Type-B"}; +static const char *Bivalent[] PROGMEM = {"6", "Off", "Alternativ", "A-Off", "Parallel", "P-Off", "Parallel Advanced"}; static const char **opttopicDescription[] PROGMEM = { @@ -727,4 +752,12 @@ static const char **topicDescription[] PROGMEM = { Celsius, //TOP116 Celsius, //TOP117 Celsius, //TOP118 + Celsius, //TOP119 + Celsius, //TOP120 + Celsius, //TOP121 + Minutes, //TOP122 + Minutes, //TOP123 + Bivalent, //TOP124 + Counter, //TOP125 + Counter, //TOP126 }; From 6cfcb6b95b5550aafa5967ed926d62d679d3ccfb Mon Sep 17 00:00:00 2001 From: Gosun <28876168+frankol@users.noreply.github.com> Date: Mon, 23 Sep 2024 10:45:36 +0200 Subject: [PATCH 4/6] Update decode.h --- HeishaMon/decode.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/HeishaMon/decode.h b/HeishaMon/decode.h index d23cb044..f367b2bf 100644 --- a/HeishaMon/decode.h +++ b/HeishaMon/decode.h @@ -89,6 +89,7 @@ static const char *Model[] PROGMEM = { "IDU:WH-ADC0916H9E8, ODU:WH-UX12HE8", //47 "IDU:WH-SDC0509L3E5 ODU:WH-WDG07LE5", //48 "IDU:WH-SXC09H3E5, ODU:WH-UX09HE5", //49 + "IDU:WH-SXC12H9E8, ODU:WH-UX12HE8", //50 }; static const byte knownModels[sizeof(Model) / sizeof(Model[0])][10] PROGMEM = { //stores the bytes #129 to #138 of known models in the same order as the const above @@ -97,7 +98,7 @@ static const byte knownModels[sizeof(Model) / sizeof(Model[0])][10] PROGMEM = { 0xE2, 0xCF, 0x0D, 0x77, 0x09, 0x12, 0xD0, 0x0B, 0x05, 0x11, //2 0xE2, 0xCF, 0x0C, 0x88, 0x05, 0x12, 0xD0, 0x0B, 0x97, 0x05, //3 0xE2, 0xCF, 0x0D, 0x85, 0x05, 0x12, 0xD0, 0x0C, 0x94, 0x05, //4 - 0xE2, 0xCF, 0x0D, 0x86, 0x05, 0x12, 0xD0, 0x0E, 0x95, 0x05, //5 + 0xE2, 0xCF, 0x0D, 0x86, 0x05, 0x12, 0xD0, 0x0C, 0x95, 0x05, //5 0xE2, 0xCF, 0x0D, 0x87, 0x05, 0x12, 0xD0, 0x0C, 0x96, 0x05, //6 0xE2, 0xCE, 0x0D, 0x71, 0x81, 0x72, 0xCE, 0x0C, 0x92, 0x81, //7 0x62, 0xD2, 0x0B, 0x43, 0x54, 0x42, 0xD2, 0x0B, 0x72, 0x66, //8 @@ -142,6 +143,7 @@ static const byte knownModels[sizeof(Model) / sizeof(Model[0])][10] PROGMEM = { 0xE2, 0xCF, 0x0C, 0x74, 0x09, 0x12, 0xD0, 0x0C, 0x95, 0x05, //47 0xE2, 0xD5, 0x0B, 0x34, 0x99, 0x83, 0x92, 0x0C, 0x28, 0x98, //48 0xE2, 0xCF, 0x0D, 0x77, 0x09, 0x12, 0xD0, 0x0C, 0x05, 0x11, //49 + 0xE2, 0xCF, 0x0D, 0x86, 0x05, 0x12, 0xD0, 0x0E, 0x95, 0x05, //50 }; #define NUMBER_OF_TOPICS 127 //last topic number + 1 From 58c597e36b06e3ee9ce4eef3e6661990c49667c9 Mon Sep 17 00:00:00 2001 From: Gosun <28876168+frankol@users.noreply.github.com> Date: Tue, 24 Sep 2024 09:14:58 +0200 Subject: [PATCH 5/6] fix model count --- HeishaMon/decode.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HeishaMon/decode.h b/HeishaMon/decode.h index f367b2bf..5eadfc90 100644 --- a/HeishaMon/decode.h +++ b/HeishaMon/decode.h @@ -38,7 +38,7 @@ String getUintt16(char * data, byte input); static const char _unknown[] PROGMEM = "unknown"; static const char *Model[] PROGMEM = { - "47", //string representation of number of known models (last model number + 1) + "51", //string representation of number of known models (last model number + 1) "WH-MDC05H3E5", //0 "WH-MDC07H3E5", //1 "IDU:WH-SXC09H3E5, ODU:WH-UX09HE5", //2 From fa54a2ea889e4282a0a4a13dea001cd6dc8db0d0 Mon Sep 17 00:00:00 2001 From: Gosun <28876168+frankol@users.noreply.github.com> Date: Wed, 25 Sep 2024 16:21:06 +0200 Subject: [PATCH 6/6] added more switch options to bivalent settings because of homeassistant-aquara plugin --- HeishaMon/commands.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/HeishaMon/commands.cpp b/HeishaMon/commands.cpp index e6efa536..0c1b7733 100644 --- a/HeishaMon/commands.cpp +++ b/HeishaMon/commands.cpp @@ -418,6 +418,12 @@ unsigned int set_bivalent_mode(char *msg, unsigned char *cmd, char *log_msg) { case 3: set_bmode = 105; break; case 4: set_bmode = 108; break; case 5: set_bmode = 109; break; + case 100: set_bmode = 100; break; + case 101: set_bmode = 101; break; + case 104: set_bmode = 104; break; + case 105: set_bmode = 105; break; + case 108: set_bmode = 108; break; + case 109: set_bmode = 109; break; default: set_bmode = 100; break; }