Skip to content

Commit

Permalink
Merge remote-tracking branch 'swoopx/philips'
Browse files Browse the repository at this point in the history
  • Loading branch information
manup committed Jun 2, 2022
2 parents d64e294 + bbdc93e commit b56eb16
Show file tree
Hide file tree
Showing 7 changed files with 465 additions and 281 deletions.
3 changes: 2 additions & 1 deletion devices/generic/items/config_ledindication_item.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"datatype": "Bool",
"access": "RW",
"public": true,
"description": "Activates the LED indicator."
"description": "Activates the LED indicator.",
"default": false
}
3 changes: 2 additions & 1 deletion devices/generic/items/config_sensitivity_item.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
"access": "RW",
"public": true,
"range": [0, 255],
"description": "The sensor sensitivity."
"description": "The sensor sensitivity.",
"default": 0
}
79 changes: 48 additions & 31 deletions devices/philips/sml001_motion_sensor.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [ ],
Expand Down Expand Up @@ -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"
Expand All @@ -70,32 +72,33 @@
},
{
"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",
"static": 2
},
{
"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": {
Expand Down Expand Up @@ -145,7 +148,8 @@
"name": "attr/name"
},
{
"name": "attr/swversion"
"name": "attr/swversion",
"read": {"fn": "none"}
},
{
"name": "attr/type"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -251,7 +261,8 @@
"name": "attr/name"
},
{
"name": "attr/swversion"
"name": "attr/swversion",
"read": {"fn": "none"}
},
{
"name": "attr/type"
Expand All @@ -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"
Expand All @@ -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": {
Expand Down
Loading

0 comments on commit b56eb16

Please sign in to comment.