diff --git a/devices/generic/items/config_ledindication_item.json b/devices/generic/items/config_ledindication_item.json index e4df33346b..3bc91d05c4 100644 --- a/devices/generic/items/config_ledindication_item.json +++ b/devices/generic/items/config_ledindication_item.json @@ -4,5 +4,6 @@ "datatype": "Bool", "access": "RW", "public": true, - "description": "Activates the LED indicator." + "description": "Activates the LED indicator.", + "default": false } \ No newline at end of file diff --git a/devices/generic/items/config_sensitivity_item.json b/devices/generic/items/config_sensitivity_item.json index 15075b7782..8fd386b36c 100644 --- a/devices/generic/items/config_sensitivity_item.json +++ b/devices/generic/items/config_sensitivity_item.json @@ -5,5 +5,6 @@ "access": "RW", "public": true, "range": [0, 255], - "description": "The sensor sensitivity." + "description": "The sensor sensitivity.", + "default": 0 } \ No newline at end of file diff --git a/devices/philips/sml001_motion_sensor.json b/devices/philips/sml001_motion_sensor.json index 05f7a976dc..5f39b27b72 100644 --- a/devices/philips/sml001_motion_sensor.json +++ b/devices/philips/sml001_motion_sensor.json @@ -4,7 +4,8 @@ "doc:hdr": "Motion sensor 1. Gen (SML001)", "manufacturername": "$MF_PHILIPS", "modelid": "SML001", - "product": "Motion Sensor 1. Gen (SML001)", + "vendor": "Philips", + "product": "Hue motion sensor 1. Gen (SML001)", "status": "Gold", "sleeper": false, "md:known_issues": [ ], @@ -42,22 +43,23 @@ }, { "name": "config/battery", - "parse": {"ep": 2, "cl": "0x0001", "at": "0x0021", "eval": "Item.val = Attr.val / 2"}, - "read": {"ep": 2, "cl": "0x0001", "at": "0x0021"}, - "refresh.interval": 7300, - "awake": true + "parse": {"at": "0x0021", "cl": "0x0001", "ep": 2, "eval": "Item.val = Attr.val / 2"}, + "read": {"at": "0x0021", "cl": "0x0001", "ep": 2}, + "refresh.interval": 7300 }, { "name": "config/delay", - "read": {"ep": 2, "cl": "0x0406", "at": "0x0010"}, - "parse": {"ep": 2, "cl": "0x0406", "at": "0x0010", "eval": "Item.val = Attr.val"}, - "refresh.interval": 84000 + "parse": {"at": "0x0010", "cl": "0x0406", "ep": 2, "eval": "Item.val = Attr.val"}, + "read": {"at": "0x0010", "cl": "0x0406", "ep": 2}, + "write": {"at": "0x0010", "cl": "0x0406", "dt": "0x21", "ep": 2, "eval": "Item.val"}, + "refresh.interval": 86400 }, { "name": "config/ledindication", - "read": {"ep": 2, "cl": "0x0000", "at": "0x0033", "mf": "0x100b"}, - "parse": {"ep": 2, "cl": "0x0000", "at": "0x0033", "mf": "0x100b", "eval": "Item.val = Attr.val"}, - "refresh.interval": 84000 + "parse": {"at": "0x0033", "cl": "0x0000", "ep": 2, "eval": "Item.val = Attr.val", "mf": "0x100b"}, + "read": {"at": "0x0033", "cl": "0x0000", "ep": 2, "mf": "0x100b"}, + "write": {"at": "0x0033", "cl": "0x0000", "dt": "0x10", "ep": 2, "eval": "Item.val", "mf": "0x100b"}, + "refresh.interval": 86400 }, { "name": "config/on" @@ -70,14 +72,15 @@ }, { "name": "config/sensitivity", + "parse": {"at": "0x0030", "cl": "0x0406", "ep": 2, "eval": "Item.val = Attr.val", "mf": "0x100b"}, + "read": {"at": "0x0030", "cl": "0x0406", "ep": 2, "mf": "0x100b"}, + "write": {"at": "0x0030", "cl": "0x0406", "dt": "0x20", "ep": 2, "eval": "Item.val", "mf": "0x100b"}, "values": [ [0, "low"], [1, "medium"], [2, "high"] ], - "read": {"ep": 2, "cl": "0x0406", "at": "0x0030", "mf": "0x100b"}, - "parse": {"ep": 2, "cl": "0x0406", "at": "0x0030", "mf": "0x100b", "eval": "Item.val == 0 ? Item.val = Attr.val : Item.val"}, - "refresh.interval": 84000 + "refresh.interval": 86400 }, { "name": "config/sensitivitymax", @@ -85,17 +88,17 @@ }, { "name": "config/usertest", - "read": {"ep": 2, "cl": "0x0000", "at": "0x0032", "mf": "0x100b"}, - "parse": {"ep": 2, "cl": "0x0000", "at": "0x0032", "mf": "0x100b", "eval": "Item.val = Attr.val"}, - "refresh.interval": 84000 + "parse": {"at": "0x0032", "cl": "0x0000", "ep": 2, "mf": "0x100b", "eval": "Item.val = Attr.val"}, + "read": {"at": "0x0032", "cl": "0x0000", "ep": 2, "mf": "0x100b"}, + "write": {"at": "0x0032", "cl": "0x0000", "dt": "0x10", "ep": 2, "mf": "0x100b", "eval": "Item.val"}, + "refresh.interval": 86400 }, { "name": "state/lastupdated" }, { "name": "state/presence", - "parse": {"ep": 2, "cl": "0x0406", "at": "0x0000", "eval": "Item.val = Attr.val"}, - "awake": true + "parse": {"at": "0x0000", "cl": "0x0406", "ep": 2, "eval": "Item.val = Attr.val"} } ], "example": { @@ -145,7 +148,8 @@ "name": "attr/name" }, { - "name": "attr/swversion" + "name": "attr/swversion", + "read": {"fn": "none"} }, { "name": "attr/type" @@ -159,11 +163,15 @@ }, { "name": "config/battery", - "parse": {"ep": 2, "cl": "0x0001", "at": "0x0021", "eval": "Item.val = Attr.val / 2"} + "parse": {"at": "0x0021", "cl": "0x0001", "ep": 2, "eval": "Item.val = Attr.val / 2"}, + "read": {"fn": "none"} }, { "name": "config/ledindication", - "parse": {"ep": 2, "cl": "0x0000", "at": "0x0033", "mf": "0x100b", "eval": "Item.val = Attr.val"} + "parse": {"at": "0x0033", "cl": "0x0000", "ep": 2, "eval": "Item.val = Attr.val", "mf": "0x100b"}, + "read": {"at": "0x0033", "cl": "0x0000", "ep": 2, "mf": "0x100b"}, + "write": {"at": "0x0033", "cl": "0x0000", "dt": "0x10", "ep": 2, "eval": "Item.val", "mf": "0x100b"}, + "refresh.interval": 86400 }, { "name": "config/on" @@ -182,7 +190,10 @@ }, { "name": "config/usertest", - "parse": {"ep": 2, "cl": "0x0000", "at": "0x0032", "mf": "0x100b", "eval": "Item.val = Attr.val"} + "parse": {"at": "0x0032", "cl": "0x0000", "ep": 2, "eval": "Item.val = Attr.val", "mf": "0x100b"}, + "read": {"at": "0x0032", "cl": "0x0000", "ep": 2, "mf": "0x100b"}, + "write": {"at": "0x0032", "cl": "0x0000", "dt": "0x10", "ep": 2, "eval": "Item.val", "mf": "0x100b"}, + "refresh.interval": 86400 }, { "name": "state/dark" @@ -195,8 +206,7 @@ }, { "name": "state/lightlevel", - "parse": {"ep": 2, "cl": "0x0400", "at": "0x0000", "script": "../generic/illuminance_cluster/sml_light_level.js"}, - "awake": true + "parse": {"at": "0x0000", "cl": "0x0400", "ep": 2, "script": "../generic/illuminance_cluster/sml_light_level.js"} }, { "name": "state/lux" @@ -251,7 +261,8 @@ "name": "attr/name" }, { - "name": "attr/swversion" + "name": "attr/swversion", + "read": {"fn": "none"} }, { "name": "attr/type" @@ -265,11 +276,15 @@ }, { "name": "config/battery", - "parse": {"ep": 2, "cl": "0x0001", "at": "0x0021", "eval": "Item.val = Attr.val / 2"} + "parse": {"at": "0x0021", "cl": "0x0001", "ep": 2, "eval": "Item.val = Attr.val / 2"}, + "read": {"fn": "none"} }, { "name": "config/ledindication", - "parse": {"ep": 2, "cl": "0x0000", "at": "0x0033", "mf": "0x100b", "eval": "Item.val = Attr.val"} + "parse": {"at": "0x0033", "cl": "0x0000", "ep": 2, "eval": "Item.val = Attr.val", "mf": "0x100b"}, + "read": {"at": "0x0033", "cl": "0x0000", "ep": 2, "mf": "0x100b"}, + "write": {"at": "0x0033", "cl": "0x0000", "dt": "0x10", "ep": 2, "eval": "Item.val", "mf": "0x100b"}, + "refresh.interval": 86400 }, { "name": "config/offset" @@ -285,15 +300,17 @@ }, { "name": "config/usertest", - "parse": {"ep": 2, "cl": "0x0000", "at": "0x0032", "mf": "0x100b", "eval": "Item.val = Attr.val"} + "parse": {"at": "0x0032", "cl": "0x0000", "ep": 2, "eval": "Item.val = Attr.val", "mf": "0x100b"}, + "read": {"at": "0x0032", "cl": "0x0000", "ep": 2, "mf": "0x100b"}, + "write": {"at": "0x0032", "cl": "0x0000", "dt": "0x10", "ep": 2, "eval": "Item.val", "mf": "0x100b"}, + "refresh.interval": 86400 }, { "name": "state/lastupdated" }, { "name": "state/temperature", - "parse": {"ep": 2, "cl": "0x0402", "at": "0x0000", "eval": "Item.val = Attr.val + R.item('config/offset').val"}, - "awake": true + "parse": {"at": "0x0000", "cl": "0x0402", "ep": 2, "eval": "Item.val = Attr.val + R.item('config/offset').val"} } ], "example": { diff --git a/devices/philips/sml002_motion_sensor.json b/devices/philips/sml002_motion_sensor.json new file mode 100644 index 0000000000..db17b59020 --- /dev/null +++ b/devices/philips/sml002_motion_sensor.json @@ -0,0 +1,287 @@ +{ + "schema": "devcap1.schema.json", + "manufacturername": "$MF_PHILIPS", + "modelid": "SML002", + "vendor": "Philips", + "product": "Hue outdoor sensor 1. Gen (SML002)", + "status": "Gold", + "sleeper": false, + "subdevices": [ + { + "type": "$TYPE_PRESENCE_SENSOR", + "restapi": "/sensors", + "uuid": [ "$address.ext", "0x02", "0x0406"], + "fingerprint": { "profile": "0x0104", "device": "0x0107", "endpoint": "0x02", "in": ["0x0000", "0x0001", "0x0406"] }, + "items": [ + { + "name": "attr/lastseen" + }, + { + "name": "attr/manufacturername" + }, + { + "name": "attr/modelid" + }, + { + "name": "attr/name" + }, + { + "name": "attr/swversion" + }, + { + "name": "attr/type" + }, + { + "name": "attr/uniqueid" + }, + { + "name": "config/alert", + "default": "none" + }, + { + "name": "config/battery", + "parse": {"at": "0x0021", "cl": "0x0001", "ep": 2, "eval": "Item.val = Attr.val / 2"}, + "read": {"at": "0x0021", "cl": "0x0001", "ep": 2}, + "refresh.interval": 7300 + }, + { + "name": "config/delay", + "parse": {"at": "0x0010", "cl": "0x0406", "ep": 2, "eval": "Item.val = Attr.val"}, + "read": {"at": "0x0010", "cl": "0x0406", "ep": 2}, + "write": {"at": "0x0010", "cl": "0x0406", "dt": "0x21", "ep": 2, "eval": "Item.val"}, + "refresh.interval": 86400 + }, + { + "name": "config/ledindication", + "parse": {"at": "0x0033", "cl": "0x0000", "ep": 2, "eval": "Item.val = Attr.val", "mf": "0x100b"}, + "read": {"at": "0x0033", "cl": "0x0000", "ep": 2, "mf": "0x100b"}, + "write": {"at": "0x0033", "cl": "0x0000", "dt": "0x10", "ep": 2, "eval": "Item.val", "mf": "0x100b"}, + "refresh.interval": 86400 + }, + { + "name": "config/on" + }, + { + "name": "config/pending" + }, + { + "name": "config/reachable" + }, + { + "name": "config/sensitivity", + "parse": {"at": "0x0030", "cl": "0x0406", "ep": 2, "eval": "Item.val = Attr.val", "mf": "0x100b"}, + "read": {"at": "0x0030", "cl": "0x0406", "ep": 2, "mf": "0x100b"}, + "write": {"at": "0x0030", "cl": "0x0406", "dt": "0x20", "ep": 2, "eval": "Item.val", "mf": "0x100b"}, + "values": [ + [0, "verylow"], + [1, "low"], + [2, "medium"], + [3, "high"], + [4, "veryhigh"] + ], + "refresh.interval": 86400 + }, + { + "name": "config/sensitivitymax", + "static": 4 + }, + { + "name": "config/usertest", + "parse": {"at": "0x0032", "cl": "0x0000", "ep": 2, "mf": "0x100b", "eval": "Item.val = Attr.val"}, + "read": {"at": "0x0032", "cl": "0x0000", "ep": 2, "mf": "0x100b"}, + "write": {"at": "0x0032", "cl": "0x0000", "dt": "0x10", "ep": 2, "mf": "0x100b", "eval": "Item.val"}, + "refresh.interval": 86400 + }, + { + "name": "state/lastupdated" + }, + { + "name": "state/presence", + "parse": {"at": "0x0000", "cl": "0x0406", "ep": 2, "eval": "Item.val = Attr.val"} + } + ] + }, + { + "type": "$TYPE_LIGHT_LEVEL_SENSOR", + "restapi": "/sensors", + "uuid": [ "$address.ext", "0x02", "0x0400"], + "fingerprint": { "profile": "0x0104", "device": "0x0107", "endpoint": "0x02", "in": ["0x0000", "0x0001", "0x0400"] }, + "items": [ + { + "name": "attr/lastseen" + }, + { + "name": "attr/manufacturername" + }, + { + "name": "attr/modelid" + }, + { + "name": "attr/name" + }, + { + "name": "attr/swversion", + "read": {"fn": "none"} + }, + { + "name": "attr/type" + }, + { + "name": "attr/uniqueid" + }, + { + "name": "config/alert", + "default": "none" + }, + { + "name": "config/battery", + "parse": {"at": "0x0021", "cl": "0x0001", "ep": 2, "eval": "Item.val = Attr.val / 2"}, + "read": {"fn": "none"} + }, + { + "name": "config/ledindication", + "parse": {"at": "0x0033", "cl": "0x0000", "ep": 2, "eval": "Item.val = Attr.val", "mf": "0x100b"}, + "read": {"at": "0x0033", "cl": "0x0000", "ep": 2, "mf": "0x100b"}, + "write": {"at": "0x0033", "cl": "0x0000", "dt": "0x10", "ep": 2, "eval": "Item.val", "mf": "0x100b"}, + "refresh.interval": 86400 + }, + { + "name": "config/on" + }, + { + "name": "config/pending" + }, + { + "name": "config/reachable" + }, + { + "name": "config/tholddark" + }, + { + "name": "config/tholdoffset" + }, + { + "name": "config/usertest", + "parse": {"at": "0x0032", "cl": "0x0000", "ep": 2, "eval": "Item.val = Attr.val", "mf": "0x100b"}, + "read": {"at": "0x0032", "cl": "0x0000", "ep": 2, "mf": "0x100b"}, + "write": {"at": "0x0032", "cl": "0x0000", "dt": "0x10", "ep": 2, "eval": "Item.val", "mf": "0x100b"}, + "refresh.interval": 86400 + }, + { + "name": "state/dark" + }, + { + "name": "state/daylight" + }, + { + "name": "state/lastupdated" + }, + { + "name": "state/lightlevel", + "parse": {"at": "0x0000", "cl": "0x0400", "ep": 2, "script": "../generic/illuminance_cluster/sml_light_level.js"} + }, + { + "name": "state/lux" + } + ] + }, + { + "type": "$TYPE_TEMPERATURE_SENSOR", + "restapi": "/sensors", + "uuid": [ "$address.ext", "0x02", "0x0402"], + "fingerprint": { "profile": "0x0104", "device": "0x0107", "endpoint": "0x02", "in": ["0x0000", "0x0001", "0x0402"] }, + "items": [ + { + "name": "attr/lastseen" + }, + { + "name": "attr/manufacturername" + }, + { + "name": "attr/modelid" + }, + { + "name": "attr/name" + }, + { + "name": "attr/swversion", + "read": {"fn": "none"} + }, + { + "name": "attr/type" + }, + { + "name": "attr/uniqueid" + }, + { + "name": "config/alert", + "default": "none" + }, + { + "name": "config/battery", + "parse": {"at": "0x0021", "cl": "0x0001", "ep": 2, "eval": "Item.val = Attr.val / 2"}, + "read": {"fn": "none"} + }, + { + "name": "config/ledindication", + "parse": {"at": "0x0033", "cl": "0x0000", "ep": 2, "eval": "Item.val = Attr.val", "mf": "0x100b"}, + "read": {"at": "0x0033", "cl": "0x0000", "ep": 2, "mf": "0x100b"}, + "write": {"at": "0x0033", "cl": "0x0000", "dt": "0x10", "ep": 2, "eval": "Item.val", "mf": "0x100b"}, + "refresh.interval": 86400 + }, + { + "name": "config/offset" + }, + { + "name": "config/on" + }, + { + "name": "config/pending" + }, + { + "name": "config/reachable" + }, + { + "name": "config/usertest", + "parse": {"at": "0x0032", "cl": "0x0000", "ep": 2, "eval": "Item.val = Attr.val", "mf": "0x100b"}, + "read": {"at": "0x0032", "cl": "0x0000", "ep": 2, "mf": "0x100b"}, + "write": {"at": "0x0032", "cl": "0x0000", "dt": "0x10", "ep": 2, "eval": "Item.val", "mf": "0x100b"}, + "refresh.interval": 86400 + }, + { + "name": "state/lastupdated" + }, + { + "name": "state/temperature", + "parse": {"at": "0x0000", "cl": "0x0402", "ep": 2, "eval": "Item.val = Attr.val + R.item('config/offset').val"} + } + ] + } + ], + "bindings": [ + { + "bind": "unicast", + "src.ep": 2, + "cl": "0x0406", + "report": [ {"at": "0x0000", "dt": "0x18", "min": 1, "max": 300 } ] + }, + { + "bind": "unicast", + "src.ep": 2, + "cl": "0x0400", + "report": [ {"at": "0x0000", "dt": "0x21", "min": 5, "max": 300, "change": "0x07d0" } ] + }, + { + "bind": "unicast", + "src.ep": 2, + "cl": "0x0402", + "report": [ {"at": "0x0000", "dt": "0x29", "min": 10, "max": 300, "change": "0x14" } ] + }, + { + "bind": "unicast", + "src.ep": 2, + "cl": "0x0001", + "report": [ {"at": "0x0021", "dt": "0x20", "min": 7200, "max": 7200, "change": "0x00" } ] + } + ] +} \ No newline at end of file diff --git a/devices/philips/sml003_motion_sensor.json b/devices/philips/sml003_motion_sensor.json index 4898d0bcdf..d4e9b88cc8 100644 --- a/devices/philips/sml003_motion_sensor.json +++ b/devices/philips/sml003_motion_sensor.json @@ -1,13 +1,11 @@ { "schema": "devcap1.schema.json", - "doc:path": "philips/sml003_motion_sensor.md", - "doc:hdr": "Motion sensor 2. Gen (SML003)", - "manufacturername": "$MF_PHILIPS", + "manufacturername": "Signify Netherlands B.V.", "modelid": "SML003", - "product": "Motion Sensor 2. Gen (SML003)", + "vendor": "Philips", + "product": "Hue motion sensor 2. Gen (SML003)", "status": "Gold", "sleeper": false, - "md:known_issues": [ ], "subdevices": [ { "type": "$TYPE_PRESENCE_SENSOR", @@ -42,22 +40,23 @@ }, { "name": "config/battery", - "parse": {"ep": 2, "cl": "0x0001", "at": "0x0021", "eval": "Item.val = Attr.val / 2"}, - "read": {"ep": 2, "cl": "0x0001", "at": "0x0021"}, - "refresh.interval": 7300, - "awake": true + "parse": {"at": "0x0021", "cl": "0x0001", "ep": 2, "eval": "Item.val = Attr.val / 2"}, + "read": {"at": "0x0021", "cl": "0x0001", "ep": 2}, + "refresh.interval": 7300 }, { "name": "config/delay", - "read": {"ep": 2, "cl": "0x0406", "at": "0x0010"}, - "parse": {"ep": 2, "cl": "0x0406", "at": "0x0010", "eval": "Item.val = Attr.val"}, - "refresh.interval": 84000 + "parse": {"at": "0x0010", "cl": "0x0406", "ep": 2, "eval": "Item.val = Attr.val"}, + "read": {"at": "0x0010", "cl": "0x0406", "ep": 2}, + "write": {"at": "0x0010", "cl": "0x0406", "dt": "0x21", "ep": 2, "eval": "Item.val"}, + "refresh.interval": 86400 }, { "name": "config/ledindication", - "read": {"ep": 2, "cl": "0x0000", "at": "0x0033", "mf": "0x100b"}, - "parse": {"ep": 2, "cl": "0x0000", "at": "0x0033", "mf": "0x100b", "eval": "Item.val = Attr.val"}, - "refresh.interval": 84000 + "parse": {"at": "0x0033", "cl": "0x0000", "ep": 2, "eval": "Item.val = Attr.val", "mf": "0x100b"}, + "read": {"at": "0x0033", "cl": "0x0000", "ep": 2, "mf": "0x100b"}, + "write": {"at": "0x0033", "cl": "0x0000", "dt": "0x10", "ep": 2, "eval": "Item.val", "mf": "0x100b"}, + "refresh.interval": 86400 }, { "name": "config/on" @@ -70,16 +69,17 @@ }, { "name": "config/sensitivity", + "parse": {"at": "0x0030", "cl": "0x0406", "ep": 2, "eval": "Item.val = Attr.val", "mf": "0x100b"}, + "read": {"at": "0x0030", "cl": "0x0406", "ep": 2, "mf": "0x100b"}, + "write": {"at": "0x0030", "cl": "0x0406", "dt": "0x20", "ep": 2, "eval": "Item.val", "mf": "0x100b"}, "values": [ [0, "verylow"], [1, "low"], [2, "medium"], - [3, "high"], - [4, "veryhigh"] + [3, "high"], + [4, "veryhigh"] ], - "read": {"ep": 2, "cl": "0x0406", "at": "0x0030", "mf": "0x100b"}, - "parse": {"ep": 2, "cl": "0x0406", "at": "0x0030", "mf": "0x100b", "eval": "Item.val == 0 ? Item.val = Attr.val : Item.val"}, - "refresh.interval": 84000 + "refresh.interval": 86400 }, { "name": "config/sensitivitymax", @@ -87,46 +87,19 @@ }, { "name": "config/usertest", - "read": {"ep": 2, "cl": "0x0000", "at": "0x0032", "mf": "0x100b"}, - "parse": {"ep": 2, "cl": "0x0000", "at": "0x0032", "mf": "0x100b", "eval": "Item.val = Attr.val"}, - "refresh.interval": 84000 + "parse": {"at": "0x0032", "cl": "0x0000", "ep": 2, "mf": "0x100b", "eval": "Item.val = Attr.val"}, + "read": {"at": "0x0032", "cl": "0x0000", "ep": 2, "mf": "0x100b"}, + "write": {"at": "0x0032", "cl": "0x0000", "dt": "0x10", "ep": 2, "mf": "0x100b", "eval": "Item.val"}, + "refresh.interval": 86400 }, { "name": "state/lastupdated" }, { "name": "state/presence", - "parse": {"ep": 2, "cl": "0x0406", "at": "0x0000", "eval": "Item.val = Attr.val"}, - "awake": true + "parse": {"at": "0x0000", "cl": "0x0406", "ep": 2, "eval": "Item.val = Attr.val"} } - ], - "example": { - "config": { - "alert": "none", - "battery": 0, - "delay": 0, - "ledindication": false, - "on": true, - "pending": [], - "reachable": true, - "sensitivity": 2, - "sensitivitymax": 4, - "usertest": false - }, - "ep": 2, - "etag": "7f0d4873bf1bf93df92948fe160460e6", - "lastseen": "2022-01-13T13:20Z", - "manufacturername": "Philips", - "modelid": "SML003", - "name": "Motion Sensor (2)", - "state": { - "lastupdated": "2022-01-13T13:20:06.879", - "presence": false - }, - "swversion": "2.53.6", - "type": "ZHAPresence", - "uniqueid": "00:17:88:01:02:00:21:f4-02-0406" - } + ] }, { "type": "$TYPE_LIGHT_LEVEL_SENSOR", @@ -147,7 +120,8 @@ "name": "attr/name" }, { - "name": "attr/swversion" + "name": "attr/swversion", + "read": {"fn": "none"} }, { "name": "attr/type" @@ -161,11 +135,15 @@ }, { "name": "config/battery", - "parse": {"ep": 2, "cl": "0x0001", "at": "0x0021", "eval": "Item.val = Attr.val / 2"} + "parse": {"at": "0x0021", "cl": "0x0001", "ep": 2, "eval": "Item.val = Attr.val / 2"}, + "read": {"fn": "none"} }, { "name": "config/ledindication", - "parse": {"ep": 2, "cl": "0x0000", "at": "0x0033", "mf": "0x100b", "eval": "Item.val = Attr.val"} + "parse": {"at": "0x0033", "cl": "0x0000", "ep": 2, "eval": "Item.val = Attr.val", "mf": "0x100b"}, + "read": {"at": "0x0033", "cl": "0x0000", "ep": 2, "mf": "0x100b"}, + "write": {"at": "0x0033", "cl": "0x0000", "dt": "0x10", "ep": 2, "eval": "Item.val", "mf": "0x100b"}, + "refresh.interval": 86400 }, { "name": "config/on" @@ -184,7 +162,10 @@ }, { "name": "config/usertest", - "parse": {"ep": 2, "cl": "0x0000", "at": "0x0032", "mf": "0x100b", "eval": "Item.val = Attr.val"} + "parse": {"at": "0x0032", "cl": "0x0000", "ep": 2, "eval": "Item.val = Attr.val", "mf": "0x100b"}, + "read": {"at": "0x0032", "cl": "0x0000", "ep": 2, "mf": "0x100b"}, + "write": {"at": "0x0032", "cl": "0x0000", "dt": "0x10", "ep": 2, "eval": "Item.val", "mf": "0x100b"}, + "refresh.interval": 86400 }, { "name": "state/dark" @@ -197,42 +178,12 @@ }, { "name": "state/lightlevel", - "parse": {"ep": 2, "cl": "0x0400", "at": "0x0000", "script": "../generic/illuminance_cluster/sml_light_level.js"}, - "awake": true + "parse": {"at": "0x0000", "cl": "0x0400", "ep": 2, "script": "../generic/illuminance_cluster/sml_light_level.js"} }, { "name": "state/lux" } - ], - "example": { - "config": { - "alert": "none", - "battery": 0, - "ledindication": false, - "on": true, - "pending": [], - "reachable": true, - "tholddark": 12000, - "tholdoffset": 7000, - "usertest": false - }, - "ep": 2, - "etag": "58197854b7469e88cbb22afbe5ecf8d0", - "lastseen": "2022-01-13T13:20Z", - "manufacturername": "Philips", - "modelid": "SML003", - "name": "Motion Sensor (2)", - "state": { - "dark": false, - "daylight": true, - "lastupdated": "2022-01-13T13:19:58.655", - "lightlevel": 30063, - "lux": 1014 - }, - "swversion": "2.53.6", - "type": "ZHALightLevel", - "uniqueid": "00:17:88:01:02:00:21:f4-02-0400" - } + ] }, { "type": "$TYPE_TEMPERATURE_SENSOR", @@ -253,7 +204,8 @@ "name": "attr/name" }, { - "name": "attr/swversion" + "name": "attr/swversion", + "read": {"fn": "none"} }, { "name": "attr/type" @@ -267,11 +219,15 @@ }, { "name": "config/battery", - "parse": {"ep": 2, "cl": "0x0001", "at": "0x0021", "eval": "Item.val = Attr.val / 2"} + "parse": {"at": "0x0021", "cl": "0x0001", "ep": 2, "eval": "Item.val = Attr.val / 2"}, + "read": {"fn": "none"} }, { "name": "config/ledindication", - "parse": {"ep": 2, "cl": "0x0000", "at": "0x0033", "mf": "0x100b", "eval": "Item.val = Attr.val"} + "parse": {"at": "0x0033", "cl": "0x0000", "ep": 2, "eval": "Item.val = Attr.val", "mf": "0x100b"}, + "read": {"at": "0x0033", "cl": "0x0000", "ep": 2, "mf": "0x100b"}, + "write": {"at": "0x0033", "cl": "0x0000", "dt": "0x10", "ep": 2, "eval": "Item.val", "mf": "0x100b"}, + "refresh.interval": 86400 }, { "name": "config/offset" @@ -287,42 +243,19 @@ }, { "name": "config/usertest", - "parse": {"ep": 2, "cl": "0x0000", "at": "0x0032", "mf": "0x100b", "eval": "Item.val = Attr.val"} + "parse": {"at": "0x0032", "cl": "0x0000", "ep": 2, "eval": "Item.val = Attr.val", "mf": "0x100b"}, + "read": {"at": "0x0032", "cl": "0x0000", "ep": 2, "mf": "0x100b"}, + "write": {"at": "0x0032", "cl": "0x0000", "dt": "0x10", "ep": 2, "eval": "Item.val", "mf": "0x100b"}, + "refresh.interval": 86400 }, { "name": "state/lastupdated" }, { "name": "state/temperature", - "parse": {"ep": 2, "cl": "0x0402", "at": "0x0000", "eval": "Item.val = Attr.val + R.item('config/offset').val"}, - "awake": true + "parse": {"at": "0x0000", "cl": "0x0402", "ep": 2, "eval": "Item.val = Attr.val + R.item('config/offset').val"} } - ], - "example": { - "config": { - "alert": "none", - "battery": 0, - "ledindication": false, - "offset": 0, - "on": true, - "pending": [], - "reachable": true, - "usertest": false - }, - "ep": 2, - "etag": "0f14835ede4aac034a6022f956aea426", - "lastseen": "2022-01-13T13:20Z", - "manufacturername": "Philips", - "modelid": "SML003", - "name": "Motion Sensor (2)", - "state": { - "lastupdated": "2022-01-13T13:17:44.861", - "temperature": 2142 - }, - "swversion": "2.53.6", - "type": "ZHATemperature", - "uniqueid": "00:17:88:01:02:00:21:f4-02-0402" - } + ] } ], "bindings": [ diff --git a/devices/philips/sml004_motion_sensor.json b/devices/philips/sml004_motion_sensor.json index 016e118118..82861cf164 100644 --- a/devices/philips/sml004_motion_sensor.json +++ b/devices/philips/sml004_motion_sensor.json @@ -1,13 +1,11 @@ { "schema": "devcap1.schema.json", - "doc:path": "philips/sml004_motion_sensor.md", - "doc:hdr": "Motion sensor 3. Gen (SML004)", - "manufacturername": "$MF_PHILIPS", + "manufacturername": "Signify Netherlands B.V.", "modelid": "SML004", - "product": "Motion Sensor 3. Gen (SML004)", - "status": "Bronze", + "vendor": "Philips", + "product": "Hue outdoor sensor 2. Gen (SML004)", + "status": "Gold", "sleeper": false, - "md:known_issues": [ ], "subdevices": [ { "type": "$TYPE_PRESENCE_SENSOR", @@ -42,22 +40,23 @@ }, { "name": "config/battery", - "parse": {"ep": 2, "cl": "0x0001", "at": "0x0021", "eval": "Item.val = Attr.val / 2"}, - "read": {"ep": 2, "cl": "0x0001", "at": "0x0021"}, - "refresh.interval": 7300, - "awake": true + "parse": {"at": "0x0021", "cl": "0x0001", "ep": 2, "eval": "Item.val = Attr.val / 2"}, + "read": {"at": "0x0021", "cl": "0x0001", "ep": 2}, + "refresh.interval": 7300 }, { "name": "config/delay", - "read": {"ep": 2, "cl": "0x0406", "at": "0x0010"}, - "parse": {"ep": 2, "cl": "0x0406", "at": "0x0010", "eval": "Item.val = Attr.val"}, - "refresh.interval": 84000 + "parse": {"at": "0x0010", "cl": "0x0406", "ep": 2, "eval": "Item.val = Attr.val"}, + "read": {"at": "0x0010", "cl": "0x0406", "ep": 2}, + "write": {"at": "0x0010", "cl": "0x0406", "dt": "0x21", "ep": 2, "eval": "Item.val"}, + "refresh.interval": 86400 }, { "name": "config/ledindication", - "read": {"ep": 2, "cl": "0x0000", "at": "0x0033", "mf": "0x100b"}, - "parse": {"ep": 2, "cl": "0x0000", "at": "0x0033", "mf": "0x100b", "eval": "Item.val = Attr.val"}, - "refresh.interval": 84000 + "parse": {"at": "0x0033", "cl": "0x0000", "ep": 2, "eval": "Item.val = Attr.val", "mf": "0x100b"}, + "read": {"at": "0x0033", "cl": "0x0000", "ep": 2, "mf": "0x100b"}, + "write": {"at": "0x0033", "cl": "0x0000", "dt": "0x10", "ep": 2, "eval": "Item.val", "mf": "0x100b"}, + "refresh.interval": 86400 }, { "name": "config/on" @@ -70,16 +69,17 @@ }, { "name": "config/sensitivity", + "parse": {"at": "0x0030", "cl": "0x0406", "ep": 2, "eval": "Item.val = Attr.val", "mf": "0x100b"}, + "read": {"at": "0x0030", "cl": "0x0406", "ep": 2, "mf": "0x100b"}, + "write": {"at": "0x0030", "cl": "0x0406", "dt": "0x20", "ep": 2, "eval": "Item.val", "mf": "0x100b"}, "values": [ [0, "verylow"], [1, "low"], [2, "medium"], - [3, "high"], - [4, "veryhigh"] + [3, "high"], + [4, "veryhigh"] ], - "read": {"ep": 2, "cl": "0x0406", "at": "0x0030", "mf": "0x100b"}, - "parse": {"ep": 2, "cl": "0x0406", "at": "0x0030", "mf": "0x100b", "eval": "Item.val == 0 ? Item.val = Attr.val : Item.val"}, - "refresh.interval": 84000 + "refresh.interval": 86400 }, { "name": "config/sensitivitymax", @@ -87,46 +87,19 @@ }, { "name": "config/usertest", - "read": {"ep": 2, "cl": "0x0000", "at": "0x0032", "mf": "0x100b"}, - "parse": {"ep": 2, "cl": "0x0000", "at": "0x0032", "mf": "0x100b", "eval": "Item.val = Attr.val"}, - "refresh.interval": 84000 + "parse": {"at": "0x0032", "cl": "0x0000", "ep": 2, "mf": "0x100b", "eval": "Item.val = Attr.val"}, + "read": {"at": "0x0032", "cl": "0x0000", "ep": 2, "mf": "0x100b"}, + "write": {"at": "0x0032", "cl": "0x0000", "dt": "0x10", "ep": 2, "mf": "0x100b", "eval": "Item.val"}, + "refresh.interval": 86400 }, { "name": "state/lastupdated" }, { "name": "state/presence", - "parse": {"ep": 2, "cl": "0x0406", "at": "0x0000", "eval": "Item.val = Attr.val"}, - "awake": true + "parse": {"at": "0x0000", "cl": "0x0406", "ep": 2, "eval": "Item.val = Attr.val"} } - ], - "example": { - "config": { - "alert": "none", - "battery": 0, - "delay": 0, - "ledindication": false, - "on": true, - "pending": [], - "reachable": true, - "sensitivity": 2, - "sensitivitymax": 4, - "usertest": false - }, - "ep": 2, - "etag": "7f0d4873bf1bf93df92948fe160460e6", - "lastseen": "2022-01-13T13:20Z", - "manufacturername": "Philips", - "modelid": "SML004", - "name": "Motion Sensor (2)", - "state": { - "lastupdated": "2022-01-13T13:20:06.879", - "presence": false - }, - "swversion": "2.53.6", - "type": "ZHAPresence", - "uniqueid": "00:17:88:01:02:00:21:f4-02-0406" - } + ] }, { "type": "$TYPE_LIGHT_LEVEL_SENSOR", @@ -147,7 +120,8 @@ "name": "attr/name" }, { - "name": "attr/swversion" + "name": "attr/swversion", + "read": {"fn": "none"} }, { "name": "attr/type" @@ -161,11 +135,15 @@ }, { "name": "config/battery", - "parse": {"ep": 2, "cl": "0x0001", "at": "0x0021", "eval": "Item.val = Attr.val / 2"} + "parse": {"at": "0x0021", "cl": "0x0001", "ep": 2, "eval": "Item.val = Attr.val / 2"}, + "read": {"fn": "none"} }, { "name": "config/ledindication", - "parse": {"ep": 2, "cl": "0x0000", "at": "0x0033", "mf": "0x100b", "eval": "Item.val = Attr.val"} + "parse": {"at": "0x0033", "cl": "0x0000", "ep": 2, "eval": "Item.val = Attr.val", "mf": "0x100b"}, + "read": {"at": "0x0033", "cl": "0x0000", "ep": 2, "mf": "0x100b"}, + "write": {"at": "0x0033", "cl": "0x0000", "dt": "0x10", "ep": 2, "eval": "Item.val", "mf": "0x100b"}, + "refresh.interval": 86400 }, { "name": "config/on" @@ -184,7 +162,10 @@ }, { "name": "config/usertest", - "parse": {"ep": 2, "cl": "0x0000", "at": "0x0032", "mf": "0x100b", "eval": "Item.val = Attr.val"} + "parse": {"at": "0x0032", "cl": "0x0000", "ep": 2, "eval": "Item.val = Attr.val", "mf": "0x100b"}, + "read": {"at": "0x0032", "cl": "0x0000", "ep": 2, "mf": "0x100b"}, + "write": {"at": "0x0032", "cl": "0x0000", "dt": "0x10", "ep": 2, "eval": "Item.val", "mf": "0x100b"}, + "refresh.interval": 86400 }, { "name": "state/dark" @@ -197,42 +178,12 @@ }, { "name": "state/lightlevel", - "parse": {"ep": 2, "cl": "0x0400", "at": "0x0000", "script": "../generic/illuminance_cluster/sml_light_level.js"}, - "awake": true + "parse": {"at": "0x0000", "cl": "0x0400", "ep": 2, "script": "../generic/illuminance_cluster/sml_light_level.js"} }, { "name": "state/lux" } - ], - "example": { - "config": { - "alert": "none", - "battery": 0, - "ledindication": false, - "on": true, - "pending": [], - "reachable": true, - "tholddark": 12000, - "tholdoffset": 7000, - "usertest": false - }, - "ep": 2, - "etag": "58197854b7469e88cbb22afbe5ecf8d0", - "lastseen": "2022-01-13T13:20Z", - "manufacturername": "Philips", - "modelid": "SML004", - "name": "Motion Sensor (2)", - "state": { - "dark": false, - "daylight": true, - "lastupdated": "2022-01-13T13:19:58.655", - "lightlevel": 30063, - "lux": 1014 - }, - "swversion": "2.53.6", - "type": "ZHALightLevel", - "uniqueid": "00:17:88:01:02:00:21:f4-02-0400" - } + ] }, { "type": "$TYPE_TEMPERATURE_SENSOR", @@ -253,7 +204,8 @@ "name": "attr/name" }, { - "name": "attr/swversion" + "name": "attr/swversion", + "read": {"fn": "none"} }, { "name": "attr/type" @@ -267,11 +219,15 @@ }, { "name": "config/battery", - "parse": {"ep": 2, "cl": "0x0001", "at": "0x0021", "eval": "Item.val = Attr.val / 2"} + "parse": {"at": "0x0021", "cl": "0x0001", "ep": 2, "eval": "Item.val = Attr.val / 2"}, + "read": {"fn": "none"} }, { "name": "config/ledindication", - "parse": {"ep": 2, "cl": "0x0000", "at": "0x0033", "mf": "0x100b", "eval": "Item.val = Attr.val"} + "parse": {"at": "0x0033", "cl": "0x0000", "ep": 2, "eval": "Item.val = Attr.val", "mf": "0x100b"}, + "read": {"at": "0x0033", "cl": "0x0000", "ep": 2, "mf": "0x100b"}, + "write": {"at": "0x0033", "cl": "0x0000", "dt": "0x10", "ep": 2, "eval": "Item.val", "mf": "0x100b"}, + "refresh.interval": 86400 }, { "name": "config/offset" @@ -287,42 +243,19 @@ }, { "name": "config/usertest", - "parse": {"ep": 2, "cl": "0x0000", "at": "0x0032", "mf": "0x100b", "eval": "Item.val = Attr.val"} + "parse": {"at": "0x0032", "cl": "0x0000", "ep": 2, "eval": "Item.val = Attr.val", "mf": "0x100b"}, + "read": {"at": "0x0032", "cl": "0x0000", "ep": 2, "mf": "0x100b"}, + "write": {"at": "0x0032", "cl": "0x0000", "dt": "0x10", "ep": 2, "eval": "Item.val", "mf": "0x100b"}, + "refresh.interval": 86400 }, { "name": "state/lastupdated" }, { "name": "state/temperature", - "parse": {"ep": 2, "cl": "0x0402", "at": "0x0000", "eval": "Item.val = Attr.val + R.item('config/offset').val"}, - "awake": true + "parse": {"at": "0x0000", "cl": "0x0402", "ep": 2, "eval": "Item.val = Attr.val + R.item('config/offset').val"} } - ], - "example": { - "config": { - "alert": "none", - "battery": 0, - "ledindication": false, - "offset": 0, - "on": true, - "pending": [], - "reachable": true, - "usertest": false - }, - "ep": 2, - "etag": "0f14835ede4aac034a6022f956aea426", - "lastseen": "2022-01-13T13:20Z", - "manufacturername": "Philips", - "modelid": "SML004", - "name": "Motion Sensor (2)", - "state": { - "lastupdated": "2022-01-13T13:17:44.861", - "temperature": 2142 - }, - "swversion": "2.53.6", - "type": "ZHATemperature", - "uniqueid": "00:17:88:01:02:00:21:f4-02-0402" - } + ] } ], "bindings": [ @@ -351,4 +284,4 @@ "report": [ {"at": "0x0021", "dt": "0x20", "min": 7200, "max": 7200, "change": "0x00" } ] } ] -} +} \ No newline at end of file diff --git a/rest_sensors.cpp b/rest_sensors.cpp index 89dbd021d3..0273451f10 100644 --- a/rest_sensors.cpp +++ b/rest_sensors.cpp @@ -890,10 +890,22 @@ int DeRestPluginPrivate::changeSensorConfig(const ApiRequest &req, ApiResponse & } else if (rid.suffix == RConfigUsertest) // Boolean { - pendingMask |= R_PENDING_USERTEST; - sensor->enableRead(WRITE_USERTEST); - sensor->setNextReadTime(WRITE_USERTEST, QTime::currentTime()); - updated = true; + if (!devManaged) + { + pendingMask |= R_PENDING_USERTEST; + sensor->enableRead(WRITE_USERTEST); + sensor->setNextReadTime(WRITE_USERTEST, QTime::currentTime()); + updated = true; + } + else + { + if (rsub) + { + change.addTargetValue(rid.suffix, data.boolean); + rsub->addStateChange(change); + updated = true; + } + } } else if (rid.suffix == RConfigLat || rid.suffix == RConfigLong) // String {