From a84e5786b8badd1748a86b9aedbaf70716943242 Mon Sep 17 00:00:00 2001 From: kr0ner Date: Wed, 4 Dec 2024 23:51:30 +0100 Subject: [PATCH] Add support for wpl13 --- esp32-poe-technik.yaml | 3 ++- src/communication.h | 5 ++++ src/property.h | 6 +++++ yaml/wpl13.yaml | 58 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 yaml/wpl13.yaml diff --git a/esp32-poe-technik.yaml b/esp32-poe-technik.yaml index 853a19f..e605472 100644 --- a/esp32-poe-technik.yaml +++ b/esp32-poe-technik.yaml @@ -97,9 +97,10 @@ packages: watermeter: !include OneESP32ToRuleThemAll/yaml/watermeter.yaml sensors: !include OneESP32ToRuleThemAll/yaml/sensors.yaml # thz404: !include OneESP32ToRuleThemAll/yaml/thz404.yaml - thz504: !include OneESP32ToRuleThemAll/yaml/thz504.yaml +# thz504: !include OneESP32ToRuleThemAll/yaml/thz504.yaml # thz55eco: !include OneESP32ToRuleThemAll/yaml/thz5_5_eco.yaml # ttf07: !include OneESP32ToRuleThemAll/yaml/ttf07.yaml + wpl13: !include OneESP32ToRuleThemAll/yaml/wpl13.yaml kondensatpumpe: !include OneESP32ToRuleThemAll/yaml/kondensatpumpe.yaml ######################################### diff --git a/src/communication.h b/src/communication.h index 64ee069..d950ec4 100644 --- a/src/communication.h +++ b/src/communication.h @@ -23,8 +23,13 @@ struct CanMember { static const CanMember ESPClient{0x6a2, "ESPClient"}; static const CanMember Anfrage{0x6a1, "Anfrage"}; static const CanMember Kessel{0x180, "Kessel"}; +#if defined(WPL_13) +static const CanMember HK1{0x480, "HK1"}; +static const CanMember HK2{0x500, "HK2"}; +#else static const CanMember HK1{0x301, "HK1"}; static const CanMember HK2{0x302, "HK2"}; +#endif using Request = std::pair; static std::queue request_queue; diff --git a/src/property.h b/src/property.h index 2ebe3bb..e2cae15 100644 --- a/src/property.h +++ b/src/property.h @@ -188,6 +188,12 @@ struct Property : public detail::Property { PROPERTY(ANLAGENFROST, 0x0a00, Type::et_dec_val); PROPERTY(WW_ECO, 0x0a06, Type::et_dec_val); #endif + +#if defined(WPL_13) + PROPERTY(VERDICHTER_STARTS, 0xc0f4); + PROPERTY(VERDICHTER_STARTS_K, 0xc0f5); + PROPERTY(VORLAUFISTTEMP, 0x000f, Type::et_dec_val); +#endif }; #endif diff --git a/yaml/wpl13.yaml b/yaml/wpl13.yaml new file mode 100644 index 0000000..feca491 --- /dev/null +++ b/yaml/wpl13.yaml @@ -0,0 +1,58 @@ +esphome: + platformio_options: + build_flags: + - "-DWPL_13" + +packages: + COMMON: !include { file: common.yaml} + +######################################### +# # +# CANbus configuration # +# # +######################################### +canbus: + - id: !extend wp_can + on_frame: + +######################################### +# # +# KESSEL messages # +# # +######################################### + - can_id: 0x180 + then: + - lambda: |- + const auto property_value_pair = processCanMessage(x); + Property property{property_value_pair.first}; + SimpleVariant value{property_value_pair.second}; + auto callback = CallbackHandler::instance().getCallback(std::make_pair(Kessel,property)); + callback(value); + +######################################### +# # +# HK1 messages # +# # +######################################### + - can_id: 0x480 + then: + - lambda: |- + const auto property_value_pair = processCanMessage(x); + Property property{property_value_pair.first}; + SimpleVariant value{property_value_pair.second}; + auto callback = CallbackHandler::instance().getCallback(std::make_pair(HK1,property)); + callback(value); + +######################################### +# # +# HK2 messages # +# # +######################################### + - can_id: 0x500 + then: + - lambda: |- + const auto property_value_pair = processCanMessage(x); + Property property{property_value_pair.first}; + SimpleVariant value{property_value_pair.second}; + auto callback = CallbackHandler::instance().getCallback(std::make_pair(HK2,property)); + callback(value);