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 Envilar ZGR904-S remote #4502

Merged
merged 1 commit into from
Mar 3, 2021
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
5 changes: 4 additions & 1 deletion bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2665,6 +2665,8 @@ bool DeRestPluginPrivate::checkSensorBindingsForAttributeReporting(Sensor *senso
sensor->modelId().startsWith(QLatin1String("CSW_ADUROLIGHT")) ||
// iCasa
sensor->modelId().startsWith(QLatin1String("ICZB-RM")) ||
// Envilar
sensor->modelId() == QLatin1String("ZGR904-S") ||
// innr
sensor->modelId().startsWith(QLatin1String("SP ")) ||
sensor->modelId().startsWith(QLatin1String("RC 110")) ||
Expand Down Expand Up @@ -2692,7 +2694,7 @@ bool DeRestPluginPrivate::checkSensorBindingsForAttributeReporting(Sensor *senso
sensor->modelId().startsWith(QLatin1String("RC-EM")) ||
sensor->modelId().startsWith(QLatin1String("RC-EF-3.0")) ||
// lidl / SilverCrest
sensor->modelId()== QLatin1String("TY0203") || // Door sensor
sensor->modelId() == QLatin1String("TY0203") || // Door sensor
sensor->modelId() == QLatin1String("TY0202") || // Motion Sensor
sensor->modelId() == QLatin1String("TS0211") || // Door bell
// Konke
Expand Down Expand Up @@ -3532,6 +3534,7 @@ bool DeRestPluginPrivate::checkSensorBindingsForClientClusters(Sensor *sensor)
srcEndpoints.push_back(sensor->fingerPrint().endpoint);
}
else if (sensor->modelId().startsWith(QLatin1String("ICZB-RM")) ||
sensor->modelId().startsWith(QLatin1String("ZGR904-S")) ||
sensor->modelId().startsWith(QLatin1String("ZGRC-KEY-013")) ||
sensor->modelId().startsWith(QLatin1String("RGBgenie ZB-5001")))
{
Expand Down
34 changes: 21 additions & 13 deletions de_web_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ static const SupportedDevice supportedDevices[] = {
{ VENDOR_INNR, "RC 110", jennicMacPrefix }, // innr remote RC 110
{ VENDOR_VISONIC, "MCT-340", emberMacPrefix }, // Visonic MCT-340 E temperature/motion
{ VENDOR_SUNRICHER, "ED-1001", silabs2MacPrefix }, // EcoDim wireless switches
{ VENDOR_SUNRICHER, "ZGR904-S", emberMacPrefix }, // Envilar remote
{ VENDOR_SUNRICHER, "ICZB-KPD1", emberMacPrefix }, // iCasa keypad
{ VENDOR_SUNRICHER, "ICZB-RM", silabs2MacPrefix }, // iCasa remote
{ VENDOR_SUNRICHER, "ZGRC-KEY", emberMacPrefix }, // Sunricher wireless CCT remote
Expand Down Expand Up @@ -1053,25 +1054,26 @@ void DeRestPluginPrivate::apsdeDataIndication(const deCONZ::ApsDataIndication &i
{
// Hue dimmer switch
}
else if (sensorNode->modelId().startsWith("C4") || // ubisys
sensorNode->modelId().startsWith("RC 110") || // innr RC 110
sensorNode->modelId().startsWith("ICZB-RM") || // icasa remote
sensorNode->modelId().startsWith("ZGRC-KEY") || // Sunricher remote
sensorNode->modelId().startsWith("ED-1001") || // EcoDim switches
sensorNode->modelId().startsWith("45127") || // Namron switches
else if (sensorNode->modelId().startsWith(QLatin1String("C4")) || // ubisys
sensorNode->modelId().startsWith(QLatin1String("RC 110")) || // innr RC 110
sensorNode->modelId().startsWith(QLatin1String("ICZB-RM")) || // icasa remote
sensorNode->modelId().startsWith(QLatin1String("ZGR904-S")) || // Envilar remote
sensorNode->modelId().startsWith(QLatin1String("ZGRC-KEY")) || // Sunricher remote
sensorNode->modelId().startsWith(QLatin1String("ED-1001")) || // EcoDim switches
sensorNode->modelId().startsWith(QLatin1String("45127")) || // Namron switches
sensorNode->modelId().startsWith(QLatin1String("Lightify Switch Mini")) || // Osram 3 button remote
sensorNode->modelId().startsWith(QLatin1String("Switch 4x EU-LIGHTIFY")) || // Osram 4 button remote
sensorNode->modelId().startsWith(QLatin1String("Switch 4x-LIGHTIFY")) || // Osram 4 button remote
sensorNode->modelId().startsWith(QLatin1String("Switch-LIGHTIFY")) ) // Osram 4 button remote
{
sensorNode = getSensorNodeForAddressAndEndpoint(ind.srcAddress(), 0x01);
}
else if (sensorNode->modelId().startsWith("D1") || // ubisys
sensorNode->modelId().startsWith("S1")) // ubisys
else if (sensorNode->modelId().startsWith(QLatin1String("D1")) || // ubisys
sensorNode->modelId().startsWith(QLatin1String("S1"))) // ubisys
{
sensorNode = getSensorNodeForAddressAndEndpoint(ind.srcAddress(), 0x02);
}
else if (sensorNode->modelId().startsWith("S2"))
else if (sensorNode->modelId().startsWith(QLatin1String("S2")))
{
sensorNode = getSensorNodeForAddressAndEndpoint(ind.srcAddress(), 0x03);
}
Expand Down Expand Up @@ -4029,6 +4031,7 @@ void DeRestPluginPrivate::checkSensorButtonEvent(Sensor *sensor, const deCONZ::A
checkClientCluster = true;
}
else if (sensor->modelId().startsWith(QLatin1String("ICZB-RM")) || // icasa remote
sensor->modelId().startsWith(QLatin1String("ZGR904-S")) || // Envilar remote
sensor->modelId().startsWith(QLatin1String("RGBGenie ZB-5")) || // RGBGenie remote control
sensor->modelId().startsWith(QLatin1String("ZGRC-KEY"))) // RGBGenie ZB-5001
{
Expand Down Expand Up @@ -4137,6 +4140,7 @@ void DeRestPluginPrivate::checkSensorButtonEvent(Sensor *sensor, const deCONZ::A
enqueueEvent(e);
}
else if (sensor->modelId().startsWith(QLatin1String("ICZB-RM")) || // icasa remote
sensor->modelId().startsWith(QLatin1String("ZGR904-S")) || // Envilar remote
sensor->modelId().startsWith(QLatin1String("ZGRC-KEY")) || // Sunricher remote
sensor->modelId().startsWith(QLatin1String("ED-1001")) || // EcoDim switches
sensor->modelId().startsWith(QLatin1String("45127")) || // Namron switches
Expand Down Expand Up @@ -5627,11 +5631,12 @@ void DeRestPluginPrivate::addSensorNode(const deCONZ::Node *node, const deCONZ::
{
fpSwitch.outClusters.push_back(ci->id());
}
else if (modelId.startsWith(QLatin1String("RC 110")) || // innr RC 110
modelId.startsWith(QLatin1String("ICZB-RM")) || // icasa remote
else if (modelId.startsWith(QLatin1String("RC 110")) || // innr RC 110
modelId.startsWith(QLatin1String("ICZB-RM")) || // icasa remote
modelId.startsWith(QLatin1String("ZGR904-S")) || // Envilar remote
modelId.startsWith(QLatin1String("ZGRC-KEY")) || // Sunricher remote
modelId.startsWith(QLatin1String("ED-1001")) || // EcoDim switches
modelId.startsWith(QLatin1String("45127"))) // Namron switches
modelId.startsWith(QLatin1String("ED-1001")) || // EcoDim switches
modelId.startsWith(QLatin1String("45127"))) // Namron switches
{
if (i->endpoint() == 0x01) // create sensor only for first endpoint
{
Expand Down Expand Up @@ -7674,6 +7679,7 @@ void DeRestPluginPrivate::updateSensorNode(const deCONZ::NodeEvent &event)
i->modelId().startsWith(QLatin1String("KADRILJ")) || // IKEA
i->modelId().startsWith(QLatin1String("SYMFONISK")) || // IKEA
i->modelId().startsWith(QLatin1String("ICZB-")) || // iCasa keypads and remote
i->modelId().startsWith(QLatin1String("ZGR904-S")) || // Envilar remote
i->modelId().startsWith(QLatin1String("ED-1001")) || // EcoDim wireless switches
i->modelId().startsWith(QLatin1String("ZGRC-KEY")) || // Sunricher wireless CCT remote
i->modelId().startsWith(QLatin1String("ZG2833K")) || // Sunricher remote controller
Expand Down Expand Up @@ -7718,6 +7724,7 @@ void DeRestPluginPrivate::updateSensorNode(const deCONZ::NodeEvent &event)
if (i->modelId().startsWith(QLatin1String("TRADFRI")) || // IKEA
i->modelId().startsWith(QLatin1String("SYMFONISK")) || // IKEA
i->modelId().startsWith(QLatin1String("ICZB-")) || // iCasa keypads and remote
i->modelId().startsWith(QLatin1String("ZGR904-S")) || // Envilar remote
i->modelId().startsWith(QLatin1String("ED-1001")) || // EcoDim wireless switches
i->modelId().startsWith(QLatin1String("ZGRC-KEY")) || // Sunricher wireless CCT remote
i->modelId().startsWith(QLatin1String("ZG2833K")) || // Sunricher remote controller
Expand Down Expand Up @@ -16715,6 +16722,7 @@ void DeRestPluginPrivate::delayedFastEnddeviceProbe(const deCONZ::NodeEvent *eve
checkSensorBindingsForClientClusters(sensor);
}
else if (sensor->modelId().startsWith(QLatin1String("ICZB-RM")) || // icasa remote
sensor->modelId().startsWith(QLatin1String("ZGR904-S")) || // Envilar remote
sensor->modelId().startsWith(QLatin1String("ZGRC-KEY"))) // Sunricher remote
{
quint8 lastEndpoint;
Expand Down