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 Develco magnetic sensor #1667 #1679

Closed
wants to merge 14 commits into from
15 changes: 11 additions & 4 deletions bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1065,10 +1065,12 @@ bool DeRestPluginPrivate::sendConfigureReportingRequest(BindingTask &bt)
rq.maxInterval = 3600;
rq.reportableChange8bit = 0;
}
else if (sensor && sensor->modelId().startsWith(QLatin1String("SMSZB-120")))
else if (sensor && (sensor->modelId().startsWith(QLatin1String("SMSZB-120")) || // Develco smoke sensor
sensor->modelId().startsWith(QLatin1String("WISZB-120")) || // Develco window sensor
sensor->modelId().startsWith(QLatin1String("ZHMS101")))) // Wattle (Develco) magnetic sensor
{
rq.attributeId = 0x0020; // battery voltage
rq.minInterval = 43200;
rq.minInterval = 300;
rq.maxInterval = 43200;
rq.reportableChange8bit = 0;
}
Expand Down Expand Up @@ -1713,7 +1715,9 @@ bool DeRestPluginPrivate::checkSensorBindingsForAttributeReporting(Sensor *senso
// Bitron
sensor->modelId().startsWith(QLatin1String("902010")) ||
// Develco
sensor->modelId().startsWith(QLatin1String("SMSZB-120")) ||
sensor->modelId().startsWith(QLatin1String("SMSZB-120")) || // smoke sensor
sensor->modelId().startsWith(QLatin1String("WISZB-120")) || // window sensor
sensor->modelId().startsWith(QLatin1String("ZHMS101")) || // Wattle (Develco) magnetic sensor
// LG
sensor->modelId() == QLatin1String("LG IP65 HMS") ||
// Sinope
Expand Down Expand Up @@ -1815,7 +1819,10 @@ bool DeRestPluginPrivate::checkSensorBindingsForAttributeReporting(Sensor *senso
{
val = sensor->getZclValue(*i, 0x0035); // battery alarm mask
}
else if (sensor->modelId() == QLatin1String("Motion Sensor-A") || sensor->modelId() == QLatin1String("SMSZB-120"))
else if (sensor->modelId() == QLatin1String("Motion Sensor-A") ||
sensor->modelId() == QLatin1String("SMSZB-120") ||
sensor->modelId() == QLatin1String("WISZB-120") ||
sensor->modelId() == QLatin1String("ZHMS101"))
{
val = sensor->getZclValue(*i, 0x0020); // battery voltage
}
Expand Down
2 changes: 2 additions & 0 deletions de_web_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ static const SupportedDevice supportedDevices[] = {
{ VENDOR_NONE, "RES001", tiMacPrefix }, // Hubitat environment sensor, see #1308
{ VENDOR_119C, "WL4200S", sinopeMacPrefix}, // Sinope water sensor
{ VENDOR_DEVELCO, "SMSZB-120", develcoMacPrefix }, // Develco smoke sensor
{ VENDOR_DEVELCO, "WISZB-120", develcoMacPrefix }, // Develco window sensor
{ VENDOR_DEVELCO, "ZHMS101", develcoMacPrefix }, // Wattle (Develco) magnetic sensor
{ 0, nullptr, 0 }
};

Expand Down
1 change: 1 addition & 0 deletions general.xml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@
<description>As printed on the product.</description>
</attribute>
<attribute id="0x4000" name="SW Build ID" type="cstring" access="r" required="o" range="0,16"></attribute>
<attribute id="0x8000" name="Primary SW Version" type="ostring" access="r" required="m" mfcode="0x1015"></attribute>
<attribute id="0xff0d" name="Xiaomi Sensitivity" type="u8" access="rw" required="o" mfcode="0x115f"></attribute>
<attribute id="0xff22" name="Xiaomi Disconnect 1" type="u8" showas="hex" access="rw" required="o" mfcode="0x115f">
<description>Set to 0x12 (0xFE) to connect (disconnect) the left button to (from) the relay.</description>
Expand Down