From da819d2b5a7578fd1f8899e52a348ab543bfd7e9 Mon Sep 17 00:00:00 2001 From: kr0ner Date: Mon, 9 Dec 2024 23:57:08 +0100 Subject: [PATCH] Adds support for WPL13 --- esp32-poe-technik.yaml | 3 +- src/communication.h | 15 +++-- src/mapper.cpp | 7 ++- src/property.h | 28 ++++++++++ yaml/wp_temperature.yaml | 7 ++- yaml/wpl13.yaml | 118 +++++++++++++++++++++++++++++++++++++++ 6 files changed, 166 insertions(+), 12 deletions(-) create mode 100644 yaml/wpl13.yaml diff --git a/esp32-poe-technik.yaml b/esp32-poe-technik.yaml index 853a19f..93d2872 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 7d06579..a8fa455 100644 --- a/src/communication.h +++ b/src/communication.h @@ -25,8 +25,12 @@ static const CanMember Manager{MANAGER_ID, "Manager"}; static const CanMember Kessel{KESSEL_ID, "Kessel"}; static const CanMember HK1{HK1_ID, "HK1"}; static const CanMember HK2{HK2_ID, "HK2"}; +static const CanMember FET{0x402, "FET"}; +static const CanMember R2D2{0x700, "R2D2"}; +static const CanMember C3PO{0x480, "C3PO"}; -static const std::vector> canMembers{Kessel, HK1, HK2, Manager, ESPClient}; +static const std::vector> canMembers{Kessel, HK1, HK2, Manager, + FET, R2D2, C3PO, ESPClient}; using Request = std::pair; static std::queue request_queue; @@ -51,9 +55,8 @@ std::optional> getCanMemberByCanId(CANId */ bool isRequest(const std::vector& msg) { const auto id{msg[1U] | (msg[0U] << 8U)}; - const auto it = std::find_if(canMembers.cbegin(), canMembers.cend(), [id](const auto& member) { - return member.get().getReadId() == id || member.get().getWriteId() == id; - }); + const auto it = std::find_if(canMembers.cbegin(), canMembers.cend(), + [id](const auto& member) { return member.get().getReadId() == id; }); return it != canMembers.cend(); } @@ -107,8 +110,8 @@ std::pair processCanMessage(const std::vectorget(),property)); + callback(value); + } else { + ESP_LOGD("CAN", "No CANMember with CANId 0x%04lx available.", can_id); + } + +select: + - platform: template + name: "PROGRAMMSCHALTER" + id: PROGRAMMSCHALTER + options: + - "Notbetrieb" + - "Bereitschaft" + - "Programm" + - "Komfort" + - "Eco" + - "Unbekannt" + initial_option: "Unbekannt" + optimistic: true + setup_priority: 100 + set_action: + then: + - lambda: |- + const auto betriebsartId = Mapper::instance().getBetriebsartId(x); + if(betriebsartId.has_value()) { + sendData(Kessel, Property::kPROGRAMMSCHALTER, betriebsartId.value()); + } + +packages: + AUSSENTEMP: !include { file: wp_temperature.yaml, vars: { property: "AUSSENTEMP" }} + ISTTEMPERATUR_HK1: !include { file: wp_temperature.yaml, vars: { property: "ISTTEMPERATUR" , name_suffix: "_HK1" , target: "HK1" }} + KOMFORTTEMPERATUR_HK1: !include { file: wp_temperature.yaml, vars: { property: "KOMFORTTEMPERATUR" , name_suffix: "_HK1" , target: "HK1" }} + ISTTEMPERATUR_HK2: !include { file: wp_temperature.yaml, vars: { property: "ISTTEMPERATUR" , name_suffix: "_HK2" , target: "HK2" }} + KOMFORTTEMPERATUR_HK2: !include { file: wp_temperature.yaml, vars: { property: "KOMFORTTEMPERATUR" , name_suffix: "_HK2" , target: "HK2" }} + RAUMISTTEMP_HK1: !include { file: wp_temperature.yaml, vars: { property: "RAUMISTTEMP" , name_suffix: "_HK1" , target: "HK1" }} + RAUMISTTEMP_HK2: !include { file: wp_temperature.yaml, vars: { property: "RAUMISTTEMP" , name_suffix: "_HK2" , target: "HK2" }} + RAUMSOLLTEMP_HK1: !include { file: wp_temperature.yaml, vars: { property: "RAUMSOLLTEMP" , name_suffix: "_HK1" , target: "HK1" }} + RAUMSOLLTEMP_HK2: !include { file: wp_temperature.yaml, vars: { property: "RAUMSOLLTEMP" , name_suffix: "_HK2" , target: "HK2" }} + PUFFERISTTEMPERATUR: !include { file: wp_temperature.yaml, vars: { property: "PUFFERISTTEMPERATUR" }} + EINSTELL_SPEICHERSOLLTEMP: !include { file: wp_temperature.yaml, vars: { property: "EINSTELL_SPEICHERSOLLTEMP" }} + SPEICHERISTTEMP: !include { file: wp_temperature.yaml, vars: { property: "SPEICHERISTTEMP" , interval: $interval_medium }} + ANLAGENFROST: !include { file: wp_temperature.yaml, vars: { property: "ANLAGENFROST" , target: "R2D2" }} + VORLAUFISTTEMP: !include { file: wp_temperature.yaml, vars: { property: "VORLAUFISTTEMP" , target: "R2D2" }} + VORLAUFTEMP_QUELLE: !include { file: wp_temperature.yaml, vars: { property: "VORLAUFTEMP_QUELLE" , target: "Manager" }} + + RAUMFEUCHTE: !include { file: wp_generic.yaml, vars: { property: "RAUMFEUCHTE" , interval: $interval_very_slow, unit: "%", icon: "mdi:water-percent", accuracy_decimals: "1", target: "FET" }} + HEAT_EFF_1D: !include { file: wp_generic.yaml, vars: { property: "HEAT_EFF_1D" , target: "C3PO" }} + HEAT_EFF_1Y: !include { file: wp_generic.yaml, vars: { property: "HEAT_EFF_1Y" , target: "C3PO" }} + QUELLENDRUCK: !include { file: wp_generic.yaml, vars: { property: "QUELLENDRUCK" , interval: never, unit: "bar" , icon: "mdi:water-pressure" , accuracy_decimals: "1", target: "Manager" }} + LEISTUNG_QUELLENPUMPE: !include { file: wp_generic.yaml, vars: { property: "LEISTUNG_QUELLENPUMPE" , interval: never, unit: "%" , icon: "mdi:water-percent", accuracy_decimals: "1", target: "Manager" }} + VOLUMENSTROM: !include { file: wp_generic.yaml, vars: { property: "VOLUMENSTROM" , interval: never, unit: "l/min", icon: "mdi:flow" , accuracy_decimals: "1", target: "Manager" }} + STROM_INVERTER: !include { file: wp_generic.yaml, vars: { property: "STROM_INVERTER" , interval: never, unit: "A" , target: "Manager" }} + SPANNUNG_INVERTER: !include { file: wp_generic.yaml, vars: { property: "SPANNUNG_INVERTER" , interval: never, unit: "V" , target: "Manager" }} + + VERDICHTER_STARTS: !include { file: wp_generic_combined.yaml, vars: { sensor_name: "VERDICHTER_STARTS" , scaled_property: "VERDICHTER_STARTS_K" , property: "VERDICHTER_STARTS" , unit: "" , accuracy_decimals: "0", scaler: "1000", icon: "mdi:counter" , target: "Manager" }}