Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for POPP Smart Thermostat #5279

Merged
merged 1 commit into from
Jan 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1361,7 +1361,8 @@ bool DeRestPluginPrivate::sendConfigureReportingRequest(BindingTask &bt)
return sendConfigureReportingRequest(bt, {rq, rq2, rq3, rq4, rq5});
}
else if (modelId == QLatin1String("eTRV0100") || // Danfoss Ally
modelId == QLatin1String("TRV001")) // Hive TRV
modelId == QLatin1String("TRV001") || // Hive TRV
modelId == QLatin1String("eT093WRO")) // POPP smart thermostat
{
rq.dataType = deCONZ::Zcl16BitInt;
rq.attributeId = 0x0000; // local temperature
Expand Down Expand Up @@ -1591,7 +1592,8 @@ bool DeRestPluginPrivate::sendConfigureReportingRequest(BindingTask &bt)
else if (bt.binding.clusterId == THERMOSTAT_UI_CONFIGURATION_CLUSTER_ID)
{
if (modelId == QLatin1String("eTRV0100") || // Danfoss Ally
modelId == QLatin1String("TRV001")) // Hive TRV
modelId == QLatin1String("TRV001") || // Hive TRV
modelId == QLatin1String("eT093WRO")) // POPP smart thermostat
{
rq.dataType = deCONZ::Zcl8BitEnum;
rq.attributeId = 0x0001; // Keypad Lockout
Expand Down Expand Up @@ -1629,7 +1631,8 @@ bool DeRestPluginPrivate::sendConfigureReportingRequest(BindingTask &bt)
else if (bt.binding.clusterId == DIAGNOSTICS_CLUSTER_ID)
{
if (modelId == QLatin1String("eTRV0100") || // Danfoss Ally
modelId == QLatin1String("TRV001")) // Hive TRV
modelId == QLatin1String("TRV001") || // Hive TRV
modelId == QLatin1String("eT093WRO")) // POPP smart thermostat
{
rq.dataType = deCONZ::Zcl16BitBitMap;
rq.attributeId = 0x4000; // SW error code
Expand Down Expand Up @@ -1725,6 +1728,7 @@ bool DeRestPluginPrivate::sendConfigureReportingRequest(BindingTask &bt)
rq.reportableChange8bit = 4; // value used by Hue bridge
}
else if (modelId == QLatin1String("eTRV0100") || // Danfoss Ally
modelId == QLatin1String("eT093WRO") || // POPP smart thermostat
modelId == QLatin1String("TRV001") || // Hive TRV
modelId == QLatin1String("0x8020") || // Danfoss RT24V Display thermostat
modelId == QLatin1String("0x8021") || // Danfoss RT24V Display thermostat with floor sensor
Expand Down Expand Up @@ -3063,6 +3067,8 @@ 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
Expand Down Expand Up @@ -3374,7 +3380,8 @@ bool DeRestPluginPrivate::checkSensorBindingsForAttributeReporting(Sensor *senso
else if (*i == DIAGNOSTICS_CLUSTER_ID)
{
if (sensor->modelId() == QLatin1String("eTRV0100") || // Danfoss Ally
sensor->modelId() == QLatin1String("TRV001")) // Hive TRV
sensor->modelId() == QLatin1String("TRV001") || // Hive TRV
sensor->modelId() == QLatin1String("eT093WRO")) // POPP smart thermostat
{
val = sensor->getZclValue(*i, 0x4000); // SW error code
}
Expand Down
3 changes: 2 additions & 1 deletion database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3786,7 +3786,8 @@ static int sqliteLoadAllSensorsCallback(void *user, int ncols, char **colval , c
sensor.addItem(DataTypeString, RConfigFanMode);
}
else if (sensor.modelId() == QLatin1String("eTRV0100") || // Danfoss Ally
sensor.modelId() == QLatin1String("TRV001")) // Hive TRV
sensor.modelId() == QLatin1String("TRV001") || // Hive TRV
sensor.modelId() == QLatin1String("eT093WRO")) // POPP smart thermostat
{
sensor.addItem(DataTypeUInt8, RStateValve);
sensor.addItem(DataTypeString, RStateWindowOpen);
Expand Down
10 changes: 7 additions & 3 deletions de_web_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ 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, "eTRV0100", silabs2MacPrefix }, // Danfoss Ally thermostat
{ VENDOR_DANFOSS, "0x8020", silabs6MacPrefix }, // Danfoss RT24V Display thermostat
{ VENDOR_DANFOSS, "0x8021", silabs6MacPrefix }, // Danfoss RT24V Display thermostat with floor sensor
Expand Down Expand Up @@ -5958,7 +5959,8 @@ void DeRestPluginPrivate::addSensorNode(const deCONZ::Node *node, const deCONZ::
{
// Many Xiaomi devices advertise non-functional Time cluster, so better use whitelist.
if (modelId == QLatin1String("Thermostat") || // eCozy
modelId == QLatin1String("eTRV0100")) // Danfoss
modelId == QLatin1String("eTRV0100") || // Danfoss
modelId == QLatin1String("eT093WRO")) // POPP smart thermostat
{
fpTimeSensor.inClusters.push_back(ci->id());
}
Expand Down Expand Up @@ -7196,8 +7198,9 @@ void DeRestPluginPrivate::addSensorNode(const deCONZ::Node *node, const SensorFi
sensorNode.addItem(DataTypeString, RConfigMode);
sensorNode.addItem(DataTypeString, RConfigFanMode);
}
else if ((modelId == QLatin1String("eTRV0100")) || // Danfoss Ally
(modelId == QLatin1String("TRV001")) ) // Hive TRV
else if (modelId == QLatin1String("eTRV0100") || // Danfoss Ally
modelId == QLatin1String("TRV001") || // Hive TRV
modelId == QLatin1String("eT093WRO")) // POPP smart thermostat
{
sensorNode.addItem(DataTypeUInt8, RStateValve);
sensorNode.addItem(DataTypeString, RStateWindowOpen);
Expand Down Expand Up @@ -16598,6 +16601,7 @@ void DeRestPlugin::idleTimerFired()
sensorNode->modelId().startsWith(QLatin1String("TH112")) || // Sinope devices
sensorNode->modelId().startsWith(QLatin1String("TH1300ZB")) || // Sinope devices
sensorNode->modelId().startsWith(QLatin1String("eTRV0100")) || // Danfoss Ally
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
Expand Down
2 changes: 1 addition & 1 deletion diagnostics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void DeRestPluginPrivate::handleDiagnosticsClusterIndication(const deCONZ::ApsDa
{
case 0x4000: // SW error code
{
if (sensor->modelId() == QLatin1String("eTRV0100") || sensor->modelId() == QLatin1String("TRV001"))
if (sensor->modelId() == QLatin1String("eTRV0100") || sensor->modelId() == QLatin1String("TRV001") || sensor->modelId() == QLatin1String("eT093WRO"))
{
quint16 value = attr.numericValue().u16;
QString errorCode = QString("%1").arg(value, 4, 16, QLatin1Char('0')).toUpper();
Expand Down
9 changes: 6 additions & 3 deletions rest_sensors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,8 @@ int DeRestPluginPrivate::changeSensorConfig(const ApiRequest &req, ApiResponse &
}
}
}
else if (sensor->modelId() == QLatin1String("eTRV0100") || sensor->modelId() == QLatin1String("TRV001"))
else if (sensor->modelId() == QLatin1String("eTRV0100") || sensor->modelId() == QLatin1String("TRV001") ||
sensor->modelId() == QLatin1String("eT093WRO"))
{
if (data.integer < -25) { data.integer = -25; }
if (data.integer > 25) { data.integer = 25; }
Expand Down Expand Up @@ -1008,7 +1009,8 @@ int DeRestPluginPrivate::changeSensorConfig(const ApiRequest &req, ApiResponse &
updated = true;
}
}
else if (sensor->modelId() == QLatin1String("eTRV0100") || sensor->modelId() == QLatin1String("TRV001"))
else if (sensor->modelId() == QLatin1String("eTRV0100") || sensor->modelId() == QLatin1String("TRV001") ||
sensor->modelId() == QLatin1String("eT093WRO"))
{
if (addTaskThermostatCmd(task, VENDOR_DANFOSS, 0x40, data.integer, 0))
{
Expand Down Expand Up @@ -1399,7 +1401,8 @@ int DeRestPluginPrivate::changeSensorConfig(const ApiRequest &req, ApiResponse &
}
else if (rid.suffix == RConfigDisplayFlipped) // Boolean
{
if (sensor->modelId() == QLatin1String("eTRV0100") || sensor->modelId() == QLatin1String("TRV001"))
if (sensor->modelId() == QLatin1String("eTRV0100") || sensor->modelId() == QLatin1String("TRV001") ||
sensor->modelId() == QLatin1String("eT093WRO"))
{
data.uinteger = data.boolean; // Use integer representation

Expand Down
13 changes: 9 additions & 4 deletions thermostat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ void DeRestPluginPrivate::handleThermostatClusterIndication(const deCONZ::ApsDat
{
if (sensor->modelId().startsWith(QLatin1String("SPZB")) || // Eurotronic Spirit
sensor->modelId() == QLatin1String("eTRV0100") || // Danfoss Ally
sensor->modelId() == QLatin1String("eT093WRO") || // POPP smart thermostat
sensor->modelId() == QLatin1String("TRV001") || // Hive TRV
sensor->modelId() == QLatin1String("Thermostat")) // eCozy
{
Expand Down Expand Up @@ -881,7 +882,8 @@ void DeRestPluginPrivate::handleThermostatClusterIndication(const deCONZ::ApsDat

// External Window Open signal
if (zclFrame.manufacturerCode() == VENDOR_DANFOSS && (sensor->modelId() == QLatin1String("eTRV0100") ||
sensor->modelId() == QLatin1String("TRV001")))
sensor->modelId() == QLatin1String("TRV001") ||
sensor->modelId() == QLatin1String("eT093WRO")))
{
bool enabled = attr.numericValue().u8 > 0 ? true : false;
item = sensor->item(RConfigExternalWindowOpen);
Expand Down Expand Up @@ -942,7 +944,8 @@ void DeRestPluginPrivate::handleThermostatClusterIndication(const deCONZ::ApsDat
case 0x4012: // Mounting mode active
{
if (zclFrame.manufacturerCode() == VENDOR_DANFOSS && (sensor->modelId() == QLatin1String("eTRV0100") ||
sensor->modelId() == QLatin1String("TRV001")))
sensor->modelId() == QLatin1String("TRV001") ||
sensor->modelId() == QLatin1String("eT093WRO")))
{
bool enabled = attr.numericValue().u8 > 0 ? true : false;
item = sensor->item(RStateMountingModeActive);
Expand All @@ -960,7 +963,8 @@ void DeRestPluginPrivate::handleThermostatClusterIndication(const deCONZ::ApsDat
case 0x4013: // Mounting mode control
{
if (zclFrame.manufacturerCode() == VENDOR_DANFOSS && (sensor->modelId() == QLatin1String("eTRV0100") ||
sensor->modelId() == QLatin1String("TRV001")))
sensor->modelId() == QLatin1String("TRV001") ||
sensor->modelId() == QLatin1String("eT093WRO")))
{
bool enabled = attr.numericValue().u8 > 0 ? true : false;
item = sensor->item(RConfigMountingMode);
Expand All @@ -978,7 +982,8 @@ void DeRestPluginPrivate::handleThermostatClusterIndication(const deCONZ::ApsDat
case 0x4015: // External Measured Room Sensor
{
if (zclFrame.manufacturerCode() == VENDOR_DANFOSS && (sensor->modelId() == QLatin1String("eTRV0100") ||
sensor->modelId() == QLatin1String("TRV001")))
sensor->modelId() == QLatin1String("TRV001") ||
sensor->modelId() == QLatin1String("eT093WRO")))
{
qint16 externalMeasurement = attr.numericValue().s16;
item = sensor->item(RConfigExternalTemperatureSensor);
Expand Down
2 changes: 1 addition & 1 deletion thermostat_ui_configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ void DeRestPluginPrivate::handleThermostatUiConfigurationClusterIndication(const

case THERM_UI_ATTRID_VIEWING_DIRECTION:
{
if (sensor->modelId() == QLatin1String("eTRV0100") || sensor->modelId() == QLatin1String("TRV001"))
if (sensor->modelId() == QLatin1String("eTRV0100") || sensor->modelId() == QLatin1String("TRV001") || sensor->modelId() == QLatin1String("eT093WRO"))
{
bool displayflipped = attr.numericValue().u8 > 0 ? true : false;
item = sensor->item(RConfigDisplayFlipped);
Expand Down