From 9d80c2cea7956adcf4e9911a5c62f3075d7a1f97 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Sat, 24 Dec 2022 15:45:11 +0100 Subject: [PATCH] add generic controller without product id #835 --- src/emsdevice.h | 34 +++++++++++++++++++--------------- src/emsesp.cpp | 8 ++++++-- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/src/emsdevice.h b/src/emsdevice.h index fa571c9eb..a826e9383 100644 --- a/src/emsdevice.h +++ b/src/emsdevice.h @@ -346,21 +346,25 @@ class EMSdevice { }; // static device IDs - static constexpr uint8_t EMS_DEVICE_ID_BOILER = 0x08; // fixed device_id for Master Boiler/UBA - static constexpr uint8_t EMS_DEVICE_ID_BOILER_1 = 0x70; // fixed device_id for 1st. Cascade Boiler/UBA - static constexpr uint8_t EMS_DEVICE_ID_BOILER_F = 0x7F; // fixed device_id for last Cascade Boiler/UBA - static constexpr uint8_t EMS_DEVICE_ID_AM200 = 0x60; // fixed device_id for alternative Heating AM200 - static constexpr uint8_t EMS_DEVICE_ID_RS232 = 0x04; - static constexpr uint8_t EMS_DEVICE_ID_TERMINAL = 0x0A; - static constexpr uint8_t EMS_DEVICE_ID_SERVICEKEY = 0x0B; - static constexpr uint8_t EMS_DEVICE_ID_CASCADE = 0x0C; - static constexpr uint8_t EMS_DEVICE_ID_EASYCOM = 0x0D; - static constexpr uint8_t EMS_DEVICE_ID_CONVERTER = 0x0E; - static constexpr uint8_t EMS_DEVICE_ID_CLOCK = 0x0F; - static constexpr uint8_t EMS_DEVICE_ID_SWITCH = 0x11; // Switch WM10 - static constexpr uint8_t EMS_DEVICE_ID_ERROR = 0x12; // Error module WM10 - static constexpr uint8_t EMS_DEVICE_ID_PUMP = 0x15; // pump module PM10 - static constexpr uint8_t EMS_DEVICE_ID_MODEM = 0x48; + static constexpr uint8_t EMS_DEVICE_ID_BOILER = 0x08; // fixed device_id for Master Boiler/UBA + static constexpr uint8_t EMS_DEVICE_ID_BOILER_1 = 0x70; // fixed device_id for 1st. Cascade Boiler/UBA + static constexpr uint8_t EMS_DEVICE_ID_BOILER_F = 0x7F; // fixed device_id for last Cascade Boiler/UBA + static constexpr uint8_t EMS_DEVICE_ID_AM200 = 0x60; // fixed device_id for alternative Heating AM200 + static constexpr uint8_t EMS_DEVICE_ID_CONTROLLER = 0x09; + static constexpr uint8_t EMS_DEVICE_ID_RS232 = 0x04; + static constexpr uint8_t EMS_DEVICE_ID_TERMINAL = 0x0A; + static constexpr uint8_t EMS_DEVICE_ID_SERVICEKEY = 0x0B; + static constexpr uint8_t EMS_DEVICE_ID_CASCADE = 0x0C; + static constexpr uint8_t EMS_DEVICE_ID_EASYCOM = 0x0D; + static constexpr uint8_t EMS_DEVICE_ID_CONVERTER = 0x0E; + static constexpr uint8_t EMS_DEVICE_ID_CLOCK = 0x0F; + static constexpr uint8_t EMS_DEVICE_ID_SWITCH = 0x11; // Switch WM10 + static constexpr uint8_t EMS_DEVICE_ID_ALERT = 0x12; // Error module EM10 + static constexpr uint8_t EMS_DEVICE_ID_PUMP = 0x15; // Pump module PM10 + static constexpr uint8_t EMS_DEVICE_ID_MODEM = 0x48; + static constexpr uint8_t EMS_DEVICE_ID_RFSENSOR = 0x40; // RF sensor only sending, no reply + static constexpr uint8_t EMS_DEVICE_ID_RFBASE = 0x50; + static constexpr uint8_t EMS_DEVICE_ID_ROOMTHERMOSTAT = 0x17; //TADO using this with no version reply // generic type IDs static constexpr uint16_t EMS_TYPE_VERSION = 0x02; // type ID for Version information. Generic across all EMS devices. diff --git a/src/emsesp.cpp b/src/emsesp.cpp index fee5d5bc4..dc8eafb58 100644 --- a/src/emsesp.cpp +++ b/src/emsesp.cpp @@ -992,11 +992,11 @@ bool EMSESP::add_device(const uint8_t device_id, const uint8_t product_id, const // empty reply to version, read a generic device from database if (product_id == 0) { // check for known device IDs - if (device_id == 0x40) { + if (device_id == EMSdevice::EMS_DEVICE_ID_RFSENSOR) { // see: https://github.com/emsesp/EMS-ESP32/issues/103#issuecomment-911717342 and https://github.com/emsesp/EMS-ESP32/issues/624 name = "rf room temperature sensor"; device_type = DeviceType::THERMOSTAT; - } else if (device_id == 0x17) { + } else if (device_id == EMSdevice::EMS_DEVICE_ID_ROOMTHERMOSTAT) { name = "generic thermostat"; device_type = DeviceType::THERMOSTAT; flags = DeviceFlags::EMS_DEVICE_FLAG_RC10 | DeviceFlags::EMS_DEVICE_FLAG_NO_WRITE; @@ -1020,6 +1020,10 @@ bool EMSESP::add_device(const uint8_t device_id, const uint8_t product_id, const name = "converter"; // generic } else if (device_id == EMSdevice::EMS_DEVICE_ID_CLOCK) { name = "clock"; // generic + device_type = DeviceType::CONTROLLER; + } else if (device_id == EMSdevice::EMS_DEVICE_ID_CONTROLLER) { + name = "generic controller"; + device_type = DeviceType::CONTROLLER; } else if (device_id == EMSdevice::EMS_DEVICE_ID_BOILER) { name = "generic boiler"; device_type = DeviceType::BOILER;