diff --git a/components/panasonic_heatpump/README.md b/components/panasonic_heatpump/README.md index b9e7501..b33153b 100644 --- a/components/panasonic_heatpump/README.md +++ b/components/panasonic_heatpump/README.md @@ -101,13 +101,24 @@ switch: climate: - platform: panasonic_heatpump cool_mode: true - tank: - name: "DHW" + zone1: + name: "Zone 1" min_temperature: -5.0 max_temperature: 5.0 - temperature_step: 0.5 + temperature_step: 1.0 + +water_heater: + - platform: panasonic_heatpump + tank: + name: "DHW" + min_temperature: 40.0 + max_temperature: 65.0 + target_temperature_step: 1.0 ``` +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) + ## Configuration variables * **id** (*Optional*, ID): Manually specify the ID used for actions. @@ -315,6 +326,8 @@ sensor: name: "Bivalent Advanced Stop Delay" top138: name: "Bivalent Advanced DHW Delay" + top142: + name: "Expansion Valve" xtop0: name: "Heat Power Consumption Extra" @@ -594,14 +607,24 @@ Here a list of all supported climates: climate: - platform: panasonic_heatpump cool_mode: false - tank: - name: "DHW" zone1: name: "Zone 1" zone2: name: "Zone 2" ``` +### Water Heater + +All water_heater are optional and all options from [water_heater component](https://esphome.io/components/water_heater/) can be applied. +Here a list of all supported water_heater: + +```yaml +water_heater: + - platform: panasonic_heatpump + tank: + name: "DHW" +``` + ## Custom Entities (For Advanced Users) If you review the [ProtocolByteDecrypt.md](https://github.com/Egyras/HeishaMon/blob/master/ProtocolByteDecrypt.md) file you will find also some TOPs and SETs which are not implemented yet in heishamon. diff --git a/components/panasonic_heatpump/sensor/__init__.py b/components/panasonic_heatpump/sensor/__init__.py index 6012670..6e8a3f6 100644 --- a/components/panasonic_heatpump/sensor/__init__.py +++ b/components/panasonic_heatpump/sensor/__init__.py @@ -21,6 +21,7 @@ from esphome.const import ( STATE_CLASS_MEASUREMENT, STATE_CLASS_TOTAL_INCREASING, ICON_COUNTER, + ICON_FAN, ) from .. import ( CONF_PANASONIC_HEATPUMP_ID, @@ -32,7 +33,7 @@ UNIT_LITRE_PER_MINUTE = "L/min" UNIT_ROTATIONS_PER_MINUTE = "r/min" UNIT_PRESSURE_KGFCM2 = "kgf/cm²" UNIT_BAR = "bar" -ICON_FAN_SPEED = "mdi:fan" +ICON_VALVE = "mdi:pipe-valve" CONF_TOP1 = "top1" # Pump Flow CONF_TOP5 = "top5" # Main Inlet Temp @@ -129,7 +130,7 @@ CONF_TOP135 = "top135" # Bivalent Advanced Stop Temp CONF_TOP136 = "top136" # Bivalent Advanced Start Delay CONF_TOP137 = "top137" # Bivalent Advanced Stop Delay CONF_TOP138 = "top138" # Bivalent Advanced DHW Delay - +CONF_TOP142 = "top142" # Expansion Valve CONF_XTOP0 = "xtop0" # Heat Power Consumption Extra CONF_XTOP1 = "xtop1" # Cool Power Consumption Extra CONF_XTOP2 = "xtop2" # DHW Power Consumption Extra @@ -233,6 +234,7 @@ TYPES = [ CONF_TOP136, CONF_TOP137, CONF_TOP138, + CONF_TOP142, CONF_XTOP0, CONF_XTOP1, CONF_XTOP2, @@ -582,14 +584,14 @@ CONFIG_SCHEMA = cv.Schema( cv.Optional(CONF_TOP62): sensor.sensor_schema( PanasonicHeatpumpSensor, accuracy_decimals=2, - icon=ICON_FAN_SPEED, + icon=ICON_FAN, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement=UNIT_ROTATIONS_PER_MINUTE, ), cv.Optional(CONF_TOP63): sensor.sensor_schema( PanasonicHeatpumpSensor, accuracy_decimals=2, - icon=ICON_FAN_SPEED, + icon=ICON_FAN, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement=UNIT_ROTATIONS_PER_MINUTE, ), @@ -910,6 +912,13 @@ CONFIG_SCHEMA = cv.Schema( state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement=UNIT_MINUTE, ), + cv.Optional(CONF_TOP142): sensor.sensor_schema( + PanasonicHeatpumpSensor, + accuracy_decimals=0, + icon=ICON_VALVE, + state_class=STATE_CLASS_MEASUREMENT, + unit_of_measurement=UNIT_EMPTY, + ), cv.Optional(CONF_XTOP0): sensor.sensor_schema( PanasonicHeatpumpSensor, accuracy_decimals=0, diff --git a/components/panasonic_heatpump/sensor/panasonic_heatpump_sensor.cpp b/components/panasonic_heatpump/sensor/panasonic_heatpump_sensor.cpp index cd4b25a..7e4355e 100644 --- a/components/panasonic_heatpump/sensor/panasonic_heatpump_sensor.cpp +++ b/components/panasonic_heatpump/sensor/panasonic_heatpump_sensor.cpp @@ -490,6 +490,11 @@ void PanasonicHeatpumpSensor::publish_new_state(const std::vector& data if (this->has_state() && this->get_state() == new_state) return; break; + case SensorIds::CONF_TOP142: + new_state = PanasonicDecode::getByteMinus1(data[175]); + if (this->has_state() && this->get_state() == new_state) + return; + break; case SensorIds::CONF_XTOP0: new_state = PanasonicDecode::getWordMinus1(data, 14); diff --git a/components/panasonic_heatpump/sensor/panasonic_heatpump_sensor.h b/components/panasonic_heatpump/sensor/panasonic_heatpump_sensor.h index 74d24ec..84c4350 100644 --- a/components/panasonic_heatpump/sensor/panasonic_heatpump_sensor.h +++ b/components/panasonic_heatpump/sensor/panasonic_heatpump_sensor.h @@ -102,6 +102,7 @@ enum SensorIds : uint8_t { CONF_TOP136, CONF_TOP137, CONF_TOP138, + CONF_TOP142, CONF_XTOP0, CONF_XTOP1, diff --git a/components/panasonic_heatpump/text_sensor/__init__.py b/components/panasonic_heatpump/text_sensor/__init__.py index 517af7b..77f8ea5 100644 --- a/components/panasonic_heatpump/text_sensor/__init__.py +++ b/components/panasonic_heatpump/text_sensor/__init__.py @@ -22,6 +22,8 @@ ICON_LIQUID = "mdi:water" ICON_VALVE = "mdi:pipe-valve" ICON_PUMP = "mdi:pump" ICON_EXTERNAL_PAD_HEATER = "mdi:radiator" +ICON_THERMOMETER = "mdi:thermometer" +ICON_BIVALENT = "mdi:vector-combine" CONF_TOP4 = "top4" # Operation Mode # TODO: Split up top4 into top4_1 (Heating Mode State) and top4_2 (DHW Mode State) @@ -141,9 +143,11 @@ CONFIG_SCHEMA = cv.Schema( ), cv.Optional(CONF_TOP111): text_sensor.text_sensor_schema( PanasonicHeatpumpTextSensor, + icon=ICON_THERMOMETER, ), cv.Optional(CONF_TOP112): text_sensor.text_sensor_schema( PanasonicHeatpumpTextSensor, + icon=ICON_THERMOMETER, ), cv.Optional(CONF_TOP114): text_sensor.text_sensor_schema( PanasonicHeatpumpTextSensor, @@ -159,6 +163,7 @@ CONFIG_SCHEMA = cv.Schema( ), cv.Optional(CONF_TOP130): text_sensor.text_sensor_schema( PanasonicHeatpumpTextSensor, + icon=ICON_BIVALENT, ), } ).extend(cv.COMPONENT_SCHEMA) diff --git a/components/panasonic_heatpump/water_heater/panasonic_heatpump_water_heater.cpp b/components/panasonic_heatpump/water_heater/panasonic_heatpump_water_heater.cpp index 755de6f..3c7953d 100644 --- a/components/panasonic_heatpump/water_heater/panasonic_heatpump_water_heater.cpp +++ b/components/panasonic_heatpump/water_heater/panasonic_heatpump_water_heater.cpp @@ -5,9 +5,9 @@ namespace esphome { namespace panasonic_heatpump { static const char* const TAG = "panasonic_heatpump.water_heater"; -void PanasonicHeatpumpWaterHeater::dump_config() { - LOG_WATER_HEATER("", "Panasonic Heatpump Water Heater", this); -} +// void PanasonicHeatpumpWaterHeater::dump_config() { +// LOG_WATER_HEATER("", "Panasonic Heatpump Water Heater", this); +// } water_heater::WaterHeaterTraits PanasonicHeatpumpWaterHeater::traits() { auto traits = water_heater::WaterHeaterTraits(); diff --git a/components/panasonic_heatpump/water_heater/panasonic_heatpump_water_heater.h b/components/panasonic_heatpump/water_heater/panasonic_heatpump_water_heater.h index 2a3e6d8..9547111 100644 --- a/components/panasonic_heatpump/water_heater/panasonic_heatpump_water_heater.h +++ b/components/panasonic_heatpump/water_heater/panasonic_heatpump_water_heater.h @@ -17,7 +17,7 @@ class PanasonicHeatpumpWaterHeater : public water_heater::WaterHeater, public PanasonicHeatpumpEntity { public: PanasonicHeatpumpWaterHeater() = default; - void dump_config() override; + // void dump_config() override; water_heater::WaterHeaterTraits traits() override; void publish_new_state(const std::vector& data) override; diff --git a/example_panasonic_heatpump.yaml b/example_panasonic_heatpump.yaml index 963b371..2effc8b 100644 --- a/example_panasonic_heatpump.yaml +++ b/example_panasonic_heatpump.yaml @@ -249,6 +249,8 @@ sensor: name: "Bivalent Advanced Stop Delay" top138: name: "Bivalent Advanced DHW Delay" + top142: + name: "Expansion Valve" xtop0: name: "Heat Power Consumption Extra" diff --git a/prototypes/panasonic_heatpump/example_heishamon_large.yaml b/prototypes/panasonic_heatpump/example_heishamon_large.yaml new file mode 100644 index 0000000..df82ba8 --- /dev/null +++ b/prototypes/panasonic_heatpump/example_heishamon_large.yaml @@ -0,0 +1,115 @@ +substitutions: + S0_PIN_1: GPIO1 + S0_PIN_2: GPIO2 + ONE_WIRE_BUS: GPIO3 + + PIN_TXtoRXhp: GPIO17 # heatpump reads data (RX) on this pin 3-(green) + PIN_RXtoTXhp: GPIO18 # heatpump sends data (TX) on this pin 2-(yellow) + PIN_PROXYRXtoTXcz: GPIO9 # WiFi module sends data (TX) on this pin (blue) + PIN_PROXYTXtoRXcz: GPIO8 # WiFi module reads data (RX) on this pin (white) + + # Other documentations + # CN-CNT Pinout (from top to bottom) + # RD 1 - +5V (250mA) + # WH/GN 2 - 0-5V (from heatpump TX) GPIO18 <- + # GN/WH 3 - 0-5V (to heatpump RX) GPIO17 -> + # YE 4 - +12V (250mA) + # BK 5 - GND + + # CN-NMODE Pinout (from top to bottom) + # RD 1 - +5V (250mA) + # WH/GN 2 - 0-5V (to cz RX ) GPIO8 -> + # GN/WH 3 - 0-5V (from cz TX) GPIO9 <- + # YE 4 - +12V (250mA) + # BK 5 - GND + + PIN_RGB_LED: GPIO42 + PIN_relayOne: GPIO21 + PIN_relayTwo: GPIO47 + PIN_TX_enable: GPIO5 # for Proxy-Mode HIGH; listen only: LOW + PIN_OT_enable: GPIO4 # OpenTherm modul + +esp32: + variant: ESP32S3 + framework: + type: esp-idf + advanced: + execute_from_psram: True + +# S. 3, ESP32-S3-MINI-1 & MINI-1U Datasheet v1.6 +psram: + mode: quad # 2 MB: quad mode + speed: 80MHz + +panasonic_heatpump: + id: my_heatpump + uart_id: uart_hp + uart_client_id: uart_cz + # log_uart_msg: True + update_interval: 15s + uart_client_timeout: 20s + +uart: + - id: uart_hp + # switch rx and tx to read what the heatpump is sending + tx_pin: $PIN_TXtoRXhp + rx_pin: $PIN_RXtoTXhp + baud_rate: 9600 + data_bits: 8 + parity: EVEN + stop_bits: 1 + + - id: uart_cz + # switch rx and tx to read what the WiFi module is sending + tx_pin: $PIN_PROXYTXtoRXcz + rx_pin: $PIN_PROXYRXtoTXcz + baud_rate: 9600 + data_bits: 8 + parity: EVEN + stop_bits: 1 + +debug: + update_interval: 5s + +light: + - platform: esp32_rmt_led_strip + chipset: WS2812 + pin: $PIN_RGB_LED + name: "RGB Light" + disabled_by_default: True + num_leds: 1 + id: rgb_led + rgb_order: GRB + +script: + - id: flash_green + then: + - light.turn_on: + id: rgb_led + flash_length: 50ms + brightness: 30% + green: 1 + blue: 0 + red: 0 + +output: + - platform: template + type: binary + id: green_pulse + write_action: + then: + - light.turn_on: + id: rgb_led + flash_length: 50ms + brightness: 20% + green: 1 + red: 0 + blue: 0 + + - platform: gpio # enable proxy to transmit via TXD + id: uart_tx_enable + pin: $PIN_TX_enable + + - platform: gpio # enable/disable open therm module + id: open_therm_enable + pin: $PIN_OT_enable diff --git a/tests/panasonic_heatpump/test_panasonic_heatpump_full.yaml b/tests/panasonic_heatpump/test_panasonic_heatpump_full.yaml index 6aa062a..26441ac 100644 --- a/tests/panasonic_heatpump/test_panasonic_heatpump_full.yaml +++ b/tests/panasonic_heatpump/test_panasonic_heatpump_full.yaml @@ -240,6 +240,8 @@ sensor: name: "Bivalent Advanced Stop Delay" top138: name: "Bivalent Advanced DHW Delay" + top142: + name: "Expansion Valve" xtop0: name: "Heat Power Consumption Extra" xtop1: