diff --git a/src/devices/generic.cpp b/src/devices/generic.cpp index 9bf74fbad..5adaed38d 100644 --- a/src/devices/generic.cpp +++ b/src/devices/generic.cpp @@ -26,6 +26,12 @@ uuid::log::Logger Generic::logger_{F_(generic), uuid::log::Facility::CONSOLE}; Generic::Generic(uint8_t device_type, uint8_t device_id, uint8_t product_id, const std::string & version, const std::string & name, uint8_t flags, uint8_t brand) : EMSdevice(device_type, device_id, product_id, version, name, flags, brand) { + + // RF-Sensor 0x40 sending temperature in telegram 0x435, see https://github.com/emsesp/EMS-ESP32/issues/103 + if (device_id == 0x40) { + register_telegram_type(0x435, F("RFSensorMessage"), false, MAKE_PF_CB(process_RFSensorMessage)); + register_device_value(TAG_NONE, &rfTemp_, DeviceValueType::SHORT, FL_(div10), FL_(RFTemp), DeviceValueUOM::DEGREES); + } } // publish HA config @@ -33,4 +39,9 @@ bool Generic::publish_ha_config() { return true; } +// type 0x435 rf remote sensor +void Generic::process_RFSensorMessage(std::shared_ptr telegram) { + has_update(telegram->read_value(rfTemp_, 0)); // is * 10 +} + } // namespace emsesp \ No newline at end of file diff --git a/src/devices/generic.h b/src/devices/generic.h index 9d25a72de..7170bedbf 100644 --- a/src/devices/generic.h +++ b/src/devices/generic.h @@ -31,6 +31,10 @@ class Generic : public EMSdevice { private: static uuid::log::Logger logger_; + + int16_t rfTemp_; + + void process_RFSensorMessage(std::shared_ptr telegram); }; } // namespace emsesp diff --git a/src/locale_EN.h b/src/locale_EN.h index 891d62028..bf272d21b 100644 --- a/src/locale_EN.h +++ b/src/locale_EN.h @@ -659,3 +659,6 @@ MAKE_PSTR_LIST(collector1Type, F("collector1type"), F("collector 1 type")) // switch MAKE_PSTR_LIST(activated, F("activated"), F("activated")) MAKE_PSTR_LIST(status, F("status"), F("status")) + +// RF sensor, id 0x40, telegram 0x435 +MAKE_PSTR_LIST(RFTemp, F("rftemp"), F("RF room temperature sensor"));