Merge pull request #29 from ElVit/heatpump/feature/new_sensors_and_controls

Add TOP139-141 and SET39-42
This commit is contained in:
ElVit 2026-03-24 16:43:08 +01:00 committed by GitHub
commit 8f9152e12e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
13 changed files with 174 additions and 3 deletions

View File

@ -117,7 +117,8 @@ water_heater:
```
Thanks to [oxyde42](https://github.com/oxyde42) there is also an exmaple yaml code for the HeishaMon Large Board:
- [example_heishamon_large.yaml](../../prototypes/panasonic_heatpump/example_heishamon_large.yaml)
* [example_heishamon_large.yaml](../../prototypes/panasonic_heatpump/example_heishamon_large.yaml)
## Configuration variables
@ -451,6 +452,12 @@ text_sensor:
name: "ThreeWay Valve State2"
top130:
name: "Bivalent Mode"
top139:
name: "HeatingControl"
top140:
name: "SmartDHW"
top141:
name: "Quiet Mode Priority"
```
### Numbers
@ -594,6 +601,14 @@ select:
name: "Set External PadHeater"
set35:
name: "Set Bivalent Mode"
set39:
name: "Set Heating Control"
set40:
name: "Set Smart DHW"
set41:
name: "Set Quiet Mode Priority"
set42:
name: "Set Pump Flow Rate Mode"
```
### Climates

View File

@ -21,6 +21,9 @@ constexpr const char* const PanasonicDecode::ZoneSensorType[];
constexpr const char* const PanasonicDecode::LiquidType[];
constexpr const char* const PanasonicDecode::ExtPadHeaterType[];
constexpr const char* const PanasonicDecode::BivalentMode[];
constexpr const char* const PanasonicDecode::HeatingControl[];
constexpr const char* const PanasonicDecode::SmartDHW[];
constexpr const char* const PanasonicDecode::QuietModePriority[];
constexpr const char* const PanasonicDecode::ModelNames[];
constexpr const uint8_t KnownModels[NUMBER_OF_MODELS][10] = {

View File

@ -49,7 +49,7 @@ class PanasonicDecode {
static const constexpr char* const BlockedFree[] = {"2", "Blocked", "Free"};
static const constexpr char* const OffOn[] = {"2", "Off", "On"};
static const constexpr char* const InactiveActive[] = {"2", "Inactive", "Active"};
static const constexpr char* const PumpFlowRateMode[] = {"2", "DeltaT", "Max flow"};
static const constexpr char* const PumpFlowRateMode[] = {"2", "DeltaT", "Max. Duty"};
static const constexpr char* const ThreeWayValve[] = {"2", "Buffer Tank", "DHW Tank"};
static const constexpr char* const TwoWayValve[] = {"2", "Cool", "Heat"};
static const constexpr char* const WaterTempControl[] = {"2", "Comp. Curve", "Direct"};
@ -67,6 +67,9 @@ class PanasonicDecode {
static const constexpr char* const ZoneState[] = {"3", "Zone 1", "Zone 2", "Zone 1 & 2"};
static const constexpr char* const ExtPadHeaterType[] = {"3", "Disabled", "Type-A", "Type-B"};
static const constexpr char* const BivalentMode[] = {"3", "Alternative", "Parallel", "Advanced Parallel"};
static const constexpr char* const HeatingControl[] = {"2", "Comfort", "Efficiency"};
static const constexpr char* const SmartDHW[] = {"2", "Variable", "Standard"};
static const constexpr char* const QuietModePriority[] = {"2", "Sound", "Capacity"};
static const constexpr char* const ModelNames[] = {
"58", // string representation of number of known models (last model number + 1)
"WH-MDC05H3E5", // 0

View File

@ -12,7 +12,7 @@
#include "commands.h"
#ifndef PANASONIC_HEATPUMP_VERSION
#define PANASONIC_HEATPUMP_VERSION "0.0.8-beta.2"
#define PANASONIC_HEATPUMP_VERSION "0.0.8-beta.3"
#endif
#ifndef KEEP_STATE

View File

@ -16,6 +16,10 @@ CONF_SET9 = "set9" # Set Operation Mode
CONF_SET17 = "set17" # Set Zones
CONF_SET26 = "set26" # Set External PadHeater
CONF_SET35 = "set35" # Set Bivalent Mode
CONF_SET39 = "set39" # Set Heating Control
CONF_SET40 = "set40" # Set Smart DHW
CONF_SET41 = "set41" # Set Quiet Mode Priority
CONF_SET42 = "set42" # Set Pump Flow Rate Mode
TYPES = [
CONF_SET2,
@ -25,6 +29,10 @@ TYPES = [
CONF_SET17,
CONF_SET26,
CONF_SET35,
CONF_SET39,
CONF_SET40,
CONF_SET41,
CONF_SET42,
]
CONF_SELECTS = [
@ -57,6 +65,22 @@ CONF_SELECTS = [
],
["Disabled", "Type-A", "Type-B"],
["Alternative", "Parallel", "Advanced Parallel"],
[
"Comfort",
"Efficiency",
],
[
"Variable",
"Standard",
],
[
"Sound",
"Capacity",
],
[
"DeltaT",
"Max. Duty",
],
]
CONF_SELECT_COOL_MODE = [
@ -100,6 +124,18 @@ CONFIG_SCHEMA = cv.Schema(
cv.Optional(CONF_SET35): select.select_schema(
PanasonicHeatpumpSelect,
),
cv.Optional(CONF_SET39): select.select_schema(
PanasonicHeatpumpSelect,
),
cv.Optional(CONF_SET40): select.select_schema(
PanasonicHeatpumpSelect,
),
cv.Optional(CONF_SET41): select.select_schema(
PanasonicHeatpumpSelect,
),
cv.Optional(CONF_SET42): select.select_schema(
PanasonicHeatpumpSelect,
),
}
).extend(cv.COMPONENT_SCHEMA)

View File

@ -37,6 +37,18 @@ void PanasonicHeatpumpSelect::control(const std::string& value) {
case SelectIds::CONF_SET35:
this->parent_->set_command_byte(PanasonicCommand::setPlus1Multiply4(index), 26);
break;
case SelectIds::CONF_SET39:
this->parent_->set_command_byte(PanasonicCommand::setPlus1Multiply4(index), 30);
break;
case SelectIds::CONF_SET40:
this->parent_->set_command_byte(PanasonicCommand::setPlus1Multiply64(index), 24);
break;
case SelectIds::CONF_SET41:
this->parent_->set_command_byte(PanasonicCommand::setPlus1Multiply16(index), 11);
break;
case SelectIds::CONF_SET42:
this->parent_->set_command_byte(PanasonicCommand::setPlus1Multiply16(index), 29);
break;
default:
return;
};
@ -92,6 +104,28 @@ void PanasonicHeatpumpSelect::publish_new_state(const std::vector<uint8_t>& data
if (this->has_state() && this->current_option() == new_state)
return;
break;
case SelectIds::CONF_SET39:
new_state = PanasonicDecode::getTextState(PanasonicDecode::HeatingControl, PanasonicDecode::getBit5and6(data[30]));
if (this->has_state() && this->current_option() == new_state)
return;
break;
case SelectIds::CONF_SET40:
new_state = PanasonicDecode::getTextState(PanasonicDecode::SmartDHW, PanasonicDecode::getBit1and2(data[24]));
if (this->has_state() && this->current_option() == new_state)
return;
break;
case SelectIds::CONF_SET41:
new_state =
PanasonicDecode::getTextState(PanasonicDecode::QuietModePriority, PanasonicDecode::getBit3and4(data[11]));
if (this->has_state() && this->current_option() == new_state)
return;
break;
case SelectIds::CONF_SET42:
new_state =
PanasonicDecode::getTextState(PanasonicDecode::PumpFlowRateMode, PanasonicDecode::getBit3and4(data[29]));
if (this->has_state() && this->current_option() == new_state)
return;
break;
default:
return;
};

View File

@ -15,6 +15,10 @@ enum SelectIds : uint8_t {
CONF_SET17,
CONF_SET26,
CONF_SET35,
CONF_SET39,
CONF_SET40,
CONF_SET41,
CONF_SET42,
};
class PanasonicHeatpumpSelect : public select::Select,

View File

@ -33,7 +33,10 @@ UNIT_LITRE_PER_MINUTE = "L/min"
UNIT_ROTATIONS_PER_MINUTE = "r/min"
UNIT_PRESSURE_KGFCM2 = "kgf/cm²"
UNIT_BAR = "bar"
ICON_PUMP = "mdi:pump"
ICON_VALVE = "mdi:pipe-valve"
ICON_DUTY = "mdi:speedometer"
ICON_GAUGE = "mdi:gauge"
CONF_TOP1 = "top1" # Pump Flow
CONF_TOP5 = "top5" # Main Inlet Temp
@ -258,6 +261,7 @@ CONFIG_SCHEMA = cv.Schema(
device_class=DEVICE_CLASS_VOLUME_FLOW_RATE,
state_class=STATE_CLASS_MEASUREMENT,
unit_of_measurement=UNIT_LITRE_PER_MINUTE,
icon=ICON_PUMP,
),
cv.Optional(CONF_TOP5): sensor.sensor_schema(
PanasonicHeatpumpSensor,
@ -607,6 +611,7 @@ CONFIG_SCHEMA = cv.Schema(
accuracy_decimals=2,
state_class=STATE_CLASS_MEASUREMENT,
unit_of_measurement=UNIT_ROTATIONS_PER_MINUTE,
icon=ICON_PUMP,
),
cv.Optional(CONF_TOP66): sensor.sensor_schema(
PanasonicHeatpumpSensor,
@ -767,12 +772,14 @@ CONFIG_SCHEMA = cv.Schema(
accuracy_decimals=0,
state_class=STATE_CLASS_MEASUREMENT,
unit_of_measurement=UNIT_EMPTY,
icon=ICON_PUMP,
),
cv.Optional(CONF_TOP95): sensor.sensor_schema(
PanasonicHeatpumpSensor,
accuracy_decimals=0,
state_class=STATE_CLASS_MEASUREMENT,
unit_of_measurement=UNIT_EMPTY,
icon=ICON_DUTY,
),
cv.Optional(CONF_TOP96): sensor.sensor_schema(
PanasonicHeatpumpSensor,
@ -863,12 +870,14 @@ CONFIG_SCHEMA = cv.Schema(
accuracy_decimals=2,
state_class=STATE_CLASS_MEASUREMENT,
unit_of_measurement=UNIT_PERCENT,
icon=ICON_GAUGE,
),
cv.Optional(CONF_TOP128): sensor.sensor_schema(
PanasonicHeatpumpSensor,
accuracy_decimals=2,
state_class=STATE_CLASS_MEASUREMENT,
unit_of_measurement=UNIT_PERCENT,
icon=ICON_GAUGE,
),
cv.Optional(CONF_TOP131): sensor.sensor_schema(
PanasonicHeatpumpSensor,

View File

@ -24,6 +24,8 @@ ICON_PUMP = "mdi:pump"
ICON_EXTERNAL_PAD_HEATER = "mdi:radiator"
ICON_THERMOMETER = "mdi:thermometer"
ICON_BIVALENT = "mdi:vector-combine"
ICON_HEATING_CONTROL = "mdi:thermostat-auto"
ICON_SMART_DHW = "mdi:water-boiler-auto"
CONF_TOP4 = "top4" # Operation Mode
# TODO: Split up top4 into top4_1 (Heating Mode State) and top4_2 (DHW Mode State)
@ -47,6 +49,9 @@ CONF_TOP114 = "top114" # External Pad Heater
CONF_TOP125 = "top125" # TwoWay Valve State
CONF_TOP126 = "top126" # ThreeWay Valve State2
CONF_TOP130 = "top130" # Bivalent Mode
CONF_TOP139 = "top139" # HeatingControl
CONF_TOP140 = "top140" # SmartDHW
CONF_TOP141 = "top141" # Quiet Mode Priority
TYPES = [
CONF_TOP4,
@ -70,6 +75,9 @@ TYPES = [
CONF_TOP125,
CONF_TOP126,
CONF_TOP130,
CONF_TOP139,
CONF_TOP140,
CONF_TOP141,
]
PanasonicHeatpumpTextSensor = panasonic_heatpump_ns.class_(
@ -165,6 +173,18 @@ CONFIG_SCHEMA = cv.Schema(
PanasonicHeatpumpTextSensor,
icon=ICON_BIVALENT,
),
cv.Optional(CONF_TOP139): text_sensor.text_sensor_schema(
PanasonicHeatpumpTextSensor,
icon=ICON_HEATING_CONTROL,
),
cv.Optional(CONF_TOP140): text_sensor.text_sensor_schema(
PanasonicHeatpumpTextSensor,
icon=ICON_SMART_DHW,
),
cv.Optional(CONF_TOP141): text_sensor.text_sensor_schema(
PanasonicHeatpumpTextSensor,
icon=ICON_QUIET_MODE,
),
}
).extend(cv.COMPONENT_SCHEMA)

View File

@ -127,6 +127,22 @@ void PanasonicHeatpumpTextSensor::publish_new_state(const std::vector<uint8_t>&
if (this->has_state() && this->get_state() == new_state)
return;
break;
case TextSensorIds::CONF_TOP139:
new_state = PanasonicDecode::getTextState(PanasonicDecode::HeatingControl, PanasonicDecode::getBit5and6(data[30]));
if (this->has_state() && this->get_state() == new_state)
return;
break;
case TextSensorIds::CONF_TOP140:
new_state = PanasonicDecode::getTextState(PanasonicDecode::SmartDHW, PanasonicDecode::getBit1and2(data[24]));
if (this->has_state() && this->get_state() == new_state)
return;
break;
case TextSensorIds::CONF_TOP141:
new_state =
PanasonicDecode::getTextState(PanasonicDecode::QuietModePriority, PanasonicDecode::getBit3and4(data[11]));
if (this->has_state() && this->get_state() == new_state)
return;
break;
default:
return;
};

View File

@ -28,6 +28,9 @@ enum TextSensorIds : uint8_t {
CONF_TOP125,
CONF_TOP126,
CONF_TOP130,
CONF_TOP139,
CONF_TOP140,
CONF_TOP141,
};
class PanasonicHeatpumpTextSensor : public text_sensor::TextSensor,

View File

@ -386,6 +386,12 @@ text_sensor:
name: "ThreeWay Valve State2"
top130:
name: "Bivalent Mode"
top139:
name: "HeatingControl"
top140:
name: "SmartDHW"
top141:
name: "Quiet Mode Priority"
number:
- platform: panasonic_heatpump
@ -502,6 +508,14 @@ select:
name: "Set External PadHeater"
set35:
name: "Set Bivalent Mode"
set39:
name: "Set Heating Control"
set40:
name: "Set Smart DHW"
set41:
name: "Set Quiet Mode Priority"
set42:
name: "Set Pump Flow Rate Mode"
climate:
- platform: panasonic_heatpump

View File

@ -350,6 +350,12 @@ text_sensor:
name: "ThreeWay Valve State2"
top130:
name: "Bivalent Mode"
top139:
name: "HeatingControl"
top140:
name: "SmartDHW"
top141:
name: "Quiet Mode Priority"
# Test all number controls
number:
@ -439,6 +445,14 @@ select:
name: "Set External PadHeater"
set35:
name: "Set Bivalent Mode"
set39:
name: "Set Heating Control"
set40:
name: "Set Smart DHW"
set41:
name: "Set Quiet Mode Priority"
set42:
name: "Set Pump Flow Rate Mode"
# Test all switch controls
switch: