From 46a9c93ca02f9398b154fde99fde54ed7ef3c61b Mon Sep 17 00:00:00 2001 From: kr0ner Date: Tue, 26 Nov 2024 23:50:13 +0100 Subject: [PATCH] reorder properties by heatpump variant --- src/property.h | 186 +++++++++++++++++++--------------------------- yaml/common.yaml | 165 ---------------------------------------- yaml/ttf07.yaml | 12 --- yaml/wp_base.yaml | 152 ++++++++++++++++++++++++++++++++++++- 4 files changed, 227 insertions(+), 288 deletions(-) diff --git a/src/property.h b/src/property.h index 1e13efe..2ebe3bb 100644 --- a/src/property.h +++ b/src/property.h @@ -59,58 +59,57 @@ struct Property : public detail::Property { PROPERTY(FEHLERMELDUNG, 0x0001); PROPERTY(SPEICHERSOLLTEMP, 0x0003, Type::et_dec_val); PROPERTY(VORLAUFSOLLTEMP, 0x0004, Type::et_dec_val); - PROPERTY(RAUMSOLLTEMP_I, 0x0005, Type::et_dec_val); - PROPERTY(RAUMSOLLTEMP_NACHT, 0x0008, Type::et_dec_val); PROPERTY(AUSSENTEMP, 0x000c, Type::et_dec_val); - PROPERTY(SAMMLERISTTEMP, 0x000d, Type::et_dec_val); PROPERTY(SPEICHERISTTEMP, 0x000e, Type::et_dec_val); -#if !defined(TTF_07_C) - PROPERTY(VORLAUFISTTEMP, 0x000f, Type::et_dec_val); -#endif - PROPERTY(RAUMISTTEMP, 0x0011, Type::et_dec_val); - PROPERTY(VERSTELLTE_RAUMSOLLTEMP, 0x0012, Type::et_dec_val); - PROPERTY(EINSTELL_SPEICHERSOLLTEMP, 0x0013, Type::et_dec_val); - PROPERTY(VERDAMPFERTEMP, 0x0014, Type::et_dec_val); - PROPERTY(RUECKLAUFISTTEMP, 0x0016, Type::et_dec_val); -#if defined(TTF_07_C) - PROPERTY(PROGRAMMSCHALTER, 0x005a); -#endif PROPERTY(FEUCHTE, 0x0075, Type::et_dec_val); -#if defined(TTF_07_C) - PROPERTY(PUFFERISTTEMP, 0x0078, Type::et_dec_val); -#endif - PROPERTY(RAUMEINFLUSS, 0x010f, Type::et_little_endian); -#if !defined(TTF_07_C) - PROPERTY(PROGRAMMSCHALTER, 0x0112, Type::et_betriebsart); -#endif -#if defined(THZ_5_5_ECO) - PROPERTY(SOMMERBETRIEB_TEMP, 0x0116, Type::et_dec_val); -#endif PROPERTY(WOCHENTAG, 0x0121, Type::et_little_endian); PROPERTY(TAG, 0x0122, Type::et_little_endian); PROPERTY(MONAT, 0x0123, Type::et_little_endian); PROPERTY(JAHR, 0x0124, Type::et_little_endian); PROPERTY(STUNDE, 0x0125, Type::et_little_endian); PROPERTY(MINUTE, 0x0126, Type::et_little_endian); + PROPERTY(RAUMISTTEMP, 0x0011, Type::et_dec_val); + PROPERTY(VERSTELLTE_RAUMSOLLTEMP, 0x0012, Type::et_dec_val); + PROPERTY(VERDAMPFERTEMP, 0x0014, Type::et_dec_val); + PROPERTY(RUECKLAUFISTTEMP, 0x0016, Type::et_dec_val); + PROPERTY(RAUMEINFLUSS, 0x010f, Type::et_little_endian); + PROPERTY(EL_AUFNAHMELEISTUNG_WW_TAG_WH, 0x091a); + PROPERTY(EL_AUFNAHMELEISTUNG_WW_TAG_KWH, 0x091b, Type::et_double_val); + PROPERTY(EL_AUFNAHMELEISTUNG_WW_SUM_KWH, 0x091c); + PROPERTY(EL_AUFNAHMELEISTUNG_WW_SUM_MWH, 0x091d, Type::et_double_val); + PROPERTY(EL_AUFNAHMELEISTUNG_HEIZ_TAG_WH, 0x091e); + PROPERTY(EL_AUFNAHMELEISTUNG_HEIZ_TAG_KWH, 0x091f, Type::et_double_val); + PROPERTY(EL_AUFNAHMELEISTUNG_HEIZ_SUM_KWH, 0x0920); + PROPERTY(EL_AUFNAHMELEISTUNG_HEIZ_SUM_MWH, 0x0921, Type::et_double_val); + PROPERTY(WAERMEERTRAG_2WE_WW_TAG_WH, 0x0922); + PROPERTY(WAERMEERTRAG_2WE_WW_TAG_KWH, 0x0923, Type::et_double_val); + PROPERTY(WAERMEERTRAG_2WE_WW_SUM_KWH, 0x0924); + PROPERTY(WAERMEERTRAG_2WE_WW_SUM_MWH, 0x0925, Type::et_double_val); + PROPERTY(WAERMEERTRAG_2WE_HEIZ_TAG_WH, 0x0926); + PROPERTY(WAERMEERTRAG_2WE_HEIZ_TAG_KWH, 0x0927, Type::et_double_val); + PROPERTY(WAERMEERTRAG_2WE_HEIZ_SUM_KWH, 0x0928); + PROPERTY(WAERMEERTRAG_2WE_HEIZ_SUM_MWH, 0x0929, Type::et_double_val); + PROPERTY(WAERMEERTRAG_WW_TAG_WH, 0x092a); + PROPERTY(WAERMEERTRAG_WW_TAG_KWH, 0x092b, Type::et_double_val); + PROPERTY(WAERMEERTRAG_WW_SUM_KWH, 0x092c); + PROPERTY(WAERMEERTRAG_WW_SUM_MWH, 0x092d, Type::et_double_val); + PROPERTY(WAERMEERTRAG_HEIZ_TAG_WH, 0x092e); + PROPERTY(WAERMEERTRAG_HEIZ_TAG_KWH, 0x092f, Type::et_double_val); + PROPERTY(WAERMEERTRAG_HEIZ_SUM_KWH, 0x0930); + PROPERTY(WAERMEERTRAG_HEIZ_SUM_MWH, 0x0931, Type::et_double_val); + +#if defined(THZ_504) || defined(THZ_404) || defined(THZ_5_5_ECO) + PROPERTY(RAUMSOLLTEMP_I, 0x0005, Type::et_dec_val); + PROPERTY(RAUMSOLLTEMP_NACHT, 0x0008, Type::et_dec_val); + PROPERTY(SAMMLERISTTEMP, 0x000d, Type::et_dec_val); + PROPERTY(VORLAUFISTTEMP, 0x000f, Type::et_dec_val); + PROPERTY(EINSTELL_SPEICHERSOLLTEMP, 0x0013, Type::et_dec_val); + PROPERTY(PROGRAMMSCHALTER, 0x0112, Type::et_betriebsart); PROPERTY(HYSTERESE_WW, 0x0140, Type::et_dec_val); PROPERTY(BETRIEBS_STATUS, 0x0176); -#if !defined(TTF_07_C) PROPERTY(VOLUMENSTROM, 0x01da, Type::et_dec_val); -#endif -#if defined(TTF_07_C) - PROPERTY(QUELLE_IST, 0x01d4, Type::et_dec_val); - PROPERTY(PUFFERSOLLTEMP, 0x01d5, Type::et_dec_val); - PROPERTY(HKSOLLTEMP, 0x01d7, Type::et_dec_val); -#endif PROPERTY(TAUPUNKT_HK1, 0x0264, Type::et_dec_val); -#if defined(TTF_07_C) - PROPERTY(HEIZGASTEMP, 0x0265, Type::et_dec_val); - PROPERTY(DRUCK_HOCHDRUCK, 0x0268, Type::et_dec_val); -#endif PROPERTY(KUEHLMODE, 0x0287); -#if defined(TTF_07_C) - PROPERTY(HKISTTEMP, 0x02ca, Type::et_dec_val); -#endif PROPERTY(PUMPENDREHZAHL_HEIZEN, 0x02cb, Type::et_dec_val); PROPERTY(LAUFZEIT_FILTER_TAGE, 0x0341); PROPERTY(WAERMEERTRAG_RUECKGE_TAG_WH, 0x03ae); @@ -122,106 +121,73 @@ struct Property : public detail::Property { PROPERTY(KUEHL_RAUMSOLL_NACHT, 0x056b, Type::et_dec_val); PROPERTY(LUEFT_STUFE_TAG, 0x056c); PROPERTY(LUEFT_STUFE_NACHT, 0x056d); -#if defined(THZ_5_5_ECO) - PROPERTY(LUEFT_STUFE_BEREITSCHAFT, 0x056f); -#endif PROPERTY(LUEFT_STUFE_PARTY, 0x0570); + PROPERTY(PASSIVKUEHLUNG, 0x0575); + PROPERTY(NE_STUFE_WW, 0x058a); + PROPERTY(ZULUFT_SOLL, 0x0596); + PROPERTY(ZULUFT_IST, 0x0597); + PROPERTY(ABLUFT_SOLL, 0x0598); + PROPERTY(ABLUFT_IST, 0x0599); + PROPERTY(FORTLUFT_SOLL, 0x059a); + PROPERTY(FORTLUFT_IST, 0x059b); + PROPERTY(PUMPENZYKLEN_MIN_AUSSENT, 0x05bb); + PROPERTY(KUEHLSYSTEM, 0x0613); + PROPERTY(DRUCK_HEIZKREIS, 0x064a, Type::et_dec_val); + PROPERTY(LEISTUNG_AUSLEGUNG_KUEHLEN, 0x0692); + PROPERTY(MOTORSTROM, 0x069f); + PROPERTY(MOTORLEISTUNG, 0x06a0, Type::et_cent_val); + PROPERTY(MOTORSPANNUNG, 0x06a1); + PROPERTY(ABLUFTTEMP, 0x0694, Type::et_dec_val); + PROPERTY(ANZEIGE_NIEDERDRUCK, 0x07a7, Type::et_dec_val); + PROPERTY(HEIZ_KUEHL_LEISTUNG, 0xc0ee, Type::et_cent_val); + PROPERTY(ABLUFTFEUCHTE, 0xc0ef); + PROPERTY(LEISTUNG_AUSLEGUNG_HEIZUNG, 0xc0f1); + PROPERTY(VERDICHTER_STARTS, 0xc0f4); + PROPERTY(VERDICHTER_STARTS_K, 0xc0f5); + PROPERTY(ABLUFT_TAUPUNKT, 0xc0f6, Type::et_dec_val); + PROPERTY(LAUFZEIT_FILTER, 0xc111); + PROPERTY(DIFFERENZDRUCK, 0xc11e); + PROPERTY(BETRIEBS_STATUS_2, 0xc356); +#endif + #if defined(THZ_5_5_ECO) + PROPERTY(SOMMERBETRIEB_TEMP, 0x0116, Type::et_dec_val); + PROPERTY(LUEFT_STUFE_BEREITSCHAFT, 0x056f); PROPERTY(LUEFT_ZEIT_AUSSERPLAN_STUFE1, 0x0572); PROPERTY(LUEFT_ZEIT_AUSSERPLAN_STUFE2, 0x0573); PROPERTY(LUEFT_ZEIT_AUSSERPLAN_STUFE3, 0x0574); -#endif - PROPERTY(PASSIVKUEHLUNG, 0x0575); -#if defined(THZ_5_5_ECO) PROPERTY(LUEFT_ZULUFT_STUFE1, 0x0576); PROPERTY(LUEFT_ZULUFT_STUFE2, 0x0577); PROPERTY(LUEFT_ZULUFT_STUFE3, 0x0578); PROPERTY(LUEFT_ABLUFT_STUFE1, 0x0579); PROPERTY(LUEFT_ABLUFT_STUFE2, 0x057a); PROPERTY(LUEFT_ABLUFT_STUFE3, 0x057b); -#endif - PROPERTY(NE_STUFE_WW, 0x058a); - PROPERTY(ZULUFT_SOLL, 0x0596); - PROPERTY(ZULUFT_IST, 0x0597); - PROPERTY(ABLUFT_SOLL, 0x0598); - PROPERTY(ABLUFT_IST, 0x0599); - PROPERTY(FORTLUFT_SOLL, 0x059a); - PROPERTY(FORTLUFT_IST, 0x059b); -#if defined(THZ_5_5_ECO) PROPERTY(SOMMERBETRIEB_HYSTERESE, 0x05a2, Type::et_dec_val); -#endif - PROPERTY(PUMPENZYKLEN_MIN_AUSSENT, 0x05bb); -#if defined(THZ_5_5_ECO) PROPERTY(LUEFT_STUFE_HAND, 0x0612); #endif - PROPERTY(KUEHLSYSTEM, 0x0613); -#if !defined(TTF_07_C) - PROPERTY(DRUCK_HEIZKREIS, 0x064a, Type::et_dec_val); -#endif + #if defined(TTF_07_C) + PROPERTY(PROGRAMMSCHALTER, 0x005a); + PROPERTY(PUFFERISTTEMP, 0x0078, Type::et_dec_val); + PROPERTY(QUELLE_IST, 0x01d4, Type::et_dec_val); + PROPERTY(PUFFERSOLLTEMP, 0x01d5, Type::et_dec_val); + PROPERTY(HKSOLLTEMP, 0x01d7, Type::et_dec_val); + PROPERTY(HEIZGASTEMP, 0x0265, Type::et_dec_val); + PROPERTY(DRUCK_HOCHDRUCK, 0x0268, Type::et_dec_val); + PROPERTY(HKISTTEMP, 0x02ca, Type::et_dec_val); PROPERTY(VOLUMENSTROM, 0x0673, Type::et_cent_val); PROPERTY(DRUCK_HEIZKREIS, 0x0674, Type::et_cent_val); PROPERTY(QUELLENDRUCK, 0x0675, Type::et_cent_val); -#endif - PROPERTY(LEISTUNG_AUSLEGUNG_KUEHLEN, 0x0692); - PROPERTY(MOTORSTROM, 0x069f); - PROPERTY(MOTORLEISTUNG, 0x06a0, Type::et_cent_val); -#if defined(TTF_07_C) PROPERTY(VORLAUFISTTEMP, 0x06a1, Type::et_dec_val); -#else - PROPERTY(MOTORSPANNUNG, 0x06a1); -#endif - PROPERTY(ABLUFTTEMP, 0x0694, Type::et_dec_val); -#if defined(TTF_07_C) PROPERTY(VERDICHTER_STARTS, 0x071d); PROPERTY(VERDICHTER_STARTS_K, 0x071c); PROPERTY(DRUCK_NIEDERDRUCK, 0x07a5, Type::et_dec_val); -#endif - PROPERTY(ANZEIGE_NIEDERDRUCK, 0x07a7, Type::et_dec_val); -#if defined(TTF_07_C) PROPERTY(HEIZEN, 0x07fc); PROPERTY(KUEHLEN, 0x07ff); PROPERTY(WARMWASSER, 0x0802); -#endif - PROPERTY(EL_AUFNAHMELEISTUNG_WW_TAG_WH, 0x091a); - PROPERTY(EL_AUFNAHMELEISTUNG_WW_TAG_KWH, 0x091b, Type::et_double_val); - PROPERTY(EL_AUFNAHMELEISTUNG_WW_SUM_KWH, 0x091c); - PROPERTY(EL_AUFNAHMELEISTUNG_WW_SUM_MWH, 0x091d, Type::et_double_val); - PROPERTY(EL_AUFNAHMELEISTUNG_HEIZ_TAG_WH, 0x091e); - PROPERTY(EL_AUFNAHMELEISTUNG_HEIZ_TAG_KWH, 0x091f, Type::et_double_val); - PROPERTY(EL_AUFNAHMELEISTUNG_HEIZ_SUM_KWH, 0x0920); - PROPERTY(EL_AUFNAHMELEISTUNG_HEIZ_SUM_MWH, 0x0921, Type::et_double_val); - PROPERTY(WAERMEERTRAG_2WE_WW_TAG_WH, 0x0922); - PROPERTY(WAERMEERTRAG_2WE_WW_TAG_KWH, 0x0923, Type::et_double_val); - PROPERTY(WAERMEERTRAG_2WE_WW_SUM_KWH, 0x0924); - PROPERTY(WAERMEERTRAG_2WE_WW_SUM_MWH, 0x0925, Type::et_double_val); - PROPERTY(WAERMEERTRAG_2WE_HEIZ_TAG_WH, 0x0926); - PROPERTY(WAERMEERTRAG_2WE_HEIZ_TAG_KWH, 0x0927, Type::et_double_val); - PROPERTY(WAERMEERTRAG_2WE_HEIZ_SUM_KWH, 0x0928); - PROPERTY(WAERMEERTRAG_2WE_HEIZ_SUM_MWH, 0x0929, Type::et_double_val); - PROPERTY(WAERMEERTRAG_WW_TAG_WH, 0x092a); - PROPERTY(WAERMEERTRAG_WW_TAG_KWH, 0x092b, Type::et_double_val); - PROPERTY(WAERMEERTRAG_WW_SUM_KWH, 0x092c); - PROPERTY(WAERMEERTRAG_WW_SUM_MWH, 0x092d, Type::et_double_val); - PROPERTY(WAERMEERTRAG_HEIZ_TAG_WH, 0x092e); - PROPERTY(WAERMEERTRAG_HEIZ_TAG_KWH, 0x092f, Type::et_double_val); - PROPERTY(WAERMEERTRAG_HEIZ_SUM_KWH, 0x0930); - PROPERTY(WAERMEERTRAG_HEIZ_SUM_MWH, 0x0931, Type::et_double_val); -#if defined(TTF_07_C) PROPERTY(ANLAGENFROST, 0x0a00, Type::et_dec_val); PROPERTY(WW_ECO, 0x0a06, Type::et_dec_val); #endif - PROPERTY(HEIZ_KUEHL_LEISTUNG, 0xc0ee, Type::et_cent_val); - PROPERTY(ABLUFTFEUCHTE, 0xc0ef); - PROPERTY(LEISTUNG_AUSLEGUNG_HEIZUNG, 0xc0f1); -#if !defined(TTF_07_C) - PROPERTY(VERDICHTER_STARTS, 0xc0f4); - PROPERTY(VERDICHTER_STARTS_K, 0xc0f5); -#endif - PROPERTY(ABLUFT_TAUPUNKT, 0xc0f6, Type::et_dec_val); - PROPERTY(LAUFZEIT_FILTER, 0xc111); - PROPERTY(DIFFERENZDRUCK, 0xc11e); - PROPERTY(BETRIEBS_STATUS_2, 0xc356); }; #endif diff --git a/yaml/common.yaml b/yaml/common.yaml index 3ebfd6b..017c78a 100644 --- a/yaml/common.yaml +++ b/yaml/common.yaml @@ -2,7 +2,6 @@ esphome: includes: - OneESP32ToRuleThemAll/src/callback_handler.h - OneESP32ToRuleThemAll/src/communication.h - - OneESP32ToRuleThemAll/src/custom_climate.h - OneESP32ToRuleThemAll/src/mapper.h - OneESP32ToRuleThemAll/src/mapper.cpp - OneESP32ToRuleThemAll/src/property.h @@ -11,19 +10,6 @@ esphome: - OneESP32ToRuleThemAll/src/type.h - OneESP32ToRuleThemAll/src/type.cpp -######################################### -# # -# Obtain initial states # -# # -######################################### - on_boot: - priority: -100 - then: - - lambda: |- - queueRequest(Kessel, Property::kPROGRAMMSCHALTER); - queueRequest(Kessel, Property::kBETRIEBS_STATUS); - queueRequest(Kessel, Property::kBETRIEBS_STATUS_2); - ######################################### # # # Global variables # @@ -74,10 +60,6 @@ interval: ESP_LOGI("SET", "Sending cached humidity %f to heatpump", humidity); sendData(HK1, Property::kFEUCHTE, static_cast(humidity * 10.0f)); } - - interval: $interval_once_in_a_while - then: - - lambda: |- - queueRequest(Kessel, Property::kBETRIEBS_STATUS_2); ######################################### # # @@ -85,24 +67,6 @@ interval: # # ######################################### packages: - SCHALTPROGRAMM_AKTIV: !include { file: wp_binary.yaml, vars: { name: "SCHALTPROGRAMM_AKTIV" }} - VERDICHTER: !include { file: wp_binary.yaml, vars: { name: "VERDICHTER" }} - WARMWASSERBEREITUNG: !include { file: wp_binary.yaml, vars: { name: "WARMWASSERBEREITUNG" }} - ELEKTRISCHE_NACHERWAERMUNG: !include { file: wp_binary.yaml, vars: { name: "ELEKTRISCHE_NACHERWAERMUNG" }} - SERVICE: !include { file: wp_binary.yaml, vars: { name: "SERVICE" }} - HEIZEN: !include { file: wp_binary.yaml, vars: { name: "HEIZEN" }} - KUEHLEN: !include { file: wp_binary.yaml, vars: { name: "KUEHLEN" }} - LUEFTUNG: !include { file: wp_binary.yaml, vars: { name: "LUEFTUNG" }} - EVU_SPERRE: !include { file: wp_binary.yaml, vars: { name: "EVU_SPERRE" }} - FILTERWECHSEL_BEIDE: !include { file: wp_binary.yaml, vars: { name: "FILTERWECHSEL_BEIDE" }} - HEIZKREISPUMPE: !include { file: wp_binary.yaml, vars: { name: "HEIZKREISPUMPE" }} - ABTAUEN_VERDAMPFER: !include { file: wp_binary.yaml, vars: { name: "ABTAUEN_VERDAMPFER" }} - FILTERWECHSEL_ABLUFT: !include { file: wp_binary.yaml, vars: { name: "FILTERWECHSEL_ABLUFT" }} - FILTERWECHSEL_ZULUFT: !include { file: wp_binary.yaml, vars: { name: "FILTERWECHSEL_ZULUFT" }} - AUFHEIZPROGRAMM_AKTIV: !include { file: wp_binary.yaml, vars: { name: "AUFHEIZPROGRAMM_AKTIV" }} - SOMMERBETRIEB_AKTIV: !include { file: wp_binary.yaml, vars: { name: "SOMMERBETRIEB_AKTIV" }} - OFEN_KAMIN_AKTIV: !include { file: wp_binary.yaml, vars: { name: "OFEN_KAMIN_AKTIV" }} - 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" }} WAERMEERTRAG_2WE_WW_SUMME_MWH: !include { file: wp_generic_combined.yaml, vars: { sensor_name: "WAERMEERTRAG_2WE_WW_SUMME_MWH" , scaled_property: "WAERMEERTRAG_2WE_WW_SUM_KWH" , property: "WAERMEERTRAG_2WE_WW_SUM_MWH" , unit: "MWh", accuracy_decimals: "3", icon: "mdi:fire" }} WAERMEERTRAG_2WE_HEIZ_SUMME_MWH: !include { file: wp_generic_combined.yaml, vars: { sensor_name: "WAERMEERTRAG_2WE_HEIZ_SUMME_MWH" , scaled_property: "WAERMEERTRAG_2WE_HEIZ_SUM_KWH", property: "WAERMEERTRAG_2WE_HEIZ_SUM_MWH", unit: "MWh", accuracy_decimals: "3", icon: "mdi:fire" }} @@ -110,31 +74,19 @@ packages: WAERMEERTRAG_HEIZ_SUMME_MWH: !include { file: wp_generic_combined.yaml, vars: { sensor_name: "WAERMEERTRAG_HEIZ_SUMME_MWH" , scaled_property: "WAERMEERTRAG_HEIZ_SUM_KWH" , property: "WAERMEERTRAG_HEIZ_SUM_MWH" , unit: "MWh", accuracy_decimals: "3", icon: "mdi:fire" }} SPEICHERSOLLTEMP: !include { file: wp_temperature.yaml, vars: { property: "SPEICHERSOLLTEMP" }} - EINSTELL_SPEICHERSOLLTEMP: !include { file: wp_temperature.yaml, vars: { property: "EINSTELL_SPEICHERSOLLTEMP" }} SPEICHERISTTEMP: !include { file: wp_temperature.yaml, vars: { property: "SPEICHERISTTEMP" , interval: $interval_medium }} AUSSENTEMP: !include { file: wp_temperature.yaml, vars: { property: "AUSSENTEMP" }} - SAMMLERISTTEMP: !include { file: wp_temperature.yaml, vars: { property: "SAMMLERISTTEMP" , interval: $interval_medium }} VERDAMPFERTEMP: !include { file: wp_temperature.yaml, vars: { property: "VERDAMPFERTEMP" }} RUECKLAUFISTTEMP: !include { file: wp_temperature.yaml, vars: { property: "RUECKLAUFISTTEMP" , interval: $interval_medium }} VORLAUFISTTEMP: !include { file: wp_temperature.yaml, vars: { property: "VORLAUFISTTEMP" , interval: $interval_medium, target: "HK1" }} - TAUPUNKT_HK1: !include { file: wp_temperature.yaml, vars: { property: "TAUPUNKT_HK1" , target: "HK1" }} RAUMISTTEMP: !include { file: wp_temperature.yaml, vars: { property: "RAUMISTTEMP" , target: "HK1" }} VERSTELLTE_RAUMSOLLTEMP: !include { file: wp_temperature.yaml, vars: { property: "VERSTELLTE_RAUMSOLLTEMP" , target: "HK1" }} - RAUMSOLLTEMP_I: !include { file: wp_temperature.yaml, vars: { property: "RAUMSOLLTEMP_I" , target: "HK1" }} - RAUMSOLLTEMP_NACHT: !include { file: wp_temperature.yaml, vars: { property: "RAUMSOLLTEMP_NACHT" , target: "HK1" }} VORLAUFSOLLTEMP: !include { file: wp_temperature.yaml, vars: { property: "VORLAUFSOLLTEMP" , target: "HK1" }} - KUEHL_RAUMSOLL_TAG: !include { file: wp_temperature.yaml, vars: { property: "KUEHL_RAUMSOLL_TAG" , target: "HK1" }} FEHLERMELDUNG: !include { file: wp_generic.yaml, vars: { property: "FEHLERMELDUNG" , icon: "mdi:alert-circle" }} - ANZEIGE_NIEDERDRUCK: !include { file: wp_generic.yaml, vars: { property: "ANZEIGE_NIEDERDRUCK" , accuracy_decimals: "2" }} - PUMPENZYKLEN_MIN_AUSSENT: !include { file: wp_generic.yaml, vars: { property: "PUMPENZYKLEN_MIN_AUSSENT" }} FEUCHTE: !include { file: wp_generic.yaml, vars: { property: "FEUCHTE" , interval: $interval_very_slow, unit: "%", icon: "mdi:water-percent", target: "HK1", accuracy_decimals: "1" }} - LEISTUNG_AUSLEGUNG_HEIZUNG: !include { file: wp_number.yaml, vars: { property: "LEISTUNG_AUSLEGUNG_HEIZUNG" }} - LEISTUNG_AUSLEGUNG_KUEHLEN: !include { file: wp_number.yaml, vars: { property: "LEISTUNG_AUSLEGUNG_KUEHLEN" }} - PUMPENDREHZAHL_HEIZEN: !include { file: wp_number.yaml, vars: { property: "PUMPENDREHZAHL_HEIZEN" , step: "0.1" }} RAUMEINFLUSS: !include { file: wp_number.yaml, vars: { property: "RAUMEINFLUSS" , target: "HK1" }} - HYSTERESE_WW: !include { file: wp_number.yaml, vars: { property: "HYSTERESE_WW" , min: "2.0", max: "10.0", step: "0.1", unit: "°C" }} EL_AUFNAHMELEISTUNG_WW_SUMME_KWH: !include { file: wp_daily_energy_combined.yaml, vars: { sensor_name: "EL_AUFNAHMELEISTUNG_WW_SUMME_KWH" , property_wh: "EL_AUFNAHMELEISTUNG_WW_TAG_WH" , property_kwh: "EL_AUFNAHMELEISTUNG_WW_TAG_KWH" }} EL_AUFNAHMELEISTUNG_HEIZ_SUMME_KWH: !include { file: wp_daily_energy_combined.yaml, vars: { sensor_name: "EL_AUFNAHMELEISTUNG_HEIZ_SUMME_KWH" , property_wh: "EL_AUFNAHMELEISTUNG_HEIZ_TAG_WH", property_kwh: "EL_AUFNAHMELEISTUNG_HEIZ_TAG_KWH" }} @@ -193,83 +145,6 @@ sensor: } return id(gCOP_HEIZ_TAG); -######################################### -# # -# Selects # -# # -######################################### -select: - - platform: template - name: "PROGRAMMSCHALTER" - id: PROGRAMMSCHALTER - options: - - "Notbetrieb" - - "Bereitschaft" - - "Automatik" - - "Tagbetrieb" - - "Absenkbetrieb" - - "Warmwasser" - - "Handbetrieb" - - "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()); - } - -######################################### -# # -# Custom climates # -# # -######################################### -climate: - - platform: custom - lambda: |- - auto heating = new HeatingDayNight(id(RAUMISTTEMP),id(RAUMSOLLTEMP_I), id(HEIZEN), id(KUEHLEN), id(LUEFTUNG), Property::kRAUMSOLLTEMP_I, Property::kKUEHL_RAUMSOLL_TAG); - App.register_component(heating); - return {heating}; - climates: - name: "Heating Day" - visual: - min_temperature: 10.0 - max_temperature: 25.0 - temperature_step: - target_temperature: 0.1 - current_temperature: 0.1 - - - platform: custom - lambda: |- - auto heating = new HeatingDayNight(id(RAUMISTTEMP),id(RAUMSOLLTEMP_NACHT), id(HEIZEN), id(KUEHLEN), id(LUEFTUNG), Property::kRAUMSOLLTEMP_NACHT, Property::kKUEHL_RAUMSOLL_NACHT); - App.register_component(heating); - return {heating}; - climates: - name: "Heating Night" - visual: - min_temperature: 10.0 - max_temperature: 25.0 - temperature_step: - target_temperature: 0.1 - current_temperature: 0.1 - - - platform: custom - lambda: |- - auto hot_water = new HotWater(id(SPEICHERISTTEMP),id(EINSTELL_SPEICHERSOLLTEMP), id(WARMWASSERBEREITUNG), Property::kEINSTELL_SPEICHERSOLLTEMP); - App.register_component(hot_water); - return {hot_water}; - climates: - name: "Hot Water" - visual: - min_temperature: 30.0 - max_temperature: 75.0 - temperature_step: - target_temperature: 1.0 - current_temperature: 0.1 - ######################################### # # # CANbus configuration # @@ -296,46 +171,6 @@ canbus: auto callback = CallbackHandler::instance().getCallback(std::make_pair(Kessel,property)); callback(value); - switch(property) { - case Property::kPROGRAMMSCHALTER: - { - const auto stringValue{value.get()}; - const auto index = id(PROGRAMMSCHALTER).index_of(stringValue); - if(index.has_value()) { - id(PROGRAMMSCHALTER).publish_state(stringValue); - } - break; - } - case Property::kBETRIEBS_STATUS_2: - { - const std::bitset<2U> status_bits{static_cast(value)}; - id(SOMMERBETRIEB_AKTIV).publish_state(status_bits.test(0U)); - id(OFEN_KAMIN_AKTIV).publish_state(status_bits.test(1U)); - } - case Property::kBETRIEBS_STATUS: - { - const std::bitset<15U> status_bits{static_cast(value)}; - id(SCHALTPROGRAMM_AKTIV).publish_state(status_bits.test(0U)); - id(VERDICHTER).publish_state(status_bits.test(1U)); - id(HEIZEN).publish_state(status_bits.test(2U)); - id(KUEHLEN).publish_state(status_bits.test(3U)); - id(WARMWASSERBEREITUNG).publish_state(status_bits.test(4U)); - id(ELEKTRISCHE_NACHERWAERMUNG).publish_state(status_bits.test(5U)); - id(SERVICE).publish_state(status_bits.test(6U)); - id(EVU_SPERRE).publish_state(status_bits.test(7U)); - id(FILTERWECHSEL_BEIDE).publish_state(status_bits.test(8U)); - // seems to be broken id(LUEFTUNG).publish_state(status_bits.test(9U)); - id(HEIZKREISPUMPE).publish_state(status_bits.test(10U)); - id(ABTAUEN_VERDAMPFER).publish_state(status_bits.test(11U)); - id(FILTERWECHSEL_ABLUFT).publish_state(status_bits.test(12U)); - id(FILTERWECHSEL_ZULUFT).publish_state(status_bits.test(13U)); - id(AUFHEIZPROGRAMM_AKTIV).publish_state(status_bits.test(14U)); - break; - } - default: - break; - } - ######################################### # # # HK1 messages # diff --git a/yaml/ttf07.yaml b/yaml/ttf07.yaml index 75db9c4..87a9ff5 100644 --- a/yaml/ttf07.yaml +++ b/yaml/ttf07.yaml @@ -15,15 +15,3 @@ packages: DRUCK_HEIZKREIS: !include { file: wp_generic.yaml, vars: { property: "DRUCK_HEIZKREIS", interval: "never", unit: "bar" , icon: "mdi:water-pressure", accuracy_decimals: "1" }} QUELLENDRUCK: !include { file: wp_generic.yaml, vars: { property: "QUELLENDRUCK" , interval: "never", unit: "bar" , icon: "mdi:water-pressure", accuracy_decimals: "1" }} VOLUMENSTROM: !include { file: wp_generic.yaml, vars: { property: "VOLUMENSTROM" , interval: "never", unit: "l/min", icon: "mdi:flow" , accuracy_decimals: "1" }} - -binary_sensor: - - id: !extend LUEFTUNG - internal: true - - id: !extend EVU_SPERRE - internal: true - - id: !extend FILTERWECHSEL_BEIDE - internal: true - - id: !extend FILTERWECHSEL_ABLUFT - internal: true - - id: !extend FILTERWECHSEL_ZULUFT - internal: true diff --git a/yaml/wp_base.yaml b/yaml/wp_base.yaml index 67227d0..686e3b8 100644 --- a/yaml/wp_base.yaml +++ b/yaml/wp_base.yaml @@ -1,4 +1,6 @@ esphome: + includes: + - OneESP32ToRuleThemAll/src/custom_climate.h on_boot: priority: -100 then: @@ -42,6 +44,42 @@ esphome: id(ELECTRIC_HEATING_POWER).publish_state(electricHeatingPower); }); + CallbackHandler::instance().addCallback(std::make_pair(Kessel,Property::kPROGRAMMSCHALTER),[](const SimpleVariant& value){ + const auto stringValue{value.get()}; + const auto index = id(PROGRAMMSCHALTER).index_of(stringValue); + if(index.has_value()) { + id(PROGRAMMSCHALTER).publish_state(stringValue); + } + }); + queueRequest(Kessel, Property::kPROGRAMMSCHALTER); + + CallbackHandler::instance().addCallback(std::make_pair(Kessel,Property::kBETRIEBS_STATUS_2),[](const SimpleVariant& value){ + const std::bitset<2U> status_bits{static_cast(value)}; + id(SOMMERBETRIEB_AKTIV).publish_state(status_bits.test(0U)); + id(OFEN_KAMIN_AKTIV).publish_state(status_bits.test(1U)); + }); + queueRequest(Kessel, Property::kBETRIEBS_STATUS_2); + + CallbackHandler::instance().addCallback(std::make_pair(Kessel,Property::kBETRIEBS_STATUS),[](const SimpleVariant& value){ + const std::bitset<15U> status_bits{static_cast(value)}; + id(SCHALTPROGRAMM_AKTIV).publish_state(status_bits.test(0U)); + id(VERDICHTER).publish_state(status_bits.test(1U)); + id(HEIZEN).publish_state(status_bits.test(2U)); + id(KUEHLEN).publish_state(status_bits.test(3U)); + id(WARMWASSERBEREITUNG).publish_state(status_bits.test(4U)); + id(ELEKTRISCHE_NACHERWAERMUNG).publish_state(status_bits.test(5U)); + id(SERVICE).publish_state(status_bits.test(6U)); + id(EVU_SPERRE).publish_state(status_bits.test(7U)); + id(FILTERWECHSEL_BEIDE).publish_state(status_bits.test(8U)); + // seems to be broken id(LUEFTUNG).publish_state(status_bits.test(9U)); + id(HEIZKREISPUMPE).publish_state(status_bits.test(10U)); + id(ABTAUEN_VERDAMPFER).publish_state(status_bits.test(11U)); + id(FILTERWECHSEL_ABLUFT).publish_state(status_bits.test(12U)); + id(FILTERWECHSEL_ZULUFT).publish_state(status_bits.test(13U)); + id(AUFHEIZPROGRAMM_AKTIV).publish_state(status_bits.test(14U)); + }); + queueRequest(Kessel, Property::kBETRIEBS_STATUS); + ######################################### # # # Selects # @@ -69,6 +107,29 @@ select: sendData(Kessel, Property::kPASSIVKUEHLUNG, passivkuehlungId.value()); } + - platform: template + name: "PROGRAMMSCHALTER" + id: PROGRAMMSCHALTER + options: + - "Notbetrieb" + - "Bereitschaft" + - "Automatik" + - "Tagbetrieb" + - "Absenkbetrieb" + - "Warmwasser" + - "Handbetrieb" + - "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()); + } + ######################################### # # # Switches # @@ -105,15 +166,98 @@ sensor: device_class: power unit_of_measurement: "W" +######################################### +# # +# Custom climates # +# # +######################################### +climate: + - platform: custom + lambda: |- + auto heating = new HeatingDayNight(id(RAUMISTTEMP),id(RAUMSOLLTEMP_I), id(HEIZEN), id(KUEHLEN), id(LUEFTUNG), Property::kRAUMSOLLTEMP_I, Property::kKUEHL_RAUMSOLL_TAG); + App.register_component(heating); + return {heating}; + climates: + name: "Heating Day" + visual: + min_temperature: 10.0 + max_temperature: 25.0 + temperature_step: + target_temperature: 0.1 + current_temperature: 0.1 + + - platform: custom + lambda: |- + auto heating = new HeatingDayNight(id(RAUMISTTEMP),id(RAUMSOLLTEMP_NACHT), id(HEIZEN), id(KUEHLEN), id(LUEFTUNG), Property::kRAUMSOLLTEMP_NACHT, Property::kKUEHL_RAUMSOLL_NACHT); + App.register_component(heating); + return {heating}; + climates: + name: "Heating Night" + visual: + min_temperature: 10.0 + max_temperature: 25.0 + temperature_step: + target_temperature: 0.1 + current_temperature: 0.1 + + - platform: custom + lambda: |- + auto hot_water = new HotWater(id(SPEICHERISTTEMP),id(EINSTELL_SPEICHERSOLLTEMP), id(WARMWASSERBEREITUNG), Property::kEINSTELL_SPEICHERSOLLTEMP); + App.register_component(hot_water); + return {hot_water}; + climates: + name: "Hot Water" + visual: + min_temperature: 30.0 + max_temperature: 75.0 + temperature_step: + target_temperature: 1.0 + current_temperature: 0.1 + +######################################### +# # +# Intervals # +# # +######################################### +interval: + - interval: $interval_once_in_a_while + then: + - lambda: |- + queueRequest(Kessel, Property::kBETRIEBS_STATUS_2); + ######################################### # # # Packages # # # ######################################### packages: + SCHALTPROGRAMM_AKTIV: !include { file: wp_binary.yaml, vars: { name: "SCHALTPROGRAMM_AKTIV" }} + VERDICHTER: !include { file: wp_binary.yaml, vars: { name: "VERDICHTER" }} + WARMWASSERBEREITUNG: !include { file: wp_binary.yaml, vars: { name: "WARMWASSERBEREITUNG" }} + ELEKTRISCHE_NACHERWAERMUNG: !include { file: wp_binary.yaml, vars: { name: "ELEKTRISCHE_NACHERWAERMUNG" }} + SERVICE: !include { file: wp_binary.yaml, vars: { name: "SERVICE" }} + HEIZEN: !include { file: wp_binary.yaml, vars: { name: "HEIZEN" }} + KUEHLEN: !include { file: wp_binary.yaml, vars: { name: "KUEHLEN" }} + LUEFTUNG: !include { file: wp_binary.yaml, vars: { name: "LUEFTUNG" }} + EVU_SPERRE: !include { file: wp_binary.yaml, vars: { name: "EVU_SPERRE" }} + FILTERWECHSEL_BEIDE: !include { file: wp_binary.yaml, vars: { name: "FILTERWECHSEL_BEIDE" }} + HEIZKREISPUMPE: !include { file: wp_binary.yaml, vars: { name: "HEIZKREISPUMPE" }} + ABTAUEN_VERDAMPFER: !include { file: wp_binary.yaml, vars: { name: "ABTAUEN_VERDAMPFER" }} + FILTERWECHSEL_ABLUFT: !include { file: wp_binary.yaml, vars: { name: "FILTERWECHSEL_ABLUFT" }} + FILTERWECHSEL_ZULUFT: !include { file: wp_binary.yaml, vars: { name: "FILTERWECHSEL_ZULUFT" }} + AUFHEIZPROGRAMM_AKTIV: !include { file: wp_binary.yaml, vars: { name: "AUFHEIZPROGRAMM_AKTIV" }} + SOMMERBETRIEB_AKTIV: !include { file: wp_binary.yaml, vars: { name: "SOMMERBETRIEB_AKTIV" }} + OFEN_KAMIN_AKTIV: !include { file: wp_binary.yaml, vars: { name: "OFEN_KAMIN_AKTIV" }} + WAERMEERTRAG_RUECKGE_SUMME_MWH: !include { file: wp_generic_combined.yaml, vars: { sensor_name: "WAERMEERTRAG_RUECKGE_SUMME_MWH" , scaled_property: "WAERMEERTRAG_RUECKGE_SUM_KWH" , property: "WAERMEERTRAG_RUECKGE_SUM_MWH" , unit: "MWh", accuracy_decimals: "3", icon: "mdi:fire" }} - ABLUFTTEMP: !include { file: wp_temperature.yaml, vars: { property: "ABLUFTTEMP" }} + ABLUFTTEMP: !include { file: wp_temperature.yaml, vars: { property: "ABLUFTTEMP" }} + EINSTELL_SPEICHERSOLLTEMP: !include { file: wp_temperature.yaml, vars: { property: "EINSTELL_SPEICHERSOLLTEMP" }} + SAMMLERISTTEMP: !include { file: wp_temperature.yaml, vars: { property: "SAMMLERISTTEMP" , interval: $interval_medium }} + TAUPUNKT_HK1: !include { file: wp_temperature.yaml, vars: { property: "TAUPUNKT_HK1" , target: "HK1" }} + RAUMSOLLTEMP_I: !include { file: wp_temperature.yaml, vars: { property: "RAUMSOLLTEMP_I" , target: "HK1" }} + RAUMSOLLTEMP_NACHT: !include { file: wp_temperature.yaml, vars: { property: "RAUMSOLLTEMP_NACHT" , target: "HK1" }} + KUEHL_RAUMSOLL_TAG: !include { file: wp_temperature.yaml, vars: { property: "KUEHL_RAUMSOLL_TAG" , target: "HK1" }} LUEFT_STUFE_TAG: !include { file: wp_ventilation.yaml, vars: { property: "LUEFT_STUFE_TAG" }} LUEFT_STUFE_NACHT: !include { file: wp_ventilation.yaml, vars: { property: "LUEFT_STUFE_NACHT" }} @@ -132,7 +276,13 @@ packages: ZULUFT_SOLL: !include { file: wp_generic.yaml, vars: { property: "ZULUFT_SOLL" , interval: $interval_slow , unit: "l/min", icon: "mdi:pump" }} VOLUMENSTROM: !include { file: wp_generic.yaml, vars: { property: "VOLUMENSTROM" , interval: $interval_slow , unit: "l/min", icon: "mdi:pump" }} LAUFZEIT_FILTER: !include { file: wp_generic.yaml, vars: { property: "LAUFZEIT_FILTER" , interval: $interval_once_in_a_while , unit: "%", icon: "mdi:calendar" }} + ANZEIGE_NIEDERDRUCK: !include { file: wp_generic.yaml, vars: { property: "ANZEIGE_NIEDERDRUCK" , accuracy_decimals: "2" }} + PUMPENZYKLEN_MIN_AUSSENT: !include { file: wp_generic.yaml, vars: { property: "PUMPENZYKLEN_MIN_AUSSENT" }} NE_STUFE_WW: !include { file: wp_number.yaml, vars: { property: "NE_STUFE_WW" , min: "0", max: "3" }} + LEISTUNG_AUSLEGUNG_HEIZUNG: !include { file: wp_number.yaml, vars: { property: "LEISTUNG_AUSLEGUNG_HEIZUNG" }} + LEISTUNG_AUSLEGUNG_KUEHLEN: !include { file: wp_number.yaml, vars: { property: "LEISTUNG_AUSLEGUNG_KUEHLEN" }} + PUMPENDREHZAHL_HEIZEN: !include { file: wp_number.yaml, vars: { property: "PUMPENDREHZAHL_HEIZEN" , step: "0.1" }} + HYSTERESE_WW: !include { file: wp_number.yaml, vars: { property: "HYSTERESE_WW" , min: "2.0", max: "10.0", step: "0.1", unit: "°C" }} WAERMEERTRAG_RUECKGE_TAG_SUMME_KWH: !include { file: wp_daily_energy_combined.yaml, vars: { sensor_name: "WAERMEERTRAG_RUECKGE_TAG_SUMME_KWH" , property_wh: "WAERMEERTRAG_RUECKGE_TAG_WH" , property_kwh: "WAERMEERTRAG_RUECKGE_TAG_KWH" }}