From 4e652541bce1a97c5fec5af4200599a7bfe6112c Mon Sep 17 00:00:00 2001 From: SwoopX Date: Wed, 27 Dec 2023 21:47:54 +0100 Subject: [PATCH] Remove deprecated Danfoss code (#7472) --- CMakeLists.txt | 1 - bindings.cpp | 97 +------------------------ database.cpp | 16 ----- de_web.pro | 1 - de_web_plugin.cpp | 27 +------ de_web_plugin_private.h | 1 - diagnostics.cpp | 111 ---------------------------- rest_sensors.cpp | 59 ++------------- thermostat.cpp | 124 -------------------------------- thermostat.h | 5 -- thermostat_ui_configuration.cpp | 18 ----- thermostat_ui_configuration.h | 1 - 12 files changed, 7 insertions(+), 454 deletions(-) delete mode 100644 diagnostics.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index d349d83e29..286c5669e2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -161,7 +161,6 @@ add_library(${PROJECT_NAME} SHARED device_tick.cpp de_web_plugin.cpp de_web_widget.cpp - diagnostics.cpp discovery.cpp electrical_measurement.cpp event.cpp diff --git a/bindings.cpp b/bindings.cpp index 4404f3bf21..2210318201 100644 --- a/bindings.cpp +++ b/bindings.cpp @@ -1368,48 +1368,6 @@ bool DeRestPluginPrivate::sendConfigureReportingRequest(BindingTask &bt) return sendConfigureReportingRequest(bt, {rq, rq2, rq3, rq4, rq5}); } - else if (modelId == QLatin1String("TRV001") || // Hive TRV - modelId == QLatin1String("eT093WRO")) // POPP smart thermostat - { - rq.dataType = deCONZ::Zcl16BitInt; - rq.attributeId = 0x0000; // local temperature - rq.minInterval = 60; - rq.maxInterval = 3600; - rq.reportableChange16bit = 50; - - ConfigureReportingRequest rq2; - rq2.dataType = deCONZ::Zcl8BitUint; - rq2.attributeId = 0x0008; // Pi heating demand - rq2.minInterval = 60; - rq2.maxInterval = 43200; - rq2.reportableChange8bit = 1; - - ConfigureReportingRequest rq3; - rq3.dataType = deCONZ::Zcl16BitInt; - rq3.attributeId = 0x0012; // Occupied heating setpoint - rq3.minInterval = 1; - rq3.maxInterval = 43200; - rq3.reportableChange16bit = 1; - - ConfigureReportingRequest rq4; - rq4.dataType = deCONZ::Zcl8BitEnum; - rq4.attributeId = 0x4000; // eTRV Open Window detection - rq4.minInterval = 1; - rq4.maxInterval = 43200; - rq4.reportableChange8bit = 0xff; - rq4.manufacturerCode = VENDOR_DANFOSS; - - ConfigureReportingRequest rq5; - rq5.dataType = deCONZ::ZclBoolean; - rq5.attributeId = 0x4012; // Mounting mode active - rq5.minInterval = 1; - rq5.maxInterval = 43200; - rq5.reportableChange8bit = 0xff; - rq5.manufacturerCode = VENDOR_DANFOSS; - - return sendConfigureReportingRequest(bt, {rq, rq2, rq3}) || // Use OR because of manuf. specific attributes - sendConfigureReportingRequest(bt, {rq4, rq5}); - } else if (sensor && (modelId == QLatin1String("0x8020") || // Danfoss RT24V Display thermostat modelId == QLatin1String("0x8021") || // Danfoss RT24V Display thermostat with floor sensor modelId == QLatin1String("0x8030") || // Danfoss RTbattery Display thermostat @@ -1598,27 +1556,7 @@ bool DeRestPluginPrivate::sendConfigureReportingRequest(BindingTask &bt) } else if (bt.binding.clusterId == THERMOSTAT_UI_CONFIGURATION_CLUSTER_ID) { - if (modelId == QLatin1String("TRV001") || // Hive TRV - modelId == QLatin1String("eT093WRO")) // POPP smart thermostat - { - rq.dataType = deCONZ::Zcl8BitEnum; - rq.attributeId = 0x0001; // Keypad Lockout - rq.minInterval = 1; - rq.maxInterval = 43200; - rq.reportableChange8bit = 0xff; - - ConfigureReportingRequest rq2; - rq2.dataType = deCONZ::Zcl8BitEnum; - rq2.attributeId = 0x4000; // Viewing Direction - rq2.minInterval = 1; - rq2.maxInterval = 43200; - rq2.reportableChange8bit = 0xff; - rq2.manufacturerCode = VENDOR_DANFOSS; - - return sendConfigureReportingRequest(bt, {rq}) || // Use OR because of manuf. specific attributes - sendConfigureReportingRequest(bt, {rq2}); - } - else if (modelId == QLatin1String("SORB") || // Stelpro Orleans Fan + if (modelId == QLatin1String("SORB") || // Stelpro Orleans Fan modelId == QLatin1String("TH1300ZB") || // Sinope thermostat modelId == QLatin1String("PR412C") || // Owon thermostat modelId == QLatin1String("iTRV") || // Drayton Wiser Radiator Thermostat @@ -1634,20 +1572,6 @@ bool DeRestPluginPrivate::sendConfigureReportingRequest(BindingTask &bt) return sendConfigureReportingRequest(bt, {rq}); } } - else if (bt.binding.clusterId == DIAGNOSTICS_CLUSTER_ID) - { - if (modelId == QLatin1String("TRV001") || // Hive TRV - modelId == QLatin1String("eT093WRO")) // POPP smart thermostat - { - rq.dataType = deCONZ::Zcl16BitBitMap; - rq.attributeId = 0x4000; // SW error code - rq.minInterval = 1; - rq.maxInterval = 43200; - rq.reportableChange16bit = 0xffff; - rq.manufacturerCode = VENDOR_DANFOSS; - return sendConfigureReportingRequest(bt, {rq}); - } - } else if (bt.binding.clusterId == FAN_CONTROL_CLUSTER_ID) { if (modelId.startsWith(QLatin1String("3157100"))) // Centralite pearl @@ -1713,9 +1637,7 @@ bool DeRestPluginPrivate::sendConfigureReportingRequest(BindingTask &bt) rq.maxInterval = 7200; // value used by Hue bridge rq.reportableChange8bit = 0; // value used by Hue bridge } - else if (modelId == QLatin1String("eT093WRO") || // POPP smart thermostat - modelId == QLatin1String("TRV001") || // Hive TRV - modelId == QLatin1String("0x8020") || // Danfoss RT24V Display thermostat + else if (modelId == QLatin1String("0x8020") || // Danfoss RT24V Display thermostat modelId == QLatin1String("0x8021") || // Danfoss RT24V Display thermostat with floor sensor modelId == QLatin1String("0x8030") || // Danfoss RTbattery Display thermostat modelId == QLatin1String("0x8031") || // Danfoss RTbattery Display thermostat with infrared @@ -2784,7 +2706,6 @@ bool DeRestPluginPrivate::checkSensorBindingsForAttributeReporting(Sensor *senso sensor->modelId() == QLatin1String("SLR1b") || sensor->modelId() == QLatin1String("SLT2") || sensor->modelId() == QLatin1String("SLT3") || - sensor->modelId() == QLatin1String("TRV001") || // Sengled sensor->modelId().startsWith(QLatin1String("E13-")) || sensor->modelId().startsWith(QLatin1String("E1D-")) || @@ -2862,8 +2783,6 @@ bool DeRestPluginPrivate::checkSensorBindingsForAttributeReporting(Sensor *senso sensor->modelId() == QLatin1String("0x8031") || sensor->modelId() == QLatin1String("0x8034") || sensor->modelId() == QLatin1String("0x8035") || - // POPP - sensor->modelId() == QLatin1String("eT093WRO") || // Swann sensor->modelId() == QLatin1String("SWO-MOS1PA") || // LIDL @@ -3105,18 +3024,6 @@ bool DeRestPluginPrivate::checkSensorBindingsForAttributeReporting(Sensor *senso { val = sensor->getZclValue(*i, 0x0001); // Keypad lockout } - else if (*i == DIAGNOSTICS_CLUSTER_ID) - { - if (sensor->modelId() == QLatin1String("TRV001") || // Hive TRV - sensor->modelId() == QLatin1String("eT093WRO")) // POPP smart thermostat - { - val = sensor->getZclValue(*i, 0x4000); // SW error code - } - else - { - continue; - } - } else if (*i == SAMJIN_CLUSTER_ID) { val = sensor->getZclValue(*i, 0x0012); // Acceleration X diff --git a/database.cpp b/database.cpp index 05db5e9c5a..58c95126e4 100644 --- a/database.cpp +++ b/database.cpp @@ -3959,22 +3959,6 @@ static int sqliteLoadAllSensorsCallback(void *user, int ncols, char **colval , c sensor.addItem(DataTypeString, RConfigMode); sensor.addItem(DataTypeString, RConfigFanMode); } - else if (sensor.modelId() == QLatin1String("TRV001") || // Hive TRV - sensor.modelId() == QLatin1String("eT093WRO")) // POPP smart thermostat - { - sensor.addItem(DataTypeUInt8, RStateValve); - sensor.addItem(DataTypeString, RStateWindowOpen); - sensor.addItem(DataTypeBool, RStateMountingModeActive)->setValue(false); - sensor.addItem(DataTypeString, RStateErrorCode); - sensor.addItem(DataTypeBool, RConfigDisplayFlipped)->setValue(false); - sensor.addItem(DataTypeBool, RConfigLocked)->setValue(false); - sensor.addItem(DataTypeBool, RConfigMountingMode)->setValue(false); - // Supported with Danfoss firmware version 1.08 - sensor.addItem(DataTypeBool, RConfigScheduleOn)->setValue(false); - sensor.addItem(DataTypeString, RConfigSchedule); - sensor.addItem(DataTypeInt16, RConfigExternalTemperatureSensor)->setValue(0); - sensor.addItem(DataTypeBool, RConfigExternalWindowOpen)->setValue(false); - } else if (sensor.modelId() == QLatin1String("iTRV")) // Drayton Wiser Radiator Thermostat { sensor.addItem(DataTypeUInt8, RStateValve); diff --git a/de_web.pro b/de_web.pro index ae0d5f9fc2..aec7e3ecf2 100644 --- a/de_web.pro +++ b/de_web.pro @@ -209,7 +209,6 @@ SOURCES = air_quality.cpp \ device_js/device_js_wrappers.cpp \ device_js/duktape.c \ device_tick.cpp \ - diagnostics.cpp \ discovery.cpp \ de_web_plugin.cpp \ de_web_widget.cpp \ diff --git a/de_web_plugin.cpp b/de_web_plugin.cpp index 0ea7d855e7..7e58ff764d 100644 --- a/de_web_plugin.cpp +++ b/de_web_plugin.cpp @@ -451,7 +451,6 @@ static const SupportedDevice supportedDevices[] = { { VENDOR_ALERTME, "SLR2b", computimeMacPrefix }, // Hive Heating Receiver 2 channel second version { VENDOR_ALERTME, "SLT2", computimeMacPrefix }, // Hive thermostat { VENDOR_ALERTME, "SLT3", computimeMacPrefix }, // Hive thermostat - { VENDOR_DANFOSS, "TRV001", silabs2MacPrefix }, // Hive thermostat (From Danfoss) { VENDOR_SUNRICHER, "4512705", silabs2MacPrefix }, // Namron remote control { VENDOR_SUNRICHER, "4512726", silabs2MacPrefix }, // Namron rotary switch { VENDOR_SUNRICHER, "S57003", silabs2MacPrefix }, // SLC 4-ch remote controller @@ -484,7 +483,6 @@ static const SupportedDevice supportedDevices[] = { { VENDOR_SCHNEIDER, "iTRV", silabs3MacPrefix }, // Drayton Wiser Radiator Thermostat { VENDOR_SCHNEIDER, "CCT593011_AS", emberMacPrefix }, // LK Wiser Temperature and Humidity Sensor { VENDOR_SCHNEIDER, "CCT595011_AS", emberMacPrefix }, // LK Wiser Motion Sensor - { VENDOR_DANFOSS, "eT093WRO", silabs5MacPrefix }, // POPP Smart Thermostat { VENDOR_DANFOSS, "0x8020", silabs6MacPrefix }, // Danfoss RT24V Display thermostat { VENDOR_DANFOSS, "0x8021", silabs6MacPrefix }, // Danfoss RT24V Display thermostat with floor sensor { VENDOR_DANFOSS, "0x8030", silabs6MacPrefix }, // Danfoss RTbattery Display thermostat @@ -1313,10 +1311,6 @@ void DeRestPluginPrivate::apsdeDataIndication(const deCONZ::ApsDataIndication &i if (!DEV_TestStrict() && !devManaged) { handleThermostatUiConfigurationClusterIndication(ind, zclFrame); } break; - case DIAGNOSTICS_CLUSTER_ID: - if (!DEV_TestStrict() && !devManaged) { handleDiagnosticsClusterIndication(ind, zclFrame); } - break; - case IDENTIFY_CLUSTER_ID: handleIdentifyClusterIndication(ind, zclFrame); break; @@ -6294,8 +6288,7 @@ void DeRestPluginPrivate::addSensorNode(const deCONZ::Node *node, const deCONZ:: case TIME_CLUSTER_ID: { // Many Xiaomi devices advertise non-functional Time cluster, so better use whitelist. - if (modelId == QLatin1String("Thermostat") || // eCozy - modelId == QLatin1String("eT093WRO")) // POPP smart thermostat + if (modelId == QLatin1String("Thermostat")) // eCozy { fpTimeSensor.inClusters.push_back(ci->id()); } @@ -7541,22 +7534,6 @@ void DeRestPluginPrivate::addSensorNode(const deCONZ::Node *node, const SensorFi sensorNode.addItem(DataTypeString, RConfigMode); sensorNode.addItem(DataTypeString, RConfigFanMode); } - else if (modelId == QLatin1String("TRV001") || // Hive TRV - modelId == QLatin1String("eT093WRO")) // POPP smart thermostat - { - sensorNode.addItem(DataTypeUInt8, RStateValve); - sensorNode.addItem(DataTypeString, RStateWindowOpen); - sensorNode.addItem(DataTypeBool, RStateMountingModeActive)->setValue(false); - sensorNode.addItem(DataTypeString, RStateErrorCode); - sensorNode.addItem(DataTypeBool, RConfigDisplayFlipped)->setValue(false); - sensorNode.addItem(DataTypeBool, RConfigLocked)->setValue(false); - sensorNode.addItem(DataTypeBool, RConfigMountingMode)->setValue(false); - // Supported with Danfoss firmware version 1.08 - sensorNode.addItem(DataTypeBool, RConfigScheduleOn)->setValue(false); - sensorNode.addItem(DataTypeString, RConfigSchedule); - sensorNode.addItem(DataTypeInt16, RConfigExternalTemperatureSensor)->setValue(0); - sensorNode.addItem(DataTypeBool, RConfigExternalWindowOpen)->setValue(false); - } else if (modelId == QLatin1String("PR412C")) // OWON PCT502 Thermostat { sensorNode.addItem(DataTypeBool, RConfigLocked)->setValue(false); @@ -15583,10 +15560,8 @@ void DeRestPlugin::idleTimerFired() sensorNode->modelId().startsWith(QLatin1String("SLT3")) || // Hive Active Heating Thermostat sensorNode->modelId().startsWith(QLatin1String("SLR2")) || // Hive Active Heating Receiver 2 channel sensorNode->modelId().startsWith(QLatin1String("SLR1b")) || // Hive Active Heating Receiver 1 channel - sensorNode->modelId().startsWith(QLatin1String("TRV001")) || // Hive TRV sensorNode->modelId().startsWith(QLatin1String("TH112")) || // Sinope devices sensorNode->modelId().startsWith(QLatin1String("TH1300ZB")) || // Sinope devices - sensorNode->modelId().startsWith(QLatin1String("eT093WRO")) || // POPP smart thermostat sensorNode->modelId().startsWith(QLatin1String("0x8020")) || // Danfoss RT24V Display thermostat sensorNode->modelId().startsWith(QLatin1String("0x8021")) || // Danfoss RT24V Display thermostat with floor sensor sensorNode->modelId().startsWith(QLatin1String("0x8030")) || // Danfoss RTbattery Display thermostat diff --git a/de_web_plugin_private.h b/de_web_plugin_private.h index 01543a56bc..92c00059ac 100644 --- a/de_web_plugin_private.h +++ b/de_web_plugin_private.h @@ -1596,7 +1596,6 @@ public Q_SLOTS: void handleThermostatUiConfigurationClusterIndication(const deCONZ::ApsDataIndication &ind, deCONZ::ZclFrame &zclFrame); void handleAirQualityClusterIndication(const deCONZ::ApsDataIndication &ind, deCONZ::ZclFrame &zclFrame); void handleTimeClusterIndication(const deCONZ::ApsDataIndication &ind, deCONZ::ZclFrame &zclFrame); - void handleDiagnosticsClusterIndication(const deCONZ::ApsDataIndication &ind, deCONZ::ZclFrame &zclFrame); void handleFanControlClusterIndication(const deCONZ::ApsDataIndication &ind, deCONZ::ZclFrame &zclFrame); void handleIdentifyClusterIndication(const deCONZ::ApsDataIndication &ind, const deCONZ::ZclFrame &zclFrame); void sendTimeClusterResponse(const deCONZ::ApsDataIndication &ind, deCONZ::ZclFrame &zclFrame); diff --git a/diagnostics.cpp b/diagnostics.cpp deleted file mode 100644 index 99f3c3070b..0000000000 --- a/diagnostics.cpp +++ /dev/null @@ -1,111 +0,0 @@ -#include "de_web_plugin.h" -#include "de_web_plugin_private.h" - -/*! Handle packets related to the ZCL diagnostics cluster. - \param ind the APS level data indication containing the ZCL packet - \param zclFrame the actual ZCL frame which holds the Thermostat cluster command or attribute - */ -void DeRestPluginPrivate::handleDiagnosticsClusterIndication(const deCONZ::ApsDataIndication &ind, deCONZ::ZclFrame &zclFrame) -{ - Sensor *sensor = getSensorNodeForAddressAndEndpoint(ind.srcAddress(), ind.srcEndpoint(), QLatin1String("ZHAThermostat")); - - if (!sensor) - { - DBG_Printf(DBG_INFO, "No sensor found for 0x%016llX, endpoint: 0x%02X\n", ind.srcAddress().ext(), ind.srcEndpoint()); - return; - } - - QDataStream stream(zclFrame.payload()); - stream.setByteOrder(QDataStream::LittleEndian); - - bool isReadAttr = false; - bool isReporting = false; - if (zclFrame.isProfileWideCommand() && zclFrame.commandId() == deCONZ::ZclReadAttributesResponseId) - { - isReadAttr = true; - } - if (zclFrame.isProfileWideCommand() && zclFrame.commandId() == deCONZ::ZclReportAttributesId) - { - isReporting = true; - } - - // Read ZCL reporting and ZCL Read Attributes Response - if (isReadAttr || isReporting) - { - const NodeValue::UpdateType updateType = isReadAttr ? NodeValue::UpdateByZclRead : NodeValue::UpdateByZclReport; - - bool configUpdated = false; - bool stateUpdated = false; - - while (!stream.atEnd()) - { - quint16 attrId; - quint8 attrTypeId; - - stream >> attrId; - if (isReadAttr) - { - quint8 status; - stream >> status; // Read Attribute Response status - if (status != deCONZ::ZclSuccessStatus) - { - continue; - } - } - stream >> attrTypeId; - - deCONZ::ZclAttribute attr(attrId, attrTypeId, QLatin1String(""), deCONZ::ZclRead, false); - - if (!attr.readFromStream(stream)) - { - continue; - } - - ResourceItem *item = nullptr; - - switch (attrId) - { - case 0x4000: // SW error code - { - if (sensor->modelId() == QLatin1String("TRV001") || sensor->modelId() == QLatin1String("eT093WRO")) - { - quint16 value = attr.numericValue().u16; - QString errorCode = QString("%1").arg(value, 4, 16, QLatin1Char('0')).toUpper(); - - if (errorCode == QLatin1String("0A00")) { errorCode = "none"; } // Assuming "0A00" means no error - item = sensor->item(RStateErrorCode); - - if (item && updateType == NodeValue::UpdateByZclReport) - { - stateUpdated = true; - } - if (item && item->toString() != errorCode) - { - item->setValue(errorCode); - enqueueEvent(Event(RSensors, RStateErrorCode, sensor->id(), item)); - stateUpdated = true; - } - } - sensor->setZclValue(updateType, ind.srcEndpoint(), DIAGNOSTICS_CLUSTER_ID, attrId, attr.numericValue()); - } - break; - - default: - break; - } - } - - if (stateUpdated) - { - sensor->updateStateTimestamp(); - enqueueEvent(Event(RSensors, RStateLastUpdated, sensor->id())); - } - - if (configUpdated || stateUpdated) - { - updateSensorEtag(&*sensor); - sensor->setNeedSaveDatabase(true); - queSaveDb(DB_SENSORS, DB_SHORT_SAVE_DELAY); - } - } -} diff --git a/rest_sensors.cpp b/rest_sensors.cpp index d801733bae..50d2e4ffbf 100644 --- a/rest_sensors.cpp +++ b/rest_sensors.cpp @@ -1102,16 +1102,6 @@ int DeRestPluginPrivate::changeSensorConfig(const ApiRequest &req, ApiResponse & } } } - else if (sensor->modelId() == QLatin1String("TRV001") || sensor->modelId() == QLatin1String("eT093WRO")) - { - if (data.integer < -25) { data.integer = -25; } - if (data.integer > 25) { data.integer = 25; } - - if (addTaskThermostatReadWriteAttribute(task, deCONZ::ZclWriteAttributesId, VENDOR_DANFOSS, THERM_ATTRID_REGULATION_SETPOINT_OFFSET, deCONZ::Zcl8BitInt, data.integer)) - { - updated = true; - } - } else if (sensor->type() == "ZHAThermostat") { if (!devManaged) @@ -1186,14 +1176,6 @@ int DeRestPluginPrivate::changeSensorConfig(const ApiRequest &req, ApiResponse & updated = true; } } - else if (sensor->modelId() == QLatin1String("eTRV0100") || sensor->modelId() == QLatin1String("TRV001") || - sensor->modelId() == QLatin1String("eT093WRO") || sensor->modelId() == QLatin1String("eTRV0103")) - { - if (addTaskThermostatCmd(task, VENDOR_DANFOSS, 0x40, data.integer, 0)) - { - updated = true; - } - } else if (R_GetProductId(sensor) == QLatin1String("Tuya_THD HY369 TRV") || R_GetProductId(sensor) == QLatin1String("Tuya_THD HY368 TRV") || R_GetProductId(sensor) == QLatin1String("Tuya_THD GS361A-H04 TRV") || @@ -1704,17 +1686,7 @@ int DeRestPluginPrivate::changeSensorConfig(const ApiRequest &req, ApiResponse & } else if (rid.suffix == RConfigDisplayFlipped) // Boolean { - if (sensor->modelId() == QLatin1String("TRV001") || - sensor->modelId() == QLatin1String("eT093WRO")) - { - data.uinteger = data.boolean; // Use integer representation - - if (addTaskThermostatUiConfigurationReadWriteAttribute(task, deCONZ::ZclWriteAttributesId, THERM_UI_ATTRID_VIEWING_DIRECTION, deCONZ::Zcl8BitEnum, data.uinteger, VENDOR_DANFOSS)) - { - updated = true; - } - } - else if (sensor->modelId().startsWith(QLatin1String("SPZB"))) // Eurotronic Spirit + if (sensor->modelId().startsWith(QLatin1String("SPZB"))) // Eurotronic Spirit { if (data.boolean) { hostFlags |= 0x000002; } // set flipped else { hostFlags &= 0xffffed; } // clear flipped, clear disable off @@ -1734,16 +1706,7 @@ int DeRestPluginPrivate::changeSensorConfig(const ApiRequest &req, ApiResponse & } else if (rid.suffix == RConfigMountingMode) // Boolean { - if (!devManaged) - { - data.uinteger = data.boolean; // Use integer representation - - if (addTaskThermostatReadWriteAttribute(task, deCONZ::ZclWriteAttributesId, VENDOR_DANFOSS, THERM_ATTRID_MOUNTING_MODE_CONTROL, deCONZ::Zcl16BitInt, data.uinteger)) - { - updated = true; - } - } - else if (devManaged && rsub) + if (devManaged && rsub) { change.addTargetValue(rid.suffix, data.boolean); rsub->addStateChange(change); @@ -1752,14 +1715,7 @@ int DeRestPluginPrivate::changeSensorConfig(const ApiRequest &req, ApiResponse & } else if (rid.suffix == RConfigExternalTemperatureSensor) // Signed integer { - if (!devManaged) - { - if (addTaskThermostatReadWriteAttribute(task, deCONZ::ZclWriteAttributesId, VENDOR_DANFOSS, THERM_ATTRID_EXTERNAL_MEASUREMENT, deCONZ::Zcl16BitInt, data.integer)) - { - updated = true; - } - } - else if (devManaged && rsub) + if (devManaged && rsub) { change.addTargetValue(rid.suffix, data.integer); rsub->addStateChange(change); @@ -1768,14 +1724,7 @@ int DeRestPluginPrivate::changeSensorConfig(const ApiRequest &req, ApiResponse & } else if (rid.suffix == RConfigExternalWindowOpen) // Boolean { - if (!devManaged) - { - if (addTaskThermostatReadWriteAttribute(task, deCONZ::ZclWriteAttributesId, VENDOR_DANFOSS, THERM_ATTRID_EXTERNAL_OPEN_WINDOW_DETECTED, deCONZ::ZclBoolean, data.boolean)) - { - updated = true; - } - } - else if (devManaged && rsub) + if (devManaged && rsub) { change.addTargetValue(rid.suffix, data.boolean); rsub->addStateChange(change); diff --git a/thermostat.cpp b/thermostat.cpp index 9678fe8c01..c0707320eb 100644 --- a/thermostat.cpp +++ b/thermostat.cpp @@ -125,9 +125,6 @@ const std::array RConfigControlSequenceValues = { { {1, COOLING const std::array RConfigModeValuesEurotronic = { { {QLatin1String("off")}, {QLatin1String("heat")}, {QLatin1String("auto")} } }; -const std::array RStateWindowOpenValuesDanfoss = { { {QLatin1String("Quarantine"), 0}, {QLatin1String("Closed"), 1}, {QLatin1String("Hold"), 2}, - {QLatin1String("Open"), 3}, {QLatin1String("Open (external), closed (internal)"), 4} } }; - /*! Covert Zigbee weekdays bitmap to ISO or v.v. */ static quint8 convertWeekdayBitmap(const quint8 weekdayBitmap) @@ -432,8 +429,6 @@ void DeRestPluginPrivate::handleThermostatClusterIndication(const deCONZ::ApsDat case 0x0008: // Pi Heating Demand { if (sensor->modelId().startsWith(QLatin1String("SPZB")) || // Eurotronic Spirit - sensor->modelId() == QLatin1String("eT093WRO") || // POPP smart thermostat - sensor->modelId() == QLatin1String("TRV001") || // Hive TRV sensor->modelId() == QLatin1String("Thermostat")) // eCozy { quint8 valve = attr.numericValue().u8; @@ -823,29 +818,6 @@ void DeRestPluginPrivate::handleThermostatClusterIndication(const deCONZ::ApsDat if (zclFrame.manufacturerCode() == VENDOR_JENNIC) { } - else if (zclFrame.manufacturerCode() == VENDOR_DANFOSS) - { - quint8 windowmode = attr.numericValue().u8; - QString windowmodeSet; - - if (windowmode == 0x00) { windowmodeSet = QLatin1String("Quarantine"); } - else if (windowmode == 0x01) { windowmodeSet = QLatin1String("Closed"); } - else if (windowmode == 0x02) { windowmodeSet = QLatin1String("Hold"); } - else if (windowmode == 0x03) { windowmodeSet = QLatin1String("Open"); } - else if (windowmode == 0x04) { windowmodeSet = QLatin1String("Open (external), closed (internal)"); } - - item = sensor->item(RStateWindowOpen); - if (item && updateType == NodeValue::UpdateByZclReport) - { - stateUpdated = true; - } - if (item && item->toString() != windowmodeSet) - { - item->setValue(windowmodeSet, ResourceItem::SourceDevice); - enqueueEvent(Event(RSensors, RStateWindowOpen, sensor->id(), item)); - stateUpdated = true; - } - } sensor->setZclValue(updateType, ind.srcEndpoint(), THERMOSTAT_CLUSTER_ID, attrId, attr.numericValue()); } break; @@ -881,21 +853,6 @@ void DeRestPluginPrivate::handleThermostatClusterIndication(const deCONZ::ApsDat } } } - - // External Window Open signal - if (zclFrame.manufacturerCode() == VENDOR_DANFOSS && (sensor->modelId() == QLatin1String("TRV001") || - sensor->modelId() == QLatin1String("eT093WRO"))) - { - bool enabled = attr.numericValue().u8 > 0 ? true : false; - item = sensor->item(RConfigExternalWindowOpen); - - if (item && item->toBool() != enabled) - { - item->setValue(enabled, ResourceItem::SourceDevice); - enqueueEvent(Event(RSensors, RConfigExternalWindowOpen, sensor->id(), item)); - configUpdated = true; - } - } sensor->setZclValue(updateType, ind.srcEndpoint(), THERMOSTAT_CLUSTER_ID, attrId, attr.numericValue()); } @@ -942,82 +899,6 @@ void DeRestPluginPrivate::handleThermostatClusterIndication(const deCONZ::ApsDat } break; - case 0x4012: // Mounting mode active - { - if (zclFrame.manufacturerCode() == VENDOR_DANFOSS && (sensor->modelId() == QLatin1String("TRV001") || - sensor->modelId() == QLatin1String("eT093WRO"))) - { - bool enabled = attr.numericValue().u8 > 0 ? true : false; - item = sensor->item(RStateMountingModeActive); - if (item && item->toBool() != enabled) - { - item->setValue(enabled, ResourceItem::SourceDevice); - enqueueEvent(Event(RSensors, RStateMountingModeActive, sensor->id(), item)); - configUpdated = true; - } - } - sensor->setZclValue(updateType, ind.srcEndpoint(), THERMOSTAT_CLUSTER_ID, attrId, attr.numericValue()); - } - break; - - case 0x4013: // Mounting mode control - { - if (zclFrame.manufacturerCode() == VENDOR_DANFOSS && (sensor->modelId() == QLatin1String("TRV001") || - sensor->modelId() == QLatin1String("eT093WRO"))) - { - bool enabled = attr.numericValue().u8 > 0 ? true : false; - item = sensor->item(RConfigMountingMode); - if (item && item->toBool() != enabled) - { - item->setValue(enabled, ResourceItem::SourceDevice); - enqueueEvent(Event(RSensors, RConfigMountingMode, sensor->id(), item)); - configUpdated = true; - } - } - sensor->setZclValue(updateType, ind.srcEndpoint(), THERMOSTAT_CLUSTER_ID, attrId, attr.numericValue()); - } - break; - - case 0x4015: // External Measured Room Sensor - { - if (zclFrame.manufacturerCode() == VENDOR_DANFOSS && (sensor->modelId() == QLatin1String("TRV001") || - sensor->modelId() == QLatin1String("eT093WRO"))) - { - qint16 externalMeasurement = attr.numericValue().s16; - item = sensor->item(RConfigExternalTemperatureSensor); - if (item) - { - if (updateType == NodeValue::UpdateByZclReport) - { - configUpdated = true; - } - if (item->toNumber() != externalMeasurement) - { - item->setValue(externalMeasurement, ResourceItem::SourceDevice); - enqueueEvent(Event(RSensors, RConfigExternalTemperatureSensor, sensor->id(), item)); - configUpdated = true; - } - } - } - sensor->setZclValue(updateType, ind.srcEndpoint(), THERMOSTAT_CLUSTER_ID, attrId, attr.numericValue()); - } - break; - - case 0x404B: // Regulation SetPoint Offset (offset in 0.1 °C steps, from -2,5 °C to +2,5 °C) - { - qint16 config = attr.numericValue().s8 * 10; - item = sensor->item(RConfigOffset); - - if (item && item->toNumber() != config) - { - item->setValue(config, ResourceItem::SourceDevice); - enqueueEvent(Event(RSensors, RConfigOffset, sensor->id(), item)); - configUpdated = true; - } - sensor->setZclValue(updateType, ind.srcEndpoint(), THERMOSTAT_CLUSTER_ID, attrId, attr.numericValue()); - } - break; - // Manufacturer Specific for Danfoss Icon Floor Heating Controller case 0x4110: // Danfoss Output Status { @@ -1161,11 +1042,6 @@ bool DeRestPluginPrivate::addTaskThermostatCmd(TaskItem &task, uint16_t mfrCode, { // no payload } - else if (cmd == 0x40) // Danfoss/Hive manufacturer command - { - stream << (qint8) 0x01; // Large valve movement - stream << (qint16) setpoint; // temperature - } else { return false; diff --git a/thermostat.h b/thermostat.h index 1db661ca33..3f2e745bd5 100644 --- a/thermostat.h +++ b/thermostat.h @@ -17,11 +17,7 @@ #define THERM_ATTRID_DEVICE_ON 0x0406 // ELKO specific #define THERM_ATTRID_CHILD_LOCK 0x0413 // ELKO specific #define THERM_ATTRID_CURRENT_TEMPERATURE_SETPOINT 0x4003 // Eurotronic specific -#define THERM_ATTRID_EXTERNAL_OPEN_WINDOW_DETECTED 0x4003 // Danfoss specific #define THERM_ATTRID_HOST_FLAGS 0x4008 // Eurotronic specific -#define THERM_ATTRID_MOUNTING_MODE_CONTROL 0x4013 // Danfoss specific -#define THERM_ATTRID_EXTERNAL_MEASUREMENT 0x4015 // Danfoss specific -#define THERM_ATTRID_REGULATION_SETPOINT_OFFSET 0x404B // Danfoss specific // Values for attribute Control Sequence of Operation (0x001B) #define COOLING_ONLY 0x00 @@ -44,6 +40,5 @@ extern const std::array RConfigTemperatureMeasurementValues; extern const std::array RConfigSwingModeValues; extern const std::array RConfigControlSequenceValues; extern const std::array RConfigModeValuesEurotronic; -extern const std::array RStateWindowOpenValuesDanfoss; #endif // THERMOSTAT_H diff --git a/thermostat_ui_configuration.cpp b/thermostat_ui_configuration.cpp index bf70f29c7d..82eeb362b3 100644 --- a/thermostat_ui_configuration.cpp +++ b/thermostat_ui_configuration.cpp @@ -81,24 +81,6 @@ void DeRestPluginPrivate::handleThermostatUiConfigurationClusterIndication(const } break; - case THERM_UI_ATTRID_VIEWING_DIRECTION: - { - if (sensor->modelId() == QLatin1String("TRV001") || sensor->modelId() == QLatin1String("eT093WRO")) - { - bool displayflipped = attr.numericValue().u8 > 0 ? true : false; - item = sensor->item(RConfigDisplayFlipped); - - if (item && item->toBool() != displayflipped) - { - item->setValue(displayflipped); - enqueueEvent(Event(RSensors, RConfigDisplayFlipped, sensor->id(), item)); - configUpdated = true; - } - } - sensor->setZclValue(updateType, ind.srcEndpoint(), THERMOSTAT_UI_CONFIGURATION_CLUSTER_ID, attrId, attr.numericValue()); - } - break; - default: break; } diff --git a/thermostat_ui_configuration.h b/thermostat_ui_configuration.h index ca0fee00c5..a147b18e39 100644 --- a/thermostat_ui_configuration.h +++ b/thermostat_ui_configuration.h @@ -2,6 +2,5 @@ #define THERMOSTAT_UI_CONFIGURATION_H #define THERM_UI_ATTRID_KEYPAD_LOCKOUT 0x0001 -#define THERM_UI_ATTRID_VIEWING_DIRECTION 0x4000 // Danfoss specific #endif // THERMOSTAT_UI_CONFIGURATION_H