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 initial support for D-Link DCH-B112 door/window sensor #4581

Merged
merged 2 commits into from
Apr 18, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 2 additions & 0 deletions bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2888,6 +2888,8 @@ bool DeRestPluginPrivate::checkSensorBindingsForAttributeReporting(Sensor *senso
// Owon
sensor->modelId() == QLatin1String("AC201") ||
sensor->modelId() == QLatin1String("PR412C") ||
// D-Link
sensor->modelId() == QLatin1String("DCH-B112") ||
// Sonoff
sensor->modelId() == QLatin1String("WB01") ||
sensor->modelId() == QLatin1String("WB-01") ||
Expand Down
3 changes: 3 additions & 0 deletions de_web_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ const quint64 embertecMacPrefix = 0x848e960000000000ULL;
const quint64 silabsMacPrefix = 0x90fd9f0000000000ULL;
const quint64 zhejiangMacPrefix = 0xb0ce180000000000ULL;
const quint64 silabs7MacPrefix = 0xbc33ac0000000000ULL;
const quint64 dlinkMacPrefix = 0xc4e90a0000000000ULL;
const quint64 silabs2MacPrefix = 0xcccccc0000000000ULL;
const quint64 silabs3MacPrefix = 0xec1bbd0000000000ULL;
const quint64 energyMiMacPrefix = 0xd0cf5e0000000000ULL;
Expand Down Expand Up @@ -146,6 +147,7 @@ static const SupportedDevice supportedDevices[] = {
{ VENDOR_C2DF, "3300", emberMacPrefix }, // Centralite contact sensor
{ VENDOR_C2DF, "3320-L", emberMacPrefix }, // Centralite contact sensor
{ VENDOR_C2DF, "3315", emberMacPrefix }, // Centralite water sensor
{ VENDOR_D_LINK, "DCH-B112", dlinkMacPrefix }, // D-Link DCH-B112 door/window sensor
{ VENDOR_NONE, "SD8SC_00.00.03.09TC", tiMacPrefix }, // Centralite smoke sensor
{ VENDOR_CENTRALITE, "3326-L", emberMacPrefix }, // Iris motion sensor v2
{ VENDOR_C2DF, "3326-L", emberMacPrefix }, // Iris motion sensor v2
Expand Down Expand Up @@ -5222,6 +5224,7 @@ void DeRestPluginPrivate::addSensorNode(const deCONZ::Node *node, const deCONZ::
modelId == QLatin1String("DS01") || // Sonoff SNZB-04
modelId == QLatin1String("GMB-HAS-DW-B01") || // GamaBit Ltd. Window/Door Sensor
modelId == QLatin1String("TY0203") || // lidl / SilverCrest
modelId == QLatin1String("DCH-B112") || // D-Link door/window sensor
modelId == QLatin1String("RH3001")) // Tuya/Blitzwolf BW-IS2 door/window sensor
{
fpOpenCloseSensor.inClusters.push_back(ci->id());
Expand Down
3 changes: 3 additions & 0 deletions de_web_plugin_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ using namespace deCONZ::literals;
#define VENDOR_INNR 0x1166
#define VENDOR_LDS 0x1168 // Used by Samsung SmartPlug 2019
#define VENDOR_PLUGWISE_BV 0x1172
#define VENDOR_D_LINK 0x1175
#define VENDOR_INSTA 0x117A
#define VENDOR_IKEA 0x117C
#define VENDOR_3A_SMART_HOME 0x117E
Expand Down Expand Up @@ -646,6 +647,8 @@ inline bool existDevicesWithVendorCodeForMacPrefix(quint64 addr, quint16 vendor)
return prefix == schlageMacPrefix;
case VENDOR_ADUROLIGHT:
return prefix == jennicMacPrefix;
case VENDOR_D_LINK:
return prefix == dlinkMacPrefix;
default:
return false;
}
Expand Down