diff --git a/bindings.cpp b/bindings.cpp index 67ff486..f82efd4 100644 --- a/bindings.cpp +++ b/bindings.cpp @@ -1037,7 +1037,8 @@ bool DeRestPluginPrivate::sendConfigureReportingRequest(BindingTask &bt) rq.maxInterval = 7200; // value used by Hue bridge rq.reportableChange8bit = 0; // value used by Hue bridge } - else if (sensor && sensor->modelId().startsWith(QLatin1String("RWL02"))) // Hue dimmer switch + else if (sensor && (sensor->modelId().startsWith(QLatin1String("RWL02")) || // Hue dimmer switch + sensor->modelId().startsWith(QLatin1String("ROM00")))) // Hue smart button { rq.minInterval = 300; // value used by Hue bridge rq.maxInterval = 300; // value used by Hue bridge @@ -1436,7 +1437,8 @@ bool DeRestPluginPrivate::sendConfigureReportingRequest(BindingTask &bt) { Sensor *sensor = dynamic_cast(bt.restNode); - if (sensor && sensor->modelId().startsWith(QLatin1String("RWL02"))) // Hue dimmer switch + if (sensor && (sensor->modelId().startsWith(QLatin1String("RWL02")) || // Hue dimmer switch + sensor->modelId().startsWith(QLatin1String("ROM00")))) // Hue smart button { deCONZ::NumericUnion val; val.u64 = 0; @@ -1701,6 +1703,7 @@ bool DeRestPluginPrivate::checkSensorBindingsForAttributeReporting(Sensor *senso // Philips sensor->modelId().startsWith(QLatin1String("SML00")) || sensor->modelId().startsWith(QLatin1String("RWL02")) || + sensor->modelId().startsWith(QLatin1String("ROM00")) || // ubisys sensor->modelId().startsWith(QLatin1String("C4")) || sensor->modelId().startsWith(QLatin1String("D1")) || @@ -1912,7 +1915,8 @@ bool DeRestPluginPrivate::checkSensorBindingsForAttributeReporting(Sensor *senso } else if (*i == VENDOR_CLUSTER_ID) { - if (sensor->modelId().startsWith(QLatin1String("RWL02"))) // Hue dimmer switch + if (sensor->modelId().startsWith(QLatin1String("RWL02")) || // Hue dimmer switch + sensor->modelId().startsWith(QLatin1String("ROM00"))) // Hue smart button { val = sensor->getZclValue(*i, 0x0000); // button event } @@ -2117,7 +2121,8 @@ bool DeRestPluginPrivate::checkSensorBindingsForClientClusters(Sensor *sensor) //quint8 srcEndpoint = sensor->fingerPrint().endpoint; std::vector clusters; - if (sensor->modelId().startsWith(QLatin1String("RWL02"))) // Hue dimmer switch + if (sensor->modelId().startsWith(QLatin1String("RWL02")) || // Hue dimmer switch + sensor->modelId().startsWith(QLatin1String("ROM00"))) { srcEndpoints.push_back(0x01); clusters.push_back(ONOFF_CLUSTER_ID); @@ -2358,7 +2363,8 @@ void DeRestPluginPrivate::checkSensorGroup(Sensor *sensor) } } - if (sensor->modelId().startsWith(QLatin1String("RWL02"))) // Hue dimmer switch + if (sensor->modelId().startsWith(QLatin1String("RWL02")) || // Hue dimmer switch + sensor->modelId().startsWith(QLatin1String("ROM00"))) { if (!group) { diff --git a/database.cpp b/database.cpp index 9bb3368..aa19160 100644 --- a/database.cpp +++ b/database.cpp @@ -3231,7 +3231,8 @@ static int sqliteLoadAllSensorsCallback(void *user, int ncols, char **colval , c item->setValue(100); } - if (sensor.modelId().startsWith(QLatin1String("RWL02"))) // Hue dimmer switch + if (sensor.modelId().startsWith(QLatin1String("RWL02")) || // Hue dimmer switch + sensor.modelId().startsWith(QLatin1String("ROM00"))) // Hue smart button { clusterId = VENDOR_CLUSTER_ID; endpoint = 2; diff --git a/de_web_plugin.cpp b/de_web_plugin.cpp index 7490bd5..c49dde7 100644 --- a/de_web_plugin.cpp +++ b/de_web_plugin.cpp @@ -144,6 +144,7 @@ static const SupportedDevice supportedDevices[] = { { VENDOR_NYCE, "3043", emberMacPrefix }, // NYCE ceiling motion sensor { VENDOR_PHILIPS, "RWL020", philipsMacPrefix }, // Hue dimmer switch { VENDOR_PHILIPS, "RWL021", philipsMacPrefix }, // Hue dimmer switch + { VENDOR_PHILIPS, "ROM001", philipsMacPrefix }, // Hue smart button { VENDOR_PHILIPS, "SML00", philipsMacPrefix }, // Hue motion sensor { VENDOR_SAMJIN, "motion", samjinMacPrefix }, // Smarthings GP-U999SJVLBAA (Samjin) Motion Sensor { VENDOR_SAMJIN, "multi", samjinMacPrefix }, // Smarthings (Samjin) Multipurpose Sensor diff --git a/sensor.cpp b/sensor.cpp index f55430b..f5817c5 100644 --- a/sensor.cpp +++ b/sensor.cpp @@ -131,6 +131,16 @@ static const Sensor::ButtonMap philipsDimmerSwitchMap[] = { { Sensor::ModeNone, 0x00, 0x0000, 0x00, 0, 0, nullptr } }; +static const Sensor::ButtonMap philipsSmartButtonMap[] = { +// mode ep cluster cmd param button name + { Sensor::ModeScenes, 0x01, 0x0006, 0x01, 0, S_BUTTON_1 + S_BUTTON_ACTION_SHORT_RELEASED, "On" }, + { Sensor::ModeScenes, 0x01, 0x0006, 0x40, 0, S_BUTTON_1 + S_BUTTON_ACTION_SHORT_RELEASED, "Off with effect" }, + { Sensor::ModeScenes, 0x01, 0x0008, 0x02, 0, S_BUTTON_1 + S_BUTTON_ACTION_HOLD, "Step up" }, + { Sensor::ModeScenes, 0x01, 0x0008, 0x03, 0, S_BUTTON_1 + S_BUTTON_ACTION_LONG_RELEASED, "Dimm stop" }, + { Sensor::ModeScenes, 0x01, 0x0008, 0x02, 1, S_BUTTON_1 + S_BUTTON_ACTION_HOLD, "Step down" }, + { Sensor::ModeNone, 0x00, 0x0000, 0x00, 0, 0, nullptr } +}; + static const Sensor::ButtonMap ikeaOnOffMap[] = { // mode ep cluster cmd param button name { Sensor::ModeScenes, 0x01, 0x0006, 0x01, 0, S_BUTTON_1 + S_BUTTON_ACTION_SHORT_RELEASED, "On" }, @@ -1133,6 +1143,7 @@ const Sensor::ButtonMap *Sensor::buttonMap() else if (manufacturer == QLatin1String("Philips")) { if (modelid.startsWith(QLatin1String("RWL02"))) { m_buttonMap = philipsDimmerSwitchMap; } + else if (modelid.startsWith(QLatin1String("ROM00"))) { m_buttonMap = philipsSmartButtonMap; } } else if (manufacturer == QLatin1String("Busch-Jaeger")) {