Skip to content

Commit

Permalink
Merge remote-tracking branch 'swoopx/supertr'
Browse files Browse the repository at this point in the history
  • Loading branch information
manup committed Oct 15, 2020
2 parents ed96837 + 2baf957 commit 8bafd06
Show file tree
Hide file tree
Showing 8 changed files with 284 additions and 48 deletions.
49 changes: 49 additions & 0 deletions bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1069,6 +1069,55 @@ bool DeRestPluginPrivate::sendConfigureReportingRequest(BindingTask &bt)

return sendConfigureReportingRequest(bt, {rq, rq2});
}
else if (sensor && sensor->modelId() == QLatin1String("Super TR")) // Elko Super TR
{
rq.dataType = deCONZ::Zcl16BitInt;
rq.attributeId = 0x0000; // Local temperature
rq.minInterval = 1;
rq.maxInterval = 600;
rq.reportableChange16bit = 20;

ConfigureReportingRequest rq2;
rq2.dataType = deCONZ::Zcl16BitInt;
rq2.attributeId = 0x0012; // Occupied heating setpoint
rq2.minInterval = 1;
rq2.maxInterval = 600;
rq2.reportableChange16bit = 50;

ConfigureReportingRequest rq3;
rq3.dataType = deCONZ::Zcl8BitEnum;
rq3.attributeId = 0x001C; // Thermostat mode
rq3.minInterval = 1;
rq3.maxInterval = 600;
rq3.reportableChange8bit = 0xff;

ConfigureReportingRequest rq4;
rq4.dataType = deCONZ::ZclBoolean;
rq4.attributeId = 0x0406; // Device on
rq4.minInterval = 1;
rq4.maxInterval = 600;

ConfigureReportingRequest rq5;
rq5.dataType = deCONZ::Zcl16BitInt;
rq5.attributeId = 0x0409; // Floor temperature
rq5.minInterval = 1;
rq5.maxInterval = 600;
rq5.reportableChange16bit = 20;

ConfigureReportingRequest rq6;
rq6.dataType = deCONZ::ZclBoolean;
rq6.attributeId = 0x0413; // Child lock
rq6.minInterval = 1;
rq6.maxInterval = 600;

ConfigureReportingRequest rq7;
rq7.dataType = deCONZ::ZclBoolean;
rq7.attributeId = 0x0415; // Heating active/inactive
rq7.minInterval = 1;
rq7.maxInterval = 600;

return sendConfigureReportingRequest(bt, {rq, rq2, rq3, rq4, rq5, rq6, rq7});
}
else if (sensor && sensor->modelId() == QLatin1String("Zen-01")) // Zen
{
rq.dataType = deCONZ::Zcl16BitInt;
Expand Down
8 changes: 8 additions & 0 deletions database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3501,6 +3501,14 @@ static int sqliteLoadAllSensorsCallback(void *user, int ncols, char **colval , c
{
sensor.addItem(DataTypeString, RConfigMode);
}

if (sensor.modelId() == QLatin1String("Super TR")) // ELKO
{
sensor.addItem(DataTypeString, RConfigTemperatureMeasurement);
sensor.addItem(DataTypeInt16, RStateFloorTemperature);
sensor.addItem(DataTypeBool, RStateHeating);
sensor.addItem(DataTypeBool, RConfigLocked);
}

if (sensor.modelId() == QLatin1String("kud7u2l") || // Tuya
sensor.modelId() == QLatin1String("GbxAXL2") || // Tuya
Expand Down
8 changes: 8 additions & 0 deletions de_web_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6007,6 +6007,14 @@ void DeRestPluginPrivate::addSensorNode(const deCONZ::Node *node, const SensorFi
{
sensorNode.addItem(DataTypeString, RConfigMode);
}

if (sensorNode.modelId() == QLatin1String("Super TR")) // ELKO
{
sensorNode.addItem(DataTypeString, RConfigTemperatureMeasurement);
sensorNode.addItem(DataTypeInt16, RStateFloorTemperature);
sensorNode.addItem(DataTypeBool, RStateHeating);
sensorNode.addItem(DataTypeBool, RConfigLocked);
}

if (sensorNode.modelId() == QLatin1String("kud7u2l") || // Tuya
sensorNode.modelId() == QLatin1String("GbxAXL2") || // Tuya
Expand Down
78 changes: 39 additions & 39 deletions general.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1737,6 +1737,32 @@ Note: It does not clear or delete previous weekly schedule programming configura
<attribute id="0x0081" name="Unknown" type="s16" access="r" required="o"/>
<attribute id="0x0082" name="Unknown (Heat Setpoint?)" type="s16" access="r" required="o"/>
</attribute-set>

<!-- ELKO specific -->
<attribute-set id="0x0400" description="ELKO specific" mfcode="0x1002">
<attribute id="0x0401" name="Unknown" type="u16" access="rw" required="m"></attribute>
<attribute id="0x0402" name="Unknown name field" type="cstring" access="rw" required="m"></attribute>
<attribute id="0x0403" name="Temperature measurement" type="enum8" access="rw" required="m">
<value name="Air sensor" value="0x00"></value>
<value name="Floor sensor" value="0x01"></value>
<value name="Floor protection" value="0x03"></value>
</attribute>
<attribute id="0x0404" name="Unknown" type="u8" access="rw" required="m"></attribute>
<attribute id="0x0405" name="Regulator mode" type="bool" access="rw" required="m"></attribute>
<attribute id="0x0406" name="Device on" type="bool" access="rw" required="m"></attribute>
<attribute id="0x0407" name="Unknown" type="ostring" access="rw" required="m"></attribute>
<attribute id="0x0408" name="Unknown" type="u16" access="rw" required="m"></attribute>
<attribute id="0x0409" name="Floor temperature sensor" type="s16" access="rw" required="m"></attribute>
<attribute id="0x0411" name="Night lowering" type="bool" access="rw" required="m"></attribute>
<attribute id="0x0412" name="Unknown" type="bool" access="r" required="m"></attribute>
<attribute id="0x0413" name="Child lock" type="bool" access="rw" required="m"></attribute>
<attribute id="0x0414" name="Unknown" type="u8" access="rw" required="m"></attribute>
<attribute id="0x0415" name="Heating active/inactive" type="bool" access="rw" required="m"></attribute>
<attribute id="0x0416" name="Unknown" type="ostring" access="rw" required="m"></attribute>
<attribute id="0x0417" name="Unknown" type="s8" access="rw" required="m"></attribute>
<attribute id="0x0418" name="Unknown" type="u8" access="rw" required="m"></attribute>
<attribute id="0x0419" name="Unknown" type="u8" access="rw" required="m"></attribute>
</attribute-set>

<!-- Eurotronic manufacturer specific -->
<attribute-set id="0x4000" description="Eurotronic" mfcode="0x1037">
Expand Down Expand Up @@ -1801,45 +1827,19 @@ Note: It does not clear or delete previous weekly schedule programming configura
<attribute id="0x404E" name="Unknown" type="bmp8" access="rw" required="m" mfcode="0x1246"></attribute>
</attribute-set>

<!-- ELKO manufacturer specific -->
<attribute-set id="0x4000" description="ELKO specific" mfcode="0x1002">
<attribute id="0x4001" name="Unknown" type="u16" access="rw" required="m" mfcode="0x1002"></attribute>
<attribute id="0x4002" name="Unknown name field" type="cstring" access="rw" required="m" mfcode="0x1002"></attribute>
<attribute id="0x4003" name="Unknown" type="enum8" access="rw" required="m" mfcode="0x1002">
<value name="Air sensor" value="0x00"></value>
<value name="Floor sensor" value="0x01"></value>
<value name="Floor protection" value="0x03"></value>
</attribute>
<attribute id="0x4004" name="Unknown" type="u8" access="rw" required="m" mfcode="0x1002"></attribute>
<attribute id="0x4005" name="Regulator mode" type="bool" access="rw" required="m" mfcode="0x1002"></attribute>
<attribute id="0x4006" name="Device on" type="bool" access="rw" required="m" mfcode="0x1002"></attribute>
<attribute id="0x4007" name="Unknown" type="ostring" access="rw" required="m" mfcode="0x1002"></attribute>
<attribute id="0x4008" name="Unknown" type="u16" access="rw" required="m" mfcode="0x1002"></attribute>
<attribute id="0x4009" name="Floor temperature sensor" type="s16" access="rw" required="m" mfcode="0x1002"></attribute>
<attribute id="0x4011" name="Night lowering" type="bool" access="rw" required="m" mfcode="0x1002"></attribute>
<attribute id="0x4012" name="Unknown" type="bool" access="r" required="m" mfcode="0x1002"></attribute>
<attribute id="0x4013" name="Child lock" type="bool" access="rw" required="m" mfcode="0x1002"></attribute>
<attribute id="0x4014" name="Unknown" type="u8" access="rw" required="m" mfcode="0x1002"></attribute>
<attribute id="0x4015" name="Heating active/inactive" type="bool" access="rw" required="m" mfcode="0x1002"></attribute>
<attribute id="0x4016" name="Unknown" type="ostring" access="rw" required="m" mfcode="0x1002"></attribute>
<attribute id="0x4017" name="Unknown" type="s8" access="rw" required="m" mfcode="0x1002"></attribute>
<attribute id="0x4018" name="Unknown" type="u8" access="rw" required="m" mfcode="0x1002"></attribute>
<attribute id="0x4019" name="Unknown" type="u8" access="rw" required="m" mfcode="0x1002"></attribute>
</attribute-set>

<command id="0x00" dir="recv" name="Setpoint Raise/Lower" required="m">
<description>This command increases (or decreases) the setpoint(s) by amount, in steps of 0.1°C.</description>
<payload>
<attribute id="0x0000" type="enum8" name="Mode" required="m">
<value name="Heat (adjust Heat Setpoint)" value="0x00"></value>
<value name="Cool (adjust Cool Setpoint)" value="0x01"></value>
<value name="Both (adjust Heat Setpoint and Cool Setpoint)" value="0x02"></value>
</attribute>
<attribute id="0x0001" type="s8" name="Amount" required="m">
<description>The amount field is a signed 8-bit integer that specifies the amount the setpoint(s) are to be a increased (or decreased) by, in steps of 0.1°C.</description>
</attribute>
</payload>
</command>
<command id="0x00" dir="recv" name="Setpoint Raise/Lower" required="m">
<description>This command increases (or decreases) the setpoint(s) by amount, in steps of 0.1°C.</description>
<payload>
<attribute id="0x0000" type="enum8" name="Mode" required="m">
<value name="Heat (adjust Heat Setpoint)" value="0x00"></value>
<value name="Cool (adjust Cool Setpoint)" value="0x01"></value>
<value name="Both (adjust Heat Setpoint and Cool Setpoint)" value="0x02"></value>
</attribute>
<attribute id="0x0001" type="s8" name="Amount" required="m">
<description>The amount field is a signed 8-bit integer that specifies the amount the setpoint(s) are to be a increased (or decreased) by, in steps of 0.1°C.</description>
</attribute>
</payload>
</command>
<command id="0x01" dir="recv" name="Set Weekly Schedule" required="o">
<payload>
<attribute id="0x0000" type="enum8" name="Number of Transtions for Sequence" required="m">
Expand Down
6 changes: 6 additions & 0 deletions resource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ const char *RStateErrorCode = "state/errorcode";
const char *RStateEventDuration = "state/eventduration";
const char *RStateFire = "state/fire";
const char *RStateFlag = "state/flag";
const char *RStateFloorTemperature = "state/floortemperature";
const char *RStateGesture = "state/gesture";
const char *RStateHeating = "state/heating";
const char *RStateHue = "state/hue";
const char *RStateHumidity = "state/humidity";
const char *RStateLastSet = "state/lastset";
Expand Down Expand Up @@ -146,6 +148,7 @@ const char *RConfigSensitivityMax = "config/sensitivitymax";
const char *RConfigSunriseOffset = "config/sunriseoffset";
const char *RConfigSunsetOffset = "config/sunsetoffset";
const char *RConfigTemperature = "config/temperature";
const char *RConfigTemperatureMeasurement = "config/temperaturemeasurement";
const char *RConfigTholdDark = "config/tholddark";
const char *RConfigTholdOffset = "config/tholdoffset";
const char *RConfigUrl = "config/url";
Expand Down Expand Up @@ -216,7 +219,9 @@ void initResourceDescriptors()
rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeUInt16, RStateEventDuration));
rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeBool, RStateFire));
rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeBool, RStateFlag));
rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeInt16, RStateFloorTemperature, -27315, 32767));
rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeInt32, RStateGesture));
rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeBool, RStateHeating));
rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeUInt16, RStateHue));
rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeUInt16, RStateHumidity, 0, 10000));
rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeTime, RStateLastSet));
Expand Down Expand Up @@ -298,6 +303,7 @@ void initResourceDescriptors()
rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeInt8, RConfigSunriseOffset, -120, 120));
rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeInt8, RConfigSunsetOffset, -120, 120));
rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeInt16, RConfigTemperature, -27315, 32767));
rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeString, RConfigTemperatureMeasurement));
rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeUInt16, RConfigTholdDark, 0, 0xfffe));
rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeUInt16, RConfigTholdOffset, 1, 0xfffe));
rItemDescriptors.emplace_back(ResourceItemDescriptor(DataTypeString, RConfigUrl));
Expand Down
3 changes: 3 additions & 0 deletions resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ extern const char *RStateErrorCode;
extern const char *RStateEventDuration;
extern const char *RStateFire;
extern const char *RStateFlag;
extern const char *RStateFloorTemperature;
extern const char *RStateGesture;
extern const char *RStateHeating;
extern const char *RStateHue;
extern const char *RStateHumidity;
extern const char *RStateLastSet;
Expand Down Expand Up @@ -154,6 +156,7 @@ extern const char *RConfigSensitivityMax;
extern const char *RConfigSunriseOffset;
extern const char *RConfigSunsetOffset;
extern const char *RConfigTemperature;
extern const char *RConfigTemperatureMeasurement;
extern const char *RConfigTholdDark;
extern const char *RConfigTholdOffset;
extern const char *RConfigUrl;
Expand Down

0 comments on commit 8bafd06

Please sign in to comment.