Skip to content

Commit b975d8a

Browse files
authored
Merge pull request #847 from hubertciebiada/feature/dhw-sensor-selection
Add DHW sensor selection read topic and SET command
2 parents 8a812e7 + 2dde998 commit b975d8a

5 files changed

Lines changed: 34 additions & 2 deletions

File tree

HeishaMon/commands.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -966,6 +966,29 @@ unsigned int set_pump_flowrate_mode(char *msg, unsigned char *cmd, char *log_msg
966966
return sizeof(panasonicSendQuery);
967967
}
968968

969+
unsigned int set_dhw_sensor_selection(char *msg, unsigned char *cmd, char *log_msg) {
970+
971+
const byte address = 11;
972+
byte value = 0b01;
973+
974+
if ( String(msg).toInt() == 1 ) {
975+
value = 0b10;
976+
}
977+
978+
{
979+
char tmp[256] = { 0 };
980+
snprintf_P(tmp, 255, PSTR("set dhw sensor selection %d"), value - 1);
981+
memcpy(log_msg, tmp, sizeof(tmp));
982+
}
983+
984+
{
985+
memcpy_P(cmd, panasonicSendQuery, sizeof(panasonicSendQuery));
986+
cmd[address] = value;
987+
}
988+
989+
return sizeof(panasonicSendQuery);
990+
}
991+
969992
unsigned int set_external_compressor_control(char *msg, unsigned char *cmd, char *log_msg){
970993
const byte off_state=64;
971994
const byte address=23;

HeishaMon/commands.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ unsigned int set_heatingcontrol(char *msg, unsigned char *cmd, char *log_msg);
7070
unsigned int set_smart_dhw(char *msg, unsigned char *cmd, char *log_msg);
7171
unsigned int set_quiet_mode_priority(char *msg, unsigned char *cmd, char *log_msg);
7272
unsigned int set_pump_flowrate_mode(char *msg, unsigned char *cmd, char *log_msg);
73+
unsigned int set_dhw_sensor_selection(char *msg, unsigned char *cmd, char *log_msg);
7374

7475

7576
//optional pcb commands
@@ -162,6 +163,7 @@ const cmdStruct commands[] PROGMEM = {
162163
{ "SetSmartDHW", set_smart_dhw },
163164
{ "SetQuietModePriority", set_quiet_mode_priority },
164165
{ "SetPumpFlowrateMode", set_pump_flowrate_mode },
166+
{ "SetDHWSensorSelection", set_dhw_sensor_selection },
165167
};
166168

167169
struct optCmdStruct{

HeishaMon/decode.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ static const char _unknown[] PROGMEM = "unknown";
4242

4343

4444

45-
#define NUMBER_OF_TOPICS 143 //last topic number + 1
45+
#define NUMBER_OF_TOPICS 144 //last topic number + 1
4646
#define NUMBER_OF_TOPICS_EXTRA 6 //last topic number + 1
4747
#define NUMBER_OF_OPT_TOPICS 7 //last topic number + 1
4848
#define MAX_TOPIC_LEN 42 // max length + 1
@@ -219,6 +219,7 @@ static const char topics[][MAX_TOPIC_LEN] PROGMEM = {
219219
"Smart_DHW", //TOP140
220220
"Quiet_Mode_Priority", //TOP141
221221
"Expansion_Valve", //TOP142
222+
"DHW_Sensor_Selection", //TOP143
222223
};
223224

224225
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
@@ -365,6 +366,7 @@ static const byte topicBytes[] PROGMEM = { //can store the index as byte (8-bit
365366
24, //TOP140
366367
11, //TOP141
367368
175, //TOP142
369+
11, //TOP143
368370
};
369371

370372

@@ -523,6 +525,7 @@ static const topicFP topicFunctions[] PROGMEM = {
523525
getBit1and2, //TOP140
524526
getBit3and4, //TOP141
525527
getIntMinus1, //TOP142
528+
getBit7and8, //TOP143
526529
};
527530

528531
static const char *DisabledEnabled[] PROGMEM = {"2", "Disabled", "Enabled"};
@@ -563,6 +566,7 @@ static const char *Model[] PROGMEM = {"0", "Model"};
563566
static const char *HeatingControl[] PROGMEM = {"2", "Comfort", "Efficiency"};
564567
static const char *SmartDHW[] PROGMEM = {"2", "Variable", "Standard"};
565568
static const char *QuietModePriority[] PROGMEM = {"2", "Sound", "Capacity"};
569+
static const char *DHWSensorType[] PROGMEM = {"2", "Top", "Center"};
566570
static const char *Steps[] PROGMEM = {"0", "Steps"};
567571

568572
static const char **opttopicDescription[] PROGMEM = {
@@ -728,4 +732,5 @@ static const char **topicDescription[] PROGMEM = {
728732
SmartDHW, //TOP140
729733
QuietModePriority, //TOP141
730734
Steps, //TOP142
735+
DHWSensorType, //TOP143
731736
};

MQTT-Topics.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ TOP139 | main/Heating_Control | Heating Control
159159
TOP140 | main/Smart_DHW | Smart DHW
160160
TOP141 | main/Quiet_Mode_Priority | Quiet Mode Priority (0=sound, 1=capacity)
161161
TOP142 | main/Expansion_Valve | Expansion Valve (Steps)
162+
TOP143 | main/DHW_Sensor_Selection | DHW tank sensor selection (0=Top, 1=Center) (K/L series All-In-One only)
162163

163164

164165

@@ -230,6 +231,7 @@ SET39 | SetHeatingControl | Set heating control | 0=comfort, 1=efficiency
230231
SET40 | SetSmartDHW | Set SmartDHW | 0=variable, 1=standard
231232
SET41 | SetQuietModePriority | Set Quiet Mode Priority | 0=sound, 1=capacity
232233
SET42 | SetPumpFlowrateMode | Set Pump Flowrate Mode | 0=deltaT, 1=max. duty
234+
SET43 | SetDHWSensorSelection | Set DHW tank sensor selection (K/L series All-In-One only) | 0=Top, 1=Center
233235

234236
*If you operate your heatpump in water mode with direct temperature setup: topics ending xxxRequestTemperature will set the absolute target temperature.*
235237

ProtocolByteDecrypt.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
| TOP | 08 | 00 | | 0 byte |
1414
| TOP58+TOP59 | 09 | 05 | 3rd & 4th bit = b01 Standard, b10 - DHW Standard/Variable (J-series only)<br/>5th & 6th bit = b01 DHW heater off, b10 - DHW heater on<br/>7rd & 8th bit = b01 Water heater off, b10 - Water heater on | DHW capacity (J-series only)<br/>Heaters enable allowed status|
1515
| TOP | 10 | 00 | | 0 byte |
16-
| TOP141 | 11 | 00 | 3rd & 4th bit = b01 - Sound , b10 - Capacity <br/> 7th & 8th bit = b01 - DHW Top sensor , b10 - DHW Center Sensor | Quiet Mode Priority (K/L series) <br/> Only All-In-One |
16+
| TOP141+TOP143 | 11 | 00 | 3rd & 4th bit = b01 - Sound , b10 - Capacity <br/> 7th & 8th bit = b01 - DHW Top sensor , b10 - DHW Center Sensor | Quiet Mode Priority (K/L series) <br/> DHW Sensor Selection (K/L series All-In-One only) |
1717
| TOP | 12 | 00 | | 0 byte |
1818
| TOP | 13 | 00 | | 0 byte |
1919
| TOP | 14 | 00 | | 0 byte |

0 commit comments

Comments
 (0)