diff --git a/components/panasonic_heatpump/README.md b/components/panasonic_heatpump/README.md index 4167139..1bfe72e 100644 --- a/components/panasonic_heatpump/README.md +++ b/components/panasonic_heatpump/README.md @@ -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 diff --git a/components/panasonic_heatpump/decode.cpp b/components/panasonic_heatpump/decode.cpp index d9785a3..666484c 100644 --- a/components/panasonic_heatpump/decode.cpp +++ b/components/panasonic_heatpump/decode.cpp @@ -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] = { diff --git a/components/panasonic_heatpump/decode.h b/components/panasonic_heatpump/decode.h index 15aca96..da1a71b 100644 --- a/components/panasonic_heatpump/decode.h +++ b/components/panasonic_heatpump/decode.h @@ -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 diff --git a/components/panasonic_heatpump/panasonic_heatpump.h b/components/panasonic_heatpump/panasonic_heatpump.h index e422eb0..6e32fa1 100644 --- a/components/panasonic_heatpump/panasonic_heatpump.h +++ b/components/panasonic_heatpump/panasonic_heatpump.h @@ -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 diff --git a/components/panasonic_heatpump/select/__init__.py b/components/panasonic_heatpump/select/__init__.py index 7ef630c..013dc43 100644 --- a/components/panasonic_heatpump/select/__init__.py +++ b/components/panasonic_heatpump/select/__init__.py @@ -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, @@ -25,6 +29,10 @@ CONF_SET17, CONF_SET26, CONF_SET35, + CONF_SET39, + CONF_SET40, + CONF_SET41, + CONF_SET42, ] CONF_SELECTS = [ @@ -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 = [ @@ -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) diff --git a/components/panasonic_heatpump/select/panasonic_heatpump_select.cpp b/components/panasonic_heatpump/select/panasonic_heatpump_select.cpp index 797fa14..0267ffb 100644 --- a/components/panasonic_heatpump/select/panasonic_heatpump_select.cpp +++ b/components/panasonic_heatpump/select/panasonic_heatpump_select.cpp @@ -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& 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; }; diff --git a/components/panasonic_heatpump/select/panasonic_heatpump_select.h b/components/panasonic_heatpump/select/panasonic_heatpump_select.h index 1f7fa32..e4a238a 100644 --- a/components/panasonic_heatpump/select/panasonic_heatpump_select.h +++ b/components/panasonic_heatpump/select/panasonic_heatpump_select.h @@ -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, diff --git a/components/panasonic_heatpump/sensor/__init__.py b/components/panasonic_heatpump/sensor/__init__.py index 6e8a3f6..6707b49 100644 --- a/components/panasonic_heatpump/sensor/__init__.py +++ b/components/panasonic_heatpump/sensor/__init__.py @@ -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 @@ -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, @@ -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, @@ -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, @@ -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, diff --git a/components/panasonic_heatpump/text_sensor/__init__.py b/components/panasonic_heatpump/text_sensor/__init__.py index 77f8ea5..bb6c174 100644 --- a/components/panasonic_heatpump/text_sensor/__init__.py +++ b/components/panasonic_heatpump/text_sensor/__init__.py @@ -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) @@ -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, @@ -70,6 +75,9 @@ CONF_TOP125, CONF_TOP126, CONF_TOP130, + CONF_TOP139, + CONF_TOP140, + CONF_TOP141, ] PanasonicHeatpumpTextSensor = panasonic_heatpump_ns.class_( @@ -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) diff --git a/components/panasonic_heatpump/text_sensor/panasonic_heatpump_text_sensor.cpp b/components/panasonic_heatpump/text_sensor/panasonic_heatpump_text_sensor.cpp index 06c4aaf..79ea7ae 100644 --- a/components/panasonic_heatpump/text_sensor/panasonic_heatpump_text_sensor.cpp +++ b/components/panasonic_heatpump/text_sensor/panasonic_heatpump_text_sensor.cpp @@ -127,6 +127,22 @@ void PanasonicHeatpumpTextSensor::publish_new_state(const std::vector& 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; }; diff --git a/components/panasonic_heatpump/text_sensor/panasonic_heatpump_text_sensor.h b/components/panasonic_heatpump/text_sensor/panasonic_heatpump_text_sensor.h index a6e09f8..7d34d9d 100644 --- a/components/panasonic_heatpump/text_sensor/panasonic_heatpump_text_sensor.h +++ b/components/panasonic_heatpump/text_sensor/panasonic_heatpump_text_sensor.h @@ -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, diff --git a/example_panasonic_heatpump.yaml b/example_panasonic_heatpump.yaml index 2effc8b..3f1d465 100644 --- a/example_panasonic_heatpump.yaml +++ b/example_panasonic_heatpump.yaml @@ -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 diff --git a/tests/panasonic_heatpump/test_panasonic_heatpump_full.yaml b/tests/panasonic_heatpump/test_panasonic_heatpump_full.yaml index 7841fbe..9e7fc68 100644 --- a/tests/panasonic_heatpump/test_panasonic_heatpump_full.yaml +++ b/tests/panasonic_heatpump/test_panasonic_heatpump_full.yaml @@ -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: