diff --git a/src/devices/thermostat.cpp b/src/devices/thermostat.cpp index 3d02420d6..e96637353 100644 --- a/src/devices/thermostat.cpp +++ b/src/devices/thermostat.cpp @@ -31,11 +31,17 @@ Thermostat::Thermostat(uint8_t device_type, uint8_t device_id, uint8_t product_i register_telegram_type(0x0435, "RFTemp", false, MAKE_PF_CB(process_RemoteTemp)); return; } - // remote thermostats with humidity: RC100H remote + // remote thermostats with humidity: RC100H remote, each thermostat is for one hc if (device_id >= 0x38 && device_id <= 0x3F) { - register_telegram_type(0x042B, "RemoteTemp", false, MAKE_PF_CB(process_RemoteTemp)); - register_telegram_type(0x047B, "RemoteHumidity", false, MAKE_PF_CB(process_RemoteHumidity)); - register_telegram_type(0x0273, "RemoteCorrection", true, MAKE_PF_CB(process_RemoteCorrection)); + // reserve_telegram_functions(3); + register_telegram_type(0x042B + device_id - 0x38, "RemoteTemp", false, MAKE_PF_CB(process_RemoteTemp)); + register_telegram_type(0x047B + device_id - 0x38, "RemoteHumidity", false, MAKE_PF_CB(process_RemoteHumidity)); + register_telegram_type(0x0273 + device_id - 0x38, "RemoteCorrection", true, MAKE_PF_CB(process_RemoteCorrection)); + register_telegram_type(0x0A6A + device_id - 0x38, "RemoteBattery", true, MAKE_PF_CB(process_RemoteBattery)); + // maybe fixed type for these telegrams? + // register_telegram_type(0x0273, "RemoteCorrection", true, MAKE_PF_CB(process_RemoteCorrection)); + // register_telegram_type(0x0A6B, "RemoteBattery", true, MAKE_PF_CB(process_RemoteBattery)); + register_device_values(); // register device values for common values (not heating circuit) return; // no values to add } @@ -689,7 +695,7 @@ void Thermostat::process_RemoteTemp(std::shared_ptr telegram) { has_update(telegram, tempsensor1_, 0); } -// 0x47B - for reading humidity from the RC100H remote thermostat (0x38, 0x39, ..) +// 0x47B, ff - for reading humidity from the RC100H remote thermostat (0x38, 0x39, ..) // e.g. "38 10 FF 00 03 7B 08 24 00 4B" void Thermostat::process_RemoteHumidity(std::shared_ptr telegram) { has_update(telegram, dewtemperature_, 0); @@ -697,10 +703,16 @@ void Thermostat::process_RemoteHumidity(std::shared_ptr telegram } // 0x273 - for reading temperaturcorrection from the RC100H remote thermostat (0x38, 0x39, ..) +// Thermostat(0x38) -> Me(0x0B), RemoteCorrection(0x0273), data: 0A 00 void Thermostat::process_RemoteCorrection(std::shared_ptr telegram) { has_update(telegram, ibaCalIntTemperature_, 0); } +// 0xA6A - for reading battery from the RC100H remote thermostat (0x38, 0x39, ..) +void Thermostat::process_RemoteBattery(std::shared_ptr telegram) { + has_update(telegram, battery_, 1); +} + // type 0x0165, ff void Thermostat::process_JunkersSet(std::shared_ptr telegram) { std::shared_ptr hc = heating_circuit(telegram); @@ -1381,7 +1393,7 @@ void Thermostat::process_RC35Timer(std::shared_ptr telegram) { // process_RCTime - type 0x06 - date and time from a thermostat - 14 bytes long void Thermostat::process_RCTime(std::shared_ptr telegram) { - if (telegram->offset > 0 || telegram->message_length < 5) { + if (telegram->offset > 0 || telegram->message_length < 8) { return; } @@ -1389,10 +1401,6 @@ void Thermostat::process_RCTime(std::shared_ptr telegram) { return; // not supported } - if (telegram->message_length < 7) { - return; - } - if ((telegram->message_data[7] & 0x0C) && has_command(&dateTime_)) { // date and time not valid set_datetime("ntp", -1); // set from NTP return; @@ -3448,6 +3456,7 @@ void Thermostat::register_device_values() { FL_(ibaCalIntTemperature), DeviceValueUOM::DEGREES_R, MAKE_CF_CB(set_calinttemp)); + register_device_value(tag, &battery_, DeviceValueType::UINT, DeviceValueNumOp::DV_NUMOP_DIV2, FL_(battery), DeviceValueUOM::PERCENT); return; } diff --git a/src/devices/thermostat.h b/src/devices/thermostat.h index a28d882de..47c552ebf 100644 --- a/src/devices/thermostat.h +++ b/src/devices/thermostat.h @@ -210,6 +210,7 @@ class Thermostat : public EMSdevice { uint8_t floordrytemp_; uint8_t dewtemperature_; uint8_t humidity_; + uint8_t battery_; uint8_t wwExtra1_; // wwExtra active for wwSystem 1 uint8_t wwExtra2_; @@ -401,6 +402,7 @@ class Thermostat : public EMSdevice { void process_RemoteTemp(std::shared_ptr telegram); void process_RemoteHumidity(std::shared_ptr telegram); void process_RemoteCorrection(std::shared_ptr telegram); + void process_RemoteBattery(std::shared_ptr telegram); void process_HPSet(std::shared_ptr telegram); void process_HPMode(std::shared_ptr telegram); diff --git a/src/locale_translations.h b/src/locale_translations.h index 89022f3f4..c8cb83a74 100644 --- a/src/locale_translations.h +++ b/src/locale_translations.h @@ -665,10 +665,10 @@ MAKE_TRANSLATION(roomtempdiff, "roomtempdiff", "room temp difference", "Raumtemp MAKE_TRANSLATION(hpminflowtemp, "hpminflowtemp", "HP min. flow temp.", "WP minimale Vorlauftemperatur", "Minimale aanvoertemperatuur WP", "", "", "", "", "yüksek güç minimum akış sıcaklığı", "temperatura minima di mandata") // TODO translate MAKE_TRANSLATION(hpcooling, "cooling", "cooling", "Kühlen", "Koelen", "Kyler", "chłodzenie", "kjøling", "refroidissement", "soğuma", "raffreddamento") -// heatpump +// heatpump and RC100H MAKE_TRANSLATION(airHumidity, "airhumidity", "relative air humidity", "relative Luftfeuchte", "Relatieve luchtvochtigheid", "Relativ Luftfuktighet", "wilgotność względna w pomieszczeniu", "luftfuktighet", "humidité relative air", "havadaki bağıl nem", "umidità relativa aria") MAKE_TRANSLATION(dewTemperature, "dewtemperature", "dew point temperature", "Taupunkttemperatur", "Dauwpunttemperatuur", "Daggpunkt", "punkt rosy w pomieszczeniu", "duggtemperatur", "température point rosée", "çiğ noktası sıcaklığı", "temperatura del punto di rugiada") - +MAKE_TRANSLATION(battery, "battery", "battery", "Batterie", "", "", "", "", "", "", "") // mixer MAKE_TRANSLATION(flowSetTemp, "flowsettemp", "setpoint flow temperature", "Sollwert Vorlauftemperatur", "Streefwaarde aanvoertemperatuur", "Vald flödestemperatur", "zadana temperatura zasilania", "valgt turtemperatur", "consigne température flux", "akış sıcaklığı ayarı", "Setpoint temperatura di mandata") MAKE_TRANSLATION(flowTempHc, "flowtemphc", "flow temperature (TC1)", "Vorlauftemperatur HK (TC1)", "Aanvoertemperatuut circuit (TC1)", "Flödestemperatur (TC1)", "temperatura zasilania (TC1)", "turtemperatur (TC1)", "température flux (TC1)", "akış sıcaklığı (TC1)", "temperatura di mandata (TC1)")