Skip to content

Commit 95aa010

Browse files
udoewichmanup
authored andcommitted
Support for ORVIBO switch, dimmer and motion sensor
1 parent 24454d8 commit 95aa010

File tree

3 files changed

+83
-3
lines changed

3 files changed

+83
-3
lines changed

bindings.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1521,6 +1521,9 @@ void DeRestPluginPrivate::checkLightBindingsForAttributeReporting(LightNode *lig
15211521
else if (lightNode->modelId() == QLatin1String("SPLZB-131"))
15221522
{
15231523
}
1524+
else if (lightNode->manufacturer() == QString("欧瑞博") || lightNode->manufacturer() == QLatin1String("ORVIBO"))
1525+
{
1526+
}
15241527
else
15251528
{
15261529
return;
@@ -1734,7 +1737,9 @@ bool DeRestPluginPrivate::checkSensorBindingsForAttributeReporting(Sensor *senso
17341737
// Sinope
17351738
sensor->modelId() == QLatin1String("WL4200S") ||
17361739
//LifeControl smart plug
1737-
sensor->modelId() == QLatin1String("RICI01"))
1740+
sensor->modelId() == QLatin1String("RICI01"))||
1741+
// ORVIBO
1742+
sensor->modelId().startsWith(QLatin1String("SN10ZW")))
17381743
{
17391744
deviceSupported = true;
17401745
if (!sensor->node()->nodeDescriptor().receiverOnWhenIdle() ||

de_web_plugin.cpp

Lines changed: 73 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ static const SupportedDevice supportedDevices[] = {
209209
{ VENDOR_EMBER, "3AFE140103020000", konkeMacPrefix }, // Konke Kit Pro-FT Temp Humidity Sensor
210210
{ VENDOR_EMBER, "3AFE130104020015", konkeMacPrefix }, // Konke Kit Pro-Door Entry Sensor
211211
{ VENDOR_NONE, "RICI01", tiMacPrefix}, // LifeControl smart plug
212+
{ VENDOR_JENNIC, "SN10ZW", jennicMacPrefix }, // ORVIBO motion sensor
212213
{ 0, nullptr, 0 }
213214
};
214215

@@ -1547,6 +1548,7 @@ void DeRestPluginPrivate::addLightNode(const deCONZ::Node *node)
15471548

15481549
case DEV_ID_MAINS_POWER_OUTLET:
15491550
case DEV_ID_HA_ONOFF_LIGHT:
1551+
case DEV_ID_LEVEL_CONTROL_SWITCH:
15501552
case DEV_ID_ONOFF_OUTPUT:
15511553
case DEV_ID_LEVEL_CONTROLLABLE_OUTPUT:
15521554
case DEV_ID_HA_DIMMABLE_LIGHT:
@@ -1760,6 +1762,24 @@ void DeRestPluginPrivate::addLightNode(const deCONZ::Node *node)
17601762
{ q->nodeUpdated(lightNode.address().ext(), QLatin1String("modelid"), lightNode.modelId()); }
17611763
}
17621764

1765+
// "translate" ORVIBO vendor name
1766+
if (lightNode.manufacturer() == QString("欧瑞博"))
1767+
{
1768+
lightNode.setManufacturerName(QLatin1String("ORVIBO"));
1769+
lightNode.setNeedSaveDatabase(true);
1770+
}
1771+
// replace ORVIBO model IDs
1772+
if (lightNode.modelId() == QLatin1String("abb71ca5fe1846f185cfbda554046cce"))
1773+
{
1774+
lightNode.setModelId(QLatin1String("T10D1ZW dimmer"));
1775+
lightNode.setNeedSaveDatabase(true);
1776+
}
1777+
else if (lightNode.modelId() == QLatin1String("545df2981b704114945f6df1c780515a"))
1778+
{
1779+
lightNode.setModelId(QLatin1String("T10W1ZW switch"));
1780+
lightNode.setNeedSaveDatabase(true);
1781+
}
1782+
17631783
// add light node to default group
17641784
GroupInfo *groupInfo = getGroupInfo(&lightNode, gwGroup0);
17651785
if (!groupInfo)
@@ -2097,6 +2117,7 @@ LightNode *DeRestPluginPrivate::updateLightNode(const deCONZ::NodeEvent &event)
20972117
case DEV_ID_ZLL_DIMMABLE_PLUGIN_UNIT:
20982118
case DEV_ID_Z30_DIMMABLE_PLUGIN_UNIT:
20992119
case DEV_ID_HA_ONOFF_LIGHT:
2120+
case DEV_ID_LEVEL_CONTROL_SWITCH:
21002121
case DEV_ID_ONOFF_OUTPUT:
21012122
case DEV_ID_LEVEL_CONTROLLABLE_OUTPUT:
21022123
case DEV_ID_ZLL_ONOFF_LIGHT:
@@ -2473,6 +2494,17 @@ LightNode *DeRestPluginPrivate::updateLightNode(const deCONZ::NodeEvent &event)
24732494
QString str = ia->toString();
24742495
if (!str.isEmpty() && str != lightNode->manufacturer())
24752496
{
2497+
if (str == QString("欧瑞博"))
2498+
{
2499+
if (lightNode->manufacturer() == QLatin1String("ORVIBO"))
2500+
{
2501+
continue; // skip if already 'translated'
2502+
}
2503+
else
2504+
{
2505+
str = QLatin1String("ORVIBO");
2506+
}
2507+
}
24762508
lightNode->setManufacturerName(str);
24772509
lightNode->setNeedSaveDatabase(true);
24782510
queSaveDb(DB_LIGHTS, DB_LONG_SAVE_DELAY);
@@ -2486,6 +2518,28 @@ LightNode *DeRestPluginPrivate::updateLightNode(const deCONZ::NodeEvent &event)
24862518
ResourceItem *item = lightNode->item(RAttrModelId);
24872519
if (item && !str.isEmpty() && str != item->toString())
24882520
{
2521+
if (str == QLatin1String("abb71ca5fe1846f185cfbda554046cce"))
2522+
{
2523+
if (lightNode->modelId().startsWith(QLatin1String("T10D1ZW")))
2524+
{
2525+
continue; // skip if already replaced
2526+
}
2527+
else
2528+
{
2529+
str = QLatin1String("T10D1ZW dimmer");
2530+
}
2531+
}
2532+
else if (str == QLatin1String("545df2981b704114945f6df1c780515a"))
2533+
{
2534+
if (lightNode->modelId().startsWith(QLatin1String("T10W1ZW")))
2535+
{
2536+
continue; // skip if already replaced
2537+
}
2538+
else
2539+
{
2540+
str = QLatin1String("T10W1ZW switch");
2541+
}
2542+
}
24892543
lightNode->setModelId(str);
24902544
item->setValue(str);
24912545
lightNode->setNeedSaveDatabase(true);
@@ -3508,6 +3562,11 @@ void DeRestPluginPrivate::addSensorNode(const deCONZ::Node *node, const deCONZ::
35083562
else if (modelId.isEmpty() && j->id() == 0x0005) // model id
35093563
{
35103564
modelId = j->toString().trimmed();
3565+
// replace ORVIBO model ID
3566+
if (modelId == QLatin1String("895a2d80097f4ae2b2d40500d5e03dcc"))
3567+
{
3568+
modelId = QLatin1String("SN10ZW motion sensor");
3569+
}
35113570
}
35123571
}
35133572
}
@@ -3627,7 +3686,8 @@ void DeRestPluginPrivate::addSensorNode(const deCONZ::Node *node, const deCONZ::
36273686
}
36283687
else if (modelId.startsWith(QLatin1String("PIR_")) || // Heiman motion sensor
36293688
modelId == QLatin1String("3AFE14010402000D") || // Konke motion sensor
3630-
modelId.startsWith(QLatin1String("902010/22"))) // Bitron motion sensor
3689+
modelId.startsWith(QLatin1String("902010/22")) || // Bitron motion sensor
3690+
modelId.startsWith(QLatin1String("SN10ZW"))) // ORVIBO motion sensor
36313691
{
36323692
fpPresenceSensor.inClusters.push_back(ci->id());
36333693
}
@@ -5985,6 +6045,17 @@ void DeRestPluginPrivate::updateSensorNode(const deCONZ::NodeEvent &event)
59856045
{
59866046
if (i->modelId() != str)
59876047
{
6048+
if (str == QLatin1String("895a2d80097f4ae2b2d40500d5e03dcc"))
6049+
{
6050+
if (i->modelId().startsWith(QLatin1String("SN10ZW")))
6051+
{
6052+
continue; // skip if already replaced
6053+
}
6054+
else
6055+
{
6056+
str = QLatin1String("SN10ZW motion sensor");
6057+
}
6058+
}
59886059
i->setModelId(str);
59896060
i->setNeedSaveDatabase(true);
59906061
checkInstaModelId(&*i);
@@ -7285,6 +7356,7 @@ bool DeRestPluginPrivate::processZclAttributes(LightNode *lightNode)
72857356
//case DEV_ID_ZLL_DIMMABLE_LIGHT: // same as DEV_ID_HA_ONOFF_LIGHT
72867357
case DEV_ID_ZLL_DIMMABLE_PLUGIN_UNIT:
72877358
case DEV_ID_Z30_DIMMABLE_PLUGIN_UNIT:
7359+
case DEV_ID_LEVEL_CONTROL_SWITCH:
72887360
//fall through
72897361

72907362
case DEV_ID_MAINS_POWER_OUTLET:

light_node.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,9 +370,11 @@ void LightNode::setHaEndpoint(const deCONZ::SimpleDescriptor &endpoint)
370370
}
371371
else if (i->id() == COLOR_CLUSTER_ID)
372372
{
373-
if (manufacturerCode() == VENDOR_NONE && deviceId == DEV_ID_ZLL_DIMMABLE_LIGHT)
373+
if ((manufacturerCode() == VENDOR_NONE && deviceId == DEV_ID_ZLL_DIMMABLE_LIGHT) ||
374+
(manufacturerCode() == VENDOR_NONE && deviceId == DEV_ID_LEVEL_CONTROL_SWITCH))
374375
{
375376
// GLEDOPTO GL-C-009 advertises non-functional color cluster
377+
// ORVIBO T10D1ZW in-wall dimmer does the same
376378
}
377379
else
378380
{
@@ -490,6 +492,7 @@ void LightNode::setHaEndpoint(const deCONZ::SimpleDescriptor &endpoint)
490492
else { ltype = QLatin1String("Dimmable light"); }
491493
}
492494
break;
495+
case DEV_ID_LEVEL_CONTROL_SWITCH: ltype = QLatin1String("Level control switch"); break;
493496
case DEV_ID_ONOFF_OUTPUT: ltype = QLatin1String("On/Off output"); break;
494497
case DEV_ID_LEVEL_CONTROLLABLE_OUTPUT: ltype = QLatin1String("Level controllable output"); break;
495498
case DEV_ID_Z30_ONOFF_PLUGIN_UNIT: ltype = QLatin1String("On/Off plug-in unit"); break;

0 commit comments

Comments
 (0)