From 2079ef4f70c662366bf42b9ca4aaa89ea9b0d244 Mon Sep 17 00:00:00 2001 From: elratt0r <6256988+elratt0r@users.noreply.github.com> Date: Wed, 16 Oct 2024 10:10:08 +0200 Subject: [PATCH 1/7] add DDF for b-parasite plant sensor See https://github.com/rbaron/b-parasite --- devices/b-parasite/b-parasite.json | 411 +++++++++++++++++++++++++++++ 1 file changed, 411 insertions(+) create mode 100644 devices/b-parasite/b-parasite.json diff --git a/devices/b-parasite/b-parasite.json b/devices/b-parasite/b-parasite.json new file mode 100644 index 0000000000..d00cb77587 --- /dev/null +++ b/devices/b-parasite/b-parasite.json @@ -0,0 +1,411 @@ +{ + "schema": "devcap1.schema.json", + "uuid": "7ad2d274-5bb0-40f1-926b-4d9d059ce393", + "manufacturername": "b-parasite", + "modelid": "b-parasite", + "product": "b-parasite", + "sleeper": true, + "status": "Gold", + "subdevices": [ + { + "type": "$TYPE_TEMPERATURE_SENSOR", + "restapi": "/sensors", + "uuid": [ + "$address.ext", + "0x0a", + "0x0402" + ], + "items": [ + { + "name": "attr/id" + }, + { + "name": "attr/lastannounced" + }, + { + "name": "attr/lastseen" + }, + { + "name": "attr/manufacturername" + }, + { + "name": "attr/modelid" + }, + { + "name": "attr/name" + }, + { + "name": "attr/swversion" + }, + { + "name": "attr/type" + }, + { + "name": "attr/uniqueid" + }, + { + "name": "config/battery", + "refresh.interval": 86400, + "read": { + "at": "0x0021", + "cl": "0x0001", + "ep": 10, + "fn": "zcl:attr" + }, + "parse": { + "at": "0x0021", + "cl": "0x0001", + "ep": 10, + "eval": "Item.val = Attr.val / 2", + "fn": "zcl:attr" + } + }, + { + "name": "config/offset", + "default": 0 + }, + { + "name": "config/on" + }, + { + "name": "config/reachable" + }, + { + "name": "state/lastupdated" + }, + { + "name": "state/temperature", + "parse": { + "at": "0x0000", + "cl": "0x0402", + "ep": 10, + "eval": "Item.val = Attr.val + R.item('config/offset').val", + "fn": "zcl:attr" + }, + "default": 0 + } + ] + }, + { + "type": "$TYPE_HUMIDITY_SENSOR", + "restapi": "/sensors", + "uuid": [ + "$address.ext", + "0x0a", + "0x0405" + ], + "items": [ + { + "name": "attr/id" + }, + { + "name": "attr/lastannounced" + }, + { + "name": "attr/lastseen" + }, + { + "name": "attr/manufacturername" + }, + { + "name": "attr/modelid" + }, + { + "name": "attr/name" + }, + { + "name": "attr/swversion" + }, + { + "name": "attr/type" + }, + { + "name": "attr/uniqueid" + }, + { + "name": "config/battery", + "refresh.interval": 86400, + "read": { + "at": "0x0021", + "cl": "0x0001", + "ep": 10, + "fn": "zcl:attr" + }, + "parse": { + "at": "0x0021", + "cl": "0x0001", + "ep": 10, + "eval": "Item.val = Attr.val / 2", + "fn": "zcl:attr" + } + }, + { + "name": "config/offset", + "default": 0 + }, + { + "name": "config/on" + }, + { + "name": "config/reachable" + }, + { + "name": "state/humidity", + "parse": { + "at": "0x0000", + "cl": "0x0405", + "ep": 10, + "eval": "Item.val = Attr.val + R.item('config/offset').val", + "fn": "zcl:attr" + }, + "default": 0 + }, + { + "name": "state/lastupdated" + } + ] + }, + { + "type": "$TYPE_MOISTURE_SENSOR", + "restapi": "/sensors", + "uuid": [ + "$address.ext", + "0x0a", + "0x0408" + ], + "items": [ + { + "name": "attr/id" + }, + { + "name": "attr/lastannounced" + }, + { + "name": "attr/lastseen" + }, + { + "name": "attr/manufacturername" + }, + { + "name": "attr/modelid" + }, + { + "name": "attr/name" + }, + { + "name": "attr/swversion" + }, + { + "name": "attr/type" + }, + { + "name": "attr/uniqueid" + }, + { + "name": "config/battery", + "refresh.interval": 86400, + "read": { + "at": "0x0021", + "cl": "0x0001", + "ep": 10, + "fn": "zcl:attr" + }, + "parse": { + "at": "0x0021", + "cl": "0x0001", + "ep": 10, + "eval": "Item.val = Attr.val / 2", + "fn": "zcl:attr" + } + }, + { + "name": "config/offset", + "default": 0 + }, + { + "name": "config/on" + }, + { + "name": "config/reachable" + }, + { + "name": "state/lastupdated" + }, + { + "name": "state/moisture", + "parse": { + "at": "0x0000", + "cl": "0x0408", + "ep": 10, + "eval": "Item.val = Attr.val + R.item('config/offset').val", + "fn": "zcl:attr" + }, + "default": 0 + } + ] + }, + { + "type": "$TYPE_LIGHT_LEVEL_SENSOR", + "restapi": "/sensors", + "uuid": [ + "$address.ext", + "0x0a", + "0x0400" + ], + "items": [ + { + "name": "attr/id" + }, + { + "name": "attr/lastannounced" + }, + { + "name": "attr/lastseen" + }, + { + "name": "attr/manufacturername" + }, + { + "name": "attr/modelid" + }, + { + "name": "attr/name" + }, + { + "name": "attr/swversion" + }, + { + "name": "attr/type" + }, + { + "name": "attr/uniqueid" + }, + { + "name": "config/battery", + "refresh.interval": 86400, + "read": { + "at": "0x0021", + "cl": "0x0001", + "ep": 10, + "fn": "zcl:attr" + }, + "parse": { + "at": "0x0021", + "cl": "0x0001", + "ep": 10, + "eval": "Item.val = Attr.val / 2", + "fn": "zcl:attr" + } + }, + { + "name": "config/on" + }, + { + "name": "config/reachable" + }, + { + "name": "config/tholddark", + "default": 12000 + }, + { + "name": "config/tholdoffset", + "default": 7000 + }, + { + "name": "state/dark", + "default": false + }, + { + "name": "state/daylight", + "default": false + }, + { + "name": "state/lastupdated" + }, + { + "name": "state/lightlevel", + "parse": { + "at": "0x0000", + "cl": "0x0400", + "ep": 10, + "eval": "Item.val = Attr.val", + "fn": "zcl:attr" + }, + "default": 0 + }, + { + "name": "state/lux", + "default": 0 + } + ] + } + ], + "bindings": [ + { + "bind": "unicast", + "src.ep": 10, + "cl": "0x0402", + "report": [ + { + "at": "0x0000", + "dt": "0x29", + "min": 60, + "max": 3600 + } + ] + }, + { + "bind": "unicast", + "src.ep": 10, + "cl": "0x0405", + "report": [ + { + "at": "0x0000", + "dt": "0x21", + "min": 60, + "max": 3600 + } + ] + }, + { + "bind": "unicast", + "src.ep": 10, + "cl": "0x0408", + "report": [ + { + "at": "0x0000", + "dt": "0x21", + "min": 60, + "max": 3600 + } + ] + }, + { + "bind": "unicast", + "src.ep": 10, + "cl": "0x0400", + "report": [ + { + "at": "0x0000", + "dt": "0x21", + "min": 60, + "max": 3600 + } + ] + }, + { + "bind": "unicast", + "src.ep": 10, + "cl": "0x0001", + "report": [ + { + "at": "0x0021", + "dt": "0x20", + "min": 3600, + "max": 62000, + "change": "0x00000001" + } + ] + } + ] +} From 1c7bb358319e7d5c1462cd49d81c73a2c449b6fd Mon Sep 17 00:00:00 2001 From: elratt0r <6256988+elratt0r@users.noreply.github.com> Date: Thu, 17 Oct 2024 19:06:38 +0200 Subject: [PATCH 2/7] =?UTF-8?q?DDF=20b-parasite=20-=20add=20reasonable=20r?= =?UTF-8?q?eport=20change=20values=20(0.5=C2=B0C,=200.5%,=205lx)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- devices/b-parasite/b-parasite.json | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/devices/b-parasite/b-parasite.json b/devices/b-parasite/b-parasite.json index d00cb77587..054246584a 100644 --- a/devices/b-parasite/b-parasite.json +++ b/devices/b-parasite/b-parasite.json @@ -350,7 +350,8 @@ "at": "0x0000", "dt": "0x29", "min": 60, - "max": 3600 + "max": 3600, + "change": "0x00000032" } ] }, @@ -363,7 +364,8 @@ "at": "0x0000", "dt": "0x21", "min": 60, - "max": 3600 + "max": 3600, + "change": "0x00000032" } ] }, @@ -376,7 +378,8 @@ "at": "0x0000", "dt": "0x21", "min": 60, - "max": 3600 + "max": 3600, + "change": "0x00000032" } ] }, @@ -389,7 +392,8 @@ "at": "0x0000", "dt": "0x21", "min": 60, - "max": 3600 + "max": 3600, + "change": "0x00000005" } ] }, From 7945cc5ba46e0f59312234d7aeb12285f04fca08 Mon Sep 17 00:00:00 2001 From: elratt0r <6256988+elratt0r@users.noreply.github.com> Date: Thu, 17 Oct 2024 19:07:26 +0200 Subject: [PATCH 3/7] DDF b-parasite - correct fileformat from CRLF to LF --- devices/b-parasite/b-parasite.json | 830 ++++++++++++++--------------- 1 file changed, 415 insertions(+), 415 deletions(-) diff --git a/devices/b-parasite/b-parasite.json b/devices/b-parasite/b-parasite.json index 054246584a..7a2db3e662 100644 --- a/devices/b-parasite/b-parasite.json +++ b/devices/b-parasite/b-parasite.json @@ -1,415 +1,415 @@ -{ - "schema": "devcap1.schema.json", - "uuid": "7ad2d274-5bb0-40f1-926b-4d9d059ce393", - "manufacturername": "b-parasite", - "modelid": "b-parasite", - "product": "b-parasite", - "sleeper": true, - "status": "Gold", - "subdevices": [ - { - "type": "$TYPE_TEMPERATURE_SENSOR", - "restapi": "/sensors", - "uuid": [ - "$address.ext", - "0x0a", - "0x0402" - ], - "items": [ - { - "name": "attr/id" - }, - { - "name": "attr/lastannounced" - }, - { - "name": "attr/lastseen" - }, - { - "name": "attr/manufacturername" - }, - { - "name": "attr/modelid" - }, - { - "name": "attr/name" - }, - { - "name": "attr/swversion" - }, - { - "name": "attr/type" - }, - { - "name": "attr/uniqueid" - }, - { - "name": "config/battery", - "refresh.interval": 86400, - "read": { - "at": "0x0021", - "cl": "0x0001", - "ep": 10, - "fn": "zcl:attr" - }, - "parse": { - "at": "0x0021", - "cl": "0x0001", - "ep": 10, - "eval": "Item.val = Attr.val / 2", - "fn": "zcl:attr" - } - }, - { - "name": "config/offset", - "default": 0 - }, - { - "name": "config/on" - }, - { - "name": "config/reachable" - }, - { - "name": "state/lastupdated" - }, - { - "name": "state/temperature", - "parse": { - "at": "0x0000", - "cl": "0x0402", - "ep": 10, - "eval": "Item.val = Attr.val + R.item('config/offset').val", - "fn": "zcl:attr" - }, - "default": 0 - } - ] - }, - { - "type": "$TYPE_HUMIDITY_SENSOR", - "restapi": "/sensors", - "uuid": [ - "$address.ext", - "0x0a", - "0x0405" - ], - "items": [ - { - "name": "attr/id" - }, - { - "name": "attr/lastannounced" - }, - { - "name": "attr/lastseen" - }, - { - "name": "attr/manufacturername" - }, - { - "name": "attr/modelid" - }, - { - "name": "attr/name" - }, - { - "name": "attr/swversion" - }, - { - "name": "attr/type" - }, - { - "name": "attr/uniqueid" - }, - { - "name": "config/battery", - "refresh.interval": 86400, - "read": { - "at": "0x0021", - "cl": "0x0001", - "ep": 10, - "fn": "zcl:attr" - }, - "parse": { - "at": "0x0021", - "cl": "0x0001", - "ep": 10, - "eval": "Item.val = Attr.val / 2", - "fn": "zcl:attr" - } - }, - { - "name": "config/offset", - "default": 0 - }, - { - "name": "config/on" - }, - { - "name": "config/reachable" - }, - { - "name": "state/humidity", - "parse": { - "at": "0x0000", - "cl": "0x0405", - "ep": 10, - "eval": "Item.val = Attr.val + R.item('config/offset').val", - "fn": "zcl:attr" - }, - "default": 0 - }, - { - "name": "state/lastupdated" - } - ] - }, - { - "type": "$TYPE_MOISTURE_SENSOR", - "restapi": "/sensors", - "uuid": [ - "$address.ext", - "0x0a", - "0x0408" - ], - "items": [ - { - "name": "attr/id" - }, - { - "name": "attr/lastannounced" - }, - { - "name": "attr/lastseen" - }, - { - "name": "attr/manufacturername" - }, - { - "name": "attr/modelid" - }, - { - "name": "attr/name" - }, - { - "name": "attr/swversion" - }, - { - "name": "attr/type" - }, - { - "name": "attr/uniqueid" - }, - { - "name": "config/battery", - "refresh.interval": 86400, - "read": { - "at": "0x0021", - "cl": "0x0001", - "ep": 10, - "fn": "zcl:attr" - }, - "parse": { - "at": "0x0021", - "cl": "0x0001", - "ep": 10, - "eval": "Item.val = Attr.val / 2", - "fn": "zcl:attr" - } - }, - { - "name": "config/offset", - "default": 0 - }, - { - "name": "config/on" - }, - { - "name": "config/reachable" - }, - { - "name": "state/lastupdated" - }, - { - "name": "state/moisture", - "parse": { - "at": "0x0000", - "cl": "0x0408", - "ep": 10, - "eval": "Item.val = Attr.val + R.item('config/offset').val", - "fn": "zcl:attr" - }, - "default": 0 - } - ] - }, - { - "type": "$TYPE_LIGHT_LEVEL_SENSOR", - "restapi": "/sensors", - "uuid": [ - "$address.ext", - "0x0a", - "0x0400" - ], - "items": [ - { - "name": "attr/id" - }, - { - "name": "attr/lastannounced" - }, - { - "name": "attr/lastseen" - }, - { - "name": "attr/manufacturername" - }, - { - "name": "attr/modelid" - }, - { - "name": "attr/name" - }, - { - "name": "attr/swversion" - }, - { - "name": "attr/type" - }, - { - "name": "attr/uniqueid" - }, - { - "name": "config/battery", - "refresh.interval": 86400, - "read": { - "at": "0x0021", - "cl": "0x0001", - "ep": 10, - "fn": "zcl:attr" - }, - "parse": { - "at": "0x0021", - "cl": "0x0001", - "ep": 10, - "eval": "Item.val = Attr.val / 2", - "fn": "zcl:attr" - } - }, - { - "name": "config/on" - }, - { - "name": "config/reachable" - }, - { - "name": "config/tholddark", - "default": 12000 - }, - { - "name": "config/tholdoffset", - "default": 7000 - }, - { - "name": "state/dark", - "default": false - }, - { - "name": "state/daylight", - "default": false - }, - { - "name": "state/lastupdated" - }, - { - "name": "state/lightlevel", - "parse": { - "at": "0x0000", - "cl": "0x0400", - "ep": 10, - "eval": "Item.val = Attr.val", - "fn": "zcl:attr" - }, - "default": 0 - }, - { - "name": "state/lux", - "default": 0 - } - ] - } - ], - "bindings": [ - { - "bind": "unicast", - "src.ep": 10, - "cl": "0x0402", - "report": [ - { - "at": "0x0000", - "dt": "0x29", - "min": 60, - "max": 3600, - "change": "0x00000032" - } - ] - }, - { - "bind": "unicast", - "src.ep": 10, - "cl": "0x0405", - "report": [ - { - "at": "0x0000", - "dt": "0x21", - "min": 60, - "max": 3600, - "change": "0x00000032" - } - ] - }, - { - "bind": "unicast", - "src.ep": 10, - "cl": "0x0408", - "report": [ - { - "at": "0x0000", - "dt": "0x21", - "min": 60, - "max": 3600, - "change": "0x00000032" - } - ] - }, - { - "bind": "unicast", - "src.ep": 10, - "cl": "0x0400", - "report": [ - { - "at": "0x0000", - "dt": "0x21", - "min": 60, - "max": 3600, - "change": "0x00000005" - } - ] - }, - { - "bind": "unicast", - "src.ep": 10, - "cl": "0x0001", - "report": [ - { - "at": "0x0021", - "dt": "0x20", - "min": 3600, - "max": 62000, - "change": "0x00000001" - } - ] - } - ] -} +{ + "schema": "devcap1.schema.json", + "uuid": "7ad2d274-5bb0-40f1-926b-4d9d059ce393", + "manufacturername": "b-parasite", + "modelid": "b-parasite", + "product": "b-parasite", + "sleeper": true, + "status": "Gold", + "subdevices": [ + { + "type": "$TYPE_TEMPERATURE_SENSOR", + "restapi": "/sensors", + "uuid": [ + "$address.ext", + "0x0a", + "0x0402" + ], + "items": [ + { + "name": "attr/id" + }, + { + "name": "attr/lastannounced" + }, + { + "name": "attr/lastseen" + }, + { + "name": "attr/manufacturername" + }, + { + "name": "attr/modelid" + }, + { + "name": "attr/name" + }, + { + "name": "attr/swversion" + }, + { + "name": "attr/type" + }, + { + "name": "attr/uniqueid" + }, + { + "name": "config/battery", + "refresh.interval": 86400, + "read": { + "at": "0x0021", + "cl": "0x0001", + "ep": 10, + "fn": "zcl:attr" + }, + "parse": { + "at": "0x0021", + "cl": "0x0001", + "ep": 10, + "eval": "Item.val = Attr.val / 2", + "fn": "zcl:attr" + } + }, + { + "name": "config/offset", + "default": 0 + }, + { + "name": "config/on" + }, + { + "name": "config/reachable" + }, + { + "name": "state/lastupdated" + }, + { + "name": "state/temperature", + "parse": { + "at": "0x0000", + "cl": "0x0402", + "ep": 10, + "eval": "Item.val = Attr.val + R.item('config/offset').val", + "fn": "zcl:attr" + }, + "default": 0 + } + ] + }, + { + "type": "$TYPE_HUMIDITY_SENSOR", + "restapi": "/sensors", + "uuid": [ + "$address.ext", + "0x0a", + "0x0405" + ], + "items": [ + { + "name": "attr/id" + }, + { + "name": "attr/lastannounced" + }, + { + "name": "attr/lastseen" + }, + { + "name": "attr/manufacturername" + }, + { + "name": "attr/modelid" + }, + { + "name": "attr/name" + }, + { + "name": "attr/swversion" + }, + { + "name": "attr/type" + }, + { + "name": "attr/uniqueid" + }, + { + "name": "config/battery", + "refresh.interval": 86400, + "read": { + "at": "0x0021", + "cl": "0x0001", + "ep": 10, + "fn": "zcl:attr" + }, + "parse": { + "at": "0x0021", + "cl": "0x0001", + "ep": 10, + "eval": "Item.val = Attr.val / 2", + "fn": "zcl:attr" + } + }, + { + "name": "config/offset", + "default": 0 + }, + { + "name": "config/on" + }, + { + "name": "config/reachable" + }, + { + "name": "state/humidity", + "parse": { + "at": "0x0000", + "cl": "0x0405", + "ep": 10, + "eval": "Item.val = Attr.val + R.item('config/offset').val", + "fn": "zcl:attr" + }, + "default": 0 + }, + { + "name": "state/lastupdated" + } + ] + }, + { + "type": "$TYPE_MOISTURE_SENSOR", + "restapi": "/sensors", + "uuid": [ + "$address.ext", + "0x0a", + "0x0408" + ], + "items": [ + { + "name": "attr/id" + }, + { + "name": "attr/lastannounced" + }, + { + "name": "attr/lastseen" + }, + { + "name": "attr/manufacturername" + }, + { + "name": "attr/modelid" + }, + { + "name": "attr/name" + }, + { + "name": "attr/swversion" + }, + { + "name": "attr/type" + }, + { + "name": "attr/uniqueid" + }, + { + "name": "config/battery", + "refresh.interval": 86400, + "read": { + "at": "0x0021", + "cl": "0x0001", + "ep": 10, + "fn": "zcl:attr" + }, + "parse": { + "at": "0x0021", + "cl": "0x0001", + "ep": 10, + "eval": "Item.val = Attr.val / 2", + "fn": "zcl:attr" + } + }, + { + "name": "config/offset", + "default": 0 + }, + { + "name": "config/on" + }, + { + "name": "config/reachable" + }, + { + "name": "state/lastupdated" + }, + { + "name": "state/moisture", + "parse": { + "at": "0x0000", + "cl": "0x0408", + "ep": 10, + "eval": "Item.val = Attr.val + R.item('config/offset').val", + "fn": "zcl:attr" + }, + "default": 0 + } + ] + }, + { + "type": "$TYPE_LIGHT_LEVEL_SENSOR", + "restapi": "/sensors", + "uuid": [ + "$address.ext", + "0x0a", + "0x0400" + ], + "items": [ + { + "name": "attr/id" + }, + { + "name": "attr/lastannounced" + }, + { + "name": "attr/lastseen" + }, + { + "name": "attr/manufacturername" + }, + { + "name": "attr/modelid" + }, + { + "name": "attr/name" + }, + { + "name": "attr/swversion" + }, + { + "name": "attr/type" + }, + { + "name": "attr/uniqueid" + }, + { + "name": "config/battery", + "refresh.interval": 86400, + "read": { + "at": "0x0021", + "cl": "0x0001", + "ep": 10, + "fn": "zcl:attr" + }, + "parse": { + "at": "0x0021", + "cl": "0x0001", + "ep": 10, + "eval": "Item.val = Attr.val / 2", + "fn": "zcl:attr" + } + }, + { + "name": "config/on" + }, + { + "name": "config/reachable" + }, + { + "name": "config/tholddark", + "default": 12000 + }, + { + "name": "config/tholdoffset", + "default": 7000 + }, + { + "name": "state/dark", + "default": false + }, + { + "name": "state/daylight", + "default": false + }, + { + "name": "state/lastupdated" + }, + { + "name": "state/lightlevel", + "parse": { + "at": "0x0000", + "cl": "0x0400", + "ep": 10, + "eval": "Item.val = Attr.val", + "fn": "zcl:attr" + }, + "default": 0 + }, + { + "name": "state/lux", + "default": 0 + } + ] + } + ], + "bindings": [ + { + "bind": "unicast", + "src.ep": 10, + "cl": "0x0402", + "report": [ + { + "at": "0x0000", + "dt": "0x29", + "min": 60, + "max": 3600, + "change": "0x00000032" + } + ] + }, + { + "bind": "unicast", + "src.ep": 10, + "cl": "0x0405", + "report": [ + { + "at": "0x0000", + "dt": "0x21", + "min": 60, + "max": 3600, + "change": "0x00000032" + } + ] + }, + { + "bind": "unicast", + "src.ep": 10, + "cl": "0x0408", + "report": [ + { + "at": "0x0000", + "dt": "0x21", + "min": 60, + "max": 3600, + "change": "0x00000032" + } + ] + }, + { + "bind": "unicast", + "src.ep": 10, + "cl": "0x0400", + "report": [ + { + "at": "0x0000", + "dt": "0x21", + "min": 60, + "max": 3600, + "change": "0x00000005" + } + ] + }, + { + "bind": "unicast", + "src.ep": 10, + "cl": "0x0001", + "report": [ + { + "at": "0x0021", + "dt": "0x20", + "min": 3600, + "max": 62000, + "change": "0x00000001" + } + ] + } + ] +} From cf6326537796a484940a8690484c3257db3be914 Mon Sep 17 00:00:00 2001 From: elratt0r <6256988+elratt0r@users.noreply.github.com> Date: Wed, 13 Nov 2024 09:55:15 +0100 Subject: [PATCH 4/7] DDF b-parasite - be more descriptive about product --- devices/b-parasite/b-parasite.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices/b-parasite/b-parasite.json b/devices/b-parasite/b-parasite.json index 7a2db3e662..2b552b358c 100644 --- a/devices/b-parasite/b-parasite.json +++ b/devices/b-parasite/b-parasite.json @@ -3,7 +3,7 @@ "uuid": "7ad2d274-5bb0-40f1-926b-4d9d059ce393", "manufacturername": "b-parasite", "modelid": "b-parasite", - "product": "b-parasite", + "product": "open source soil moisture and ambient temperature/humidity/light sensor", "sleeper": true, "status": "Gold", "subdevices": [ From 4f6c41b2fb9a7c9abaaf0660a467cdd575020f42 Mon Sep 17 00:00:00 2001 From: elratt0r <6256988+elratt0r@users.noreply.github.com> Date: Wed, 13 Nov 2024 10:02:06 +0100 Subject: [PATCH 5/7] DDF b-parasite - add complementary lightlevel conversion script --- devices/b-parasite/0400_lightlevel.js | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 devices/b-parasite/0400_lightlevel.js diff --git a/devices/b-parasite/0400_lightlevel.js b/devices/b-parasite/0400_lightlevel.js new file mode 100644 index 0000000000..2895f3868a --- /dev/null +++ b/devices/b-parasite/0400_lightlevel.js @@ -0,0 +1,10 @@ +/* global Attr, Item, R */ + +const v = Attr.val +const tholddark = R.item('config/tholddark').val +const tholdoffset = R.item('config/tholdoffset').val + +Item.val = v +R.item('state/dark').val = v <= tholddark +R.item('state/daylight').val = v > tholddark + tholdoffset +R.item('state/lux').val = Math.round(Math.pow(10, (Math.max(0, Math.min(v, 60001)) - 1) / 10000)) From 51c893516ca5bc7d5555f9e2f2eea52711f79b66 Mon Sep 17 00:00:00 2001 From: elratt0r <6256988+elratt0r@users.noreply.github.com> Date: Wed, 13 Nov 2024 10:02:39 +0100 Subject: [PATCH 6/7] DDF b-parasite - enable lightlevel conversion script --- devices/b-parasite/b-parasite.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devices/b-parasite/b-parasite.json b/devices/b-parasite/b-parasite.json index 2b552b358c..2e55b0dc7a 100644 --- a/devices/b-parasite/b-parasite.json +++ b/devices/b-parasite/b-parasite.json @@ -328,8 +328,8 @@ "at": "0x0000", "cl": "0x0400", "ep": 10, - "eval": "Item.val = Attr.val", - "fn": "zcl:attr" + "fn": "zcl:attr", + "script": "0400_lightlevel.js" }, "default": 0 }, From 36983bb9fc48b6389dd9f3f61be322e6d9571198 Mon Sep 17 00:00:00 2001 From: elratt0r <6256988+elratt0r@users.noreply.github.com> Date: Wed, 13 Nov 2024 10:04:04 +0100 Subject: [PATCH 7/7] DDF b-parasite - add more sensible lightlevel report change interval (2000 ll / 1.58 lux) --- devices/b-parasite/b-parasite.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices/b-parasite/b-parasite.json b/devices/b-parasite/b-parasite.json index 2e55b0dc7a..4612ff4fc4 100644 --- a/devices/b-parasite/b-parasite.json +++ b/devices/b-parasite/b-parasite.json @@ -393,7 +393,7 @@ "dt": "0x21", "min": 60, "max": 3600, - "change": "0x00000005" + "change": "0x000007D0" } ] },