Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
17 changes: 16 additions & 1 deletion components/panasonic_heatpump/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions components/panasonic_heatpump/decode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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] = {
Expand Down
5 changes: 4 additions & 1 deletion components/panasonic_heatpump/decode.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"};
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion components/panasonic_heatpump/panasonic_heatpump.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
36 changes: 36 additions & 0 deletions components/panasonic_heatpump/select/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
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,
Expand All @@ -25,6 +29,10 @@
CONF_SET17,
CONF_SET26,
CONF_SET35,
CONF_SET39,
CONF_SET40,
CONF_SET41,
CONF_SET42,
]

CONF_SELECTS = [
Expand Down Expand Up @@ -57,6 +65,22 @@
],
["Disabled", "Type-A", "Type-B"],
["Alternative", "Parallel", "Advanced Parallel"],
[
"Comfort",
"Efficiency",
],
[
"Variable",
"Standard",
],
[
"Sound",
"Capacity",
],
[
"DeltaT",
"Max. Duty",
],
]

CONF_SELECT_COOL_MODE = [
Expand Down Expand Up @@ -100,6 +124,18 @@
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)

Expand Down
34 changes: 34 additions & 0 deletions components/panasonic_heatpump/select/panasonic_heatpump_select.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down Expand Up @@ -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;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
9 changes: 9 additions & 0 deletions components/panasonic_heatpump/sensor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@
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
Expand Down Expand Up @@ -258,6 +261,7 @@
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,
Expand Down Expand Up @@ -607,6 +611,7 @@
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,
Expand Down Expand Up @@ -767,12 +772,14 @@
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,
Expand Down Expand Up @@ -863,12 +870,14 @@
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,
Expand Down
20 changes: 20 additions & 0 deletions components/panasonic_heatpump/text_sensor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
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)
Expand All @@ -47,6 +49,9 @@
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,
Expand All @@ -70,6 +75,9 @@
CONF_TOP125,
CONF_TOP126,
CONF_TOP130,
CONF_TOP139,
CONF_TOP140,
CONF_TOP141,
]

PanasonicHeatpumpTextSensor = panasonic_heatpump_ns.class_(
Expand Down Expand Up @@ -165,6 +173,18 @@
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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
14 changes: 14 additions & 0 deletions example_panasonic_heatpump.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions tests/panasonic_heatpump/test_panasonic_heatpump_full.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
Loading