Skip to content

Commit

Permalink
Merge pull request dresden-elektronik#5719 from SwoopX/aqszb-110
Browse files Browse the repository at this point in the history
Add DDF for Develco/frient AQSZB-110 VOC sensor
  • Loading branch information
manup authored Jan 27, 2022
2 parents 2ae2e8c + 153d7b0 commit 3bdf256
Show file tree
Hide file tree
Showing 4 changed files with 740 additions and 0 deletions.
357 changes: 357 additions & 0 deletions devices/develco/aqszb-110_voc_sensor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,357 @@
{
"schema": "devcap1.schema.json",
"manufacturername": "Develco Products A/S",
"modelid": "AQSZB-110",
"vendor": "Develco Products",
"product": "AQSZB-110",
"sleeper": true,
"status": "Gold",
"path": "/devices/develco/aqszb-110_voc_sensor.json",
"subdevices": [
{
"type": "$TYPE_AIR_QUALITY_SENSOR",
"restapi": "/sensors",
"uuid": [
"$address.ext",
"0x26",
"0xfc03"
],
"fingerprint": {
"profile": "0x0104",
"device": "0x0302",
"endpoint": "0x26",
"in": [
"0xFC03"
]
},
"items": [
{
"name": "attr/id"
},
{
"name": "attr/lastannounced"
},
{
"name": "attr/lastseen"
},
{
"name": "attr/manufacturername",
"awake": true
},
{
"name": "attr/modelid",
"awake": true
},
{
"name": "attr/name"
},
{
"name": "attr/swversion",
"awake": true,
"refresh.interval": 84000,
"read": {
"at": "0x8000",
"cl": "0x0000",
"ep": 38,
"fn": "zcl"
},
"parse": {
"at": "0x8000",
"cl": "0x0000",
"ep": 38,
"fn": "zcl",
"script": "develco_firmware.js"
}
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "config/battery",
"awake": true,
"parse": {
"at": "0x0020",
"cl": "0x0001",
"ep": 38,
"script": "develco_battery.js"
}
},
{
"name": "config/on"
},
{
"name": "config/reachable"
},
{
"name": "state/airqualityppb",
"awake": true,
"parse": {
"at": "0x0000",
"cl": "0xfc03",
"ep": 38,
"fn": "zcl",
"mf": "0x1015",
"eval": "Item.val = Attr.val;"
}
},
{
"name": "state/airquality",
"awake": true,
"parse": {
"fn": "numtostr",
"srcitem": "state/airqualityppb",
"op": "le", "to": [65, "excellent", 220, "good", 660, "moderate", 5000, "unhealthy", 65535, "out of scale"]
}
},
{
"name": "state/lastupdated"
}
]
},
{
"type": "$TYPE_TEMPERATURE_SENSOR",
"restapi": "/sensors",
"uuid": [
"$address.ext",
"0x26",
"0x0402"
],
"fingerprint": {
"profile": "0x0104",
"device": "0x0302",
"endpoint": "0x26",
"in": [
"0x0001",
"0x0402"
]
},
"items": [
{
"name": "attr/id"
},
{
"name": "attr/lastannounced"
},
{
"name": "attr/lastseen"
},
{
"name": "attr/manufacturername",
"awake": true
},
{
"name": "attr/modelid",
"awake": true
},
{
"name": "attr/name"
},
{
"name": "attr/swversion",
"awake": true,
"refresh.interval": 84000,
"read": {
"at": "0x8000",
"cl": "0x0000",
"ep": 38,
"fn": "zcl"
},
"parse": {
"at": "0x8000",
"cl": "0x0000",
"ep": 38,
"fn": "zcl",
"script": "develco_firmware.js"
}
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "config/battery",
"awake": true,
"parse": {
"at": "0x0020",
"cl": "0x0001",
"ep": 38,
"script": "develco_battery.js"
}
},
{
"name": "config/offset",
"description": "Relative offset to the main measured value.",
"default": 0
},
{
"name": "config/on"
},
{
"name": "config/reachable"
},
{
"name": "state/lastupdated"
},
{
"name": "state/temperature",
"awake": true
}
]
},
{
"type": "$TYPE_HUMIDITY_SENSOR",
"restapi": "/sensors",
"uuid": [
"$address.ext",
"0x26",
"0x0405"
],
"fingerprint": {
"profile": "0x0104",
"device": "0x0302",
"endpoint": "0x26",
"in": [
"0x0001",
"0x0405"
]
},
"items": [
{
"name": "attr/id"
},
{
"name": "attr/lastannounced"
},
{
"name": "attr/lastseen"
},
{
"name": "attr/manufacturername",
"awake": true
},
{
"name": "attr/modelid",
"awake": true
},
{
"name": "attr/name"
},
{
"name": "attr/swversion",
"awake": true,
"refresh.interval": 84000,
"read": {
"at": "0x8000",
"cl": "0x0000",
"ep": 38,
"fn": "zcl"
},
"parse": {
"at": "0x8000",
"cl": "0x0000",
"ep": 38,
"fn": "zcl",
"script": "develco_firmware.js"
}
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "config/battery",
"awake": true,
"parse": {
"at": "0x0020",
"cl": "0x0001",
"ep": 38,
"script": "develco_battery.js"
}
},
{
"name": "config/offset",
"default": 0
},
{
"name": "config/on"
},
{
"name": "config/reachable"
},
{
"name": "state/humidity",
"awake": true
},
{
"name": "state/lastupdated"
}
]
}
],
"bindings": [
{
"bind": "unicast",
"src.ep": 38,
"cl": "0x0001",
"report": [
{
"at": "0x0020",
"dt": "0x20",
"min": 300,
"max": 43200,
"change": "0x00000001"
}
]
},
{
"bind": "unicast",
"src.ep": 38,
"cl": "0x0402",
"report": [
{
"at": "0x0000",
"dt": "0x29",
"min": 60,
"max": 600,
"change": "0x0000000A"
}
]
},
{
"bind": "unicast",
"src.ep": 38,
"cl": "0x0405",
"report": [
{
"at": "0x0000",
"dt": "0x21",
"min": 60,
"max": 600,
"change": "0x00000064"
}
]
},
{
"bind": "unicast",
"src.ep": 38,
"cl": "0xFC03",
"report": [
{
"at": "0x0000",
"dt": "0x21",
"mf": "0x1015",
"min": 60,
"max": 600,
"change": "0x0000000A"
}
]
}
]
}
13 changes: 13 additions & 0 deletions devices/develco/develco_battery.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const vmin = 26;
const vmax = 30;
let bat = Attr.val;

if (bat > vmax) { bat = vmax; }
else if (bat < vmin) { bat = vmin; }

bat = ((bat - vmin) /(vmax - vmin)) * 100;

if (bat > 100) { bat = 100; }
else if (bat <= 0) { bat = 1; } // ?

Item.val = bat;
Loading

0 comments on commit 3bdf256

Please sign in to comment.