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 DDF for Develco/frient SMSZB-120 smoke detector #5810

Merged
merged 1 commit into from
Feb 26, 2022
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
10 changes: 2 additions & 8 deletions bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -623,8 +623,7 @@ bool DeRestPluginPrivate::sendBindRequest(BindingTask &bt)
// Whitelist sensors which don't seem to have a valid node descriptor.
// This is a workaround currently only required for Develco smoke sensor
// and potentially Bosch motion sensor
if (s.modelId().startsWith(QLatin1String("SMSZB-1")) || // Develco smoke sensor
s.modelId().startsWith(QLatin1String("EMIZB-1")) || // Develco EMI Norwegian HAN
if (s.modelId().startsWith(QLatin1String("EMIZB-1")) || // Develco EMI Norwegian HAN
s.modelId().startsWith(QLatin1String("ISW-ZPR1-WP13"))) // Bosch motion sensor
{
}
Expand Down Expand Up @@ -1076,7 +1075,6 @@ bool DeRestPluginPrivate::sendConfigureReportingRequest(BindingTask &bt)
rq.attributeId = 0x0000; // measured value

if (modelId.startsWith(QLatin1String("AQSZB-1")) || // Develco air quality sensor
modelId.startsWith(QLatin1String("SMSZB-1")) || // Develco smoke sensor
modelId.startsWith(QLatin1String("HESZB-1")) || // Develco heat sensor
modelId.startsWith(QLatin1String("MOSZB-1")) || // Develco motion sensor
modelId.startsWith(QLatin1String("WISZB-1")) || // Develco window sensor
Expand Down Expand Up @@ -1919,7 +1917,6 @@ bool DeRestPluginPrivate::sendConfigureReportingRequest(BindingTask &bt)
rq.reportableChange8bit = 0;
}
else if (modelId.startsWith(QLatin1String("AQSZB-1")) || // Develco air quality sensor
modelId.startsWith(QLatin1String("SMSZB-1")) || // Develco smoke sensor
modelId.startsWith(QLatin1String("HESZB-1")) || // Develco heat sensor
modelId.startsWith(QLatin1String("MOSZB-1")) || // Develco motion sensor
modelId.startsWith(QLatin1String("WISZB-1")) || // Develco window sensor
Expand Down Expand Up @@ -2827,8 +2824,7 @@ bool DeRestPluginPrivate::checkSensorBindingsForAttributeReporting(Sensor *senso
// Whitelist sensors which don't seem to have a valid node descriptor.
// This is a workaround currently only required for Develco smoke sensor
// and potentially Bosch motion sensor
if (sensor->modelId().startsWith(QLatin1String("SMSZB-1")) || // Develco smoke sensor
sensor->modelId().startsWith(QLatin1String("EMIZB-1")) || // Develco EMI Norwegian HAN
if (sensor->modelId().startsWith(QLatin1String("EMIZB-1")) || // Develco EMI Norwegian HAN
sensor->modelId().startsWith(QLatin1String("ISW-ZPR1-WP13"))) // Bosch motion sensor
{
}
Expand Down Expand Up @@ -2984,7 +2980,6 @@ bool DeRestPluginPrivate::checkSensorBindingsForAttributeReporting(Sensor *senso
sensor->modelId().startsWith(QLatin1String("902010")) ||
// Develco
sensor->modelId().startsWith(QLatin1String("AQSZB-1")) || // air quality sensor
sensor->modelId().startsWith(QLatin1String("SMSZB-1")) || // smoke sensor
sensor->modelId().startsWith(QLatin1String("HESZB-1")) || // heat sensor
sensor->modelId().startsWith(QLatin1String("WISZB-1")) || // window sensor
sensor->modelId().startsWith(QLatin1String("FLSZB-1")) || // water leak sensor
Expand Down Expand Up @@ -3346,7 +3341,6 @@ bool DeRestPluginPrivate::checkSensorBindingsForAttributeReporting(Sensor *senso
}
else if (sensor->modelId() == QLatin1String("Motion Sensor-A") ||
sensor->modelId().startsWith(QLatin1String("AQSZB-1")) ||
sensor->modelId().startsWith(QLatin1String("SMSZB-1")) ||
sensor->modelId().startsWith(QLatin1String("HESZB-1")) ||
sensor->modelId().startsWith(QLatin1String("WISZB-1")) ||
sensor->modelId().startsWith(QLatin1String("MOSZB-1")) ||
Expand Down
12 changes: 2 additions & 10 deletions database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4183,16 +4183,8 @@ static int sqliteLoadAllSensorsCallback(void *user, int ncols, char **colval , c
{
item = sensor.addItem(DataTypeBool, RStateLowBattery);
item->setValue(false);
if (sensor.modelId().startsWith(QLatin1String("SMSZB-1"))) // Develco smoke detector
{
item = sensor.addItem(DataTypeBool, RStateTest);
item->setValue(false);
}
else
{
item = sensor.addItem(DataTypeBool, RStateTampered);
item->setValue(false);
}
item = sensor.addItem(DataTypeBool, RStateTampered);
item->setValue(false);
}
sensor.addItem(DataTypeUInt16, RConfigPending)->setValue(0);
sensor.addItem(DataTypeUInt32, RConfigEnrolled)->setValue(IAS_STATE_INIT);
Expand Down
14 changes: 2 additions & 12 deletions de_web_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,6 @@ static const SupportedDevice supportedDevices[] = {
{ VENDOR_STELPRO, "STZB402", xalMacPrefix }, // Stelpro baseboard thermostat
{ VENDOR_STELPRO, "SORB", xalMacPrefix }, // Stelpro Orleans Fan
{ VENDOR_DEVELCO, "AQSZB-1", develcoMacPrefix }, // Develco air quality sensor
{ VENDOR_DEVELCO, "SMSZB-1", develcoMacPrefix }, // Develco smoke sensor
{ VENDOR_DEVELCO, "HESZB-1", develcoMacPrefix }, // Develco heat sensor
{ VENDOR_DEVELCO, "SPLZB-1", develcoMacPrefix }, // Develco smart plug
{ VENDOR_DEVELCO, "WISZB-1", develcoMacPrefix }, // Develco window sensor
Expand Down Expand Up @@ -5989,7 +5988,6 @@ void DeRestPluginPrivate::addSensorNode(const deCONZ::Node *node, const deCONZ::
modelId.startsWith(QLatin1String("SMOK_")) || // Heiman fire sensor
modelId.startsWith(QLatin1String("Smoke")) || // Heiman fire sensor (newer model)
modelId.startsWith(QLatin1String("902010/24")) || // Bitron smoke detector
modelId.startsWith(QLatin1String("SMSZB-1")) || // Develco smoke detector
modelId.startsWith(QLatin1String("HESZB-1")) || // Develco heat detector
modelId.startsWith(QLatin1String("SF2")) || // ORVIBO (Heiman) smoke sensor
modelId == QLatin1String("358e4e3e03c644709905034dae81433e") || // Orvibo Combustible Gas Sensor
Expand Down Expand Up @@ -8179,16 +8177,8 @@ void DeRestPluginPrivate::addSensorNode(const deCONZ::Node *node, const SensorFi
{
item = sensorNode.addItem(DataTypeBool, RStateLowBattery);
item->setValue(false);
if (modelId.startsWith(QLatin1String("SMSZB-1"))) // Develco smoke detector
{
item = sensorNode.addItem(DataTypeBool, RStateTest);
item->setValue(false);
}
else
{
item = sensorNode.addItem(DataTypeBool, RStateTampered);
item->setValue(false);
}
item = sensorNode.addItem(DataTypeBool, RStateTampered);
item->setValue(false);
}
sensorNode.addItem(DataTypeUInt16, RConfigPending)->setValue(0);
sensorNode.addItem(DataTypeUInt32, RConfigEnrolled)->setValue(IAS_STATE_INIT);
Expand Down
290 changes: 290 additions & 0 deletions devices/develco/smszb-120_smoke_detector.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,290 @@
{
"schema": "devcap1.schema.json",
"manufacturername": "Develco Products A/S",
"modelid": "SMSZB-120",
"vendor": "Develco Products",
"product": "SMSZB-120",
"sleeper": false,
"status": "Gold",
"subdevices": [
{
"type": "$TYPE_FIRE_SENSOR",
"restapi": "/sensors",
"uuid": [
"$address.ext",
"0x23",
"0x0500"
],
"fingerprint": {
"profile": "0x0104",
"device": "0x0402",
"endpoint": "0x23",
"in": [
"0x0000",
"0x0001",
"0x0500"
]
},
"items": [
{
"name": "attr/id"
},
{
"name": "attr/lastannounced"
},
{
"name": "attr/lastseen"
},
{
"name": "attr/manufacturername"
},
{
"name": "attr/modelid"
},
{
"name": "attr/name"
},
{
"name": "attr/swversion",
"refresh.interval": 84000,
"read": {
"at": "0x8000",
"cl": "0x0000",
"ep": 35,
"fn": "zcl",
"mf": "0x1015"
},
"parse": {
"at": "0x8000",
"cl": "0x0000",
"ep": 35,
"fn": "zcl",
"mf": "0x1015",
"script": "develco_firmware.js"
}
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "config/battery",
"parse": {
"at": "0x0020",
"cl": "0x0001",
"ep": 35,
"script": "develco_battery.js"
}
},
{
"name": "config/enrolled"
},
{
"name": "config/on"
},
{
"name": "config/pending"
},
{
"name": "config/reachable"
},
{
"name": "state/fire"
},
{
"name": "state/lastupdated"
},
{
"name": "state/lowbattery"
},
{
"name": "state/test"
}
]
},
{
"type": "$TYPE_TEMPERATURE_SENSOR",
"restapi": "/sensors",
"uuid": [
"$address.ext",
"0x26",
"0x0402"
],
"fingerprint": {
"profile": "0x0104",
"device": "0x0302",
"endpoint": "0x26",
"in": [
"0x0000",
"0x0001",
"0x0402"
]
},
"items": [
{
"name": "attr/id"
},
{
"name": "attr/lastannounced"
},
{
"name": "attr/lastseen"
},
{
"name": "attr/manufacturername"
},
{
"name": "attr/modelid"
},
{
"name": "attr/name"
},
{
"name": "attr/swversion",
"refresh.interval": 84000,
"read": {
"at": "0x8000",
"cl": "0x0000",
"ep": 35,
"fn": "zcl",
"mf": "0x1015"
},
"parse": {
"at": "0x8000",
"cl": "0x0000",
"ep": 35,
"fn": "zcl",
"mf": "0x1015",
"script": "develco_firmware.js"
}
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "config/battery",
"parse": {
"at": "0x0020",
"cl": "0x0001",
"ep": 35,
"script": "develco_battery.js"
}
},
{
"name": "config/offset"
},
{
"name": "config/on"
},
{
"name": "config/reachable"
},
{
"name": "state/lastupdated"
},
{
"name": "state/temperature"
}
]
},
{
"type": "Warning device",
"restapi": "/lights",
"uuid": [
"$address.ext",
"0x23"
],
"items": [
{
"name": "attr/id"
},
{
"name": "attr/lastannounced"
},
{
"name": "attr/lastseen"
},
{
"name": "attr/manufacturername"
},
{
"name": "attr/modelid"
},
{
"name": "attr/name"
},
{
"name": "attr/swversion",
"refresh.interval": 84000,
"read": {
"at": "0x8000",
"cl": "0x0000",
"ep": 35,
"fn": "zcl",
"mf": "0x1015"
},
"parse": {
"at": "0x8000",
"cl": "0x0000",
"ep": 35,
"fn": "zcl",
"mf": "0x1015",
"script": "develco_firmware.js"
}
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "state/alert"
},
{
"name": "state/reachable"
}
]
}
],
"bindings": [
{
"bind": "unicast",
"src.ep": 35,
"cl": "0x0001",
"report": [
{
"at": "0x0020",
"dt": "0x20",
"min": 300,
"max": 43200,
"change": "0x00000001"
}
]
},
{
"bind": "unicast",
"src.ep": 35,
"cl": "0x0500"
},
{
"bind": "unicast",
"src.ep": 38,
"cl": "0x0402",
"report": [
{
"at": "0x0000",
"dt": "0x29",
"min": 60,
"max": 600,
"change": "0x0000000A"
}
]
}
]
}
Loading