Skip to content

Commit

Permalink
Update DDFs for Hue motion sensors with measured_value (#7247)
Browse files Browse the repository at this point in the history
  • Loading branch information
ebaauw committed Sep 25, 2023
1 parent 05c9e7a commit 64ceb5b
Show file tree
Hide file tree
Showing 4 changed files with 224 additions and 12 deletions.
59 changes: 56 additions & 3 deletions devices/philips/sml001_motion_sensor.json
Expand Up @@ -399,6 +399,48 @@
{
"name": "attr/uniqueid"
},
{
"name": "cap/measured_value/max",
"parse": {
"fn": "zcl:attr",
"ep": 2,
"cl": "0x0402",
"at": "0x0002",
"eval": "Item.val = Attr.val / 100"
},
"read": {
"fn": "zcl:attr",
"ep": 2,
"cl": "0x0402",
"at": [
"0x0001",
"0x0002"
]
},
"refresh.interval": 86400
},
{
"name": "cap/measured_value/min",
"parse": {
"fn": "zcl:attr",
"ep": 2,
"cl": "0x0402",
"at": "0x0001",
"eval": "Item.val = Attr.val / 100"
}
},
{
"name": "cap/measured_value/quantity",
"static": "temperature"
},
{
"name": "cap/measured_value/substance",
"static": "air"
},
{
"name": "cap/measured_value/unit",
"static": "degC"
},
{
"name": "config/alert",
"default": "none"
Expand Down Expand Up @@ -433,14 +475,25 @@
"name": "state/lastupdated"
},
{
"name": "state/temperature",
"name": "state/measured_value",
"awake": true,
"parse": {
"fn": "zcl:attr",
"ep": 2,
"cl": "0x0402",
"at": "0x0000",
"eval": "Item.val = Attr.val + R.item('config/offset').val"
}
"eval": "Item.val = (Attr.val - R.item('config/offset').val) / 100"
},
"read": {
"fn": "zcl:attr",
"ep": 2,
"cl": "0x0402",
"at": "0x0000"
},
"refresh.interval": 360
},
{
"name": "state/temperature"
}
]
}
Expand Down
59 changes: 56 additions & 3 deletions devices/philips/sml002_motion_sensor.json
Expand Up @@ -407,6 +407,48 @@
{
"name": "attr/uniqueid"
},
{
"name": "cap/measured_value/max",
"parse": {
"fn": "zcl:attr",
"ep": 2,
"cl": "0x0402",
"at": "0x0002",
"eval": "Item.val = Attr.val / 100"
},
"read": {
"fn": "zcl:attr",
"ep": 2,
"cl": "0x0402",
"at": [
"0x0001",
"0x0002"
]
},
"refresh.interval": 86400
},
{
"name": "cap/measured_value/min",
"parse": {
"fn": "zcl:attr",
"ep": 2,
"cl": "0x0402",
"at": "0x0001",
"eval": "Item.val = Attr.val / 100"
}
},
{
"name": "cap/measured_value/quantity",
"static": "temperature"
},
{
"name": "cap/measured_value/substance",
"static": "air"
},
{
"name": "cap/measured_value/unit",
"static": "degC"
},
{
"name": "config/alert",
"default": "none"
Expand Down Expand Up @@ -441,14 +483,25 @@
"name": "state/lastupdated"
},
{
"name": "state/temperature",
"name": "state/measured_value",
"awake": true,
"parse": {
"fn": "zcl:attr",
"ep": 2,
"cl": "0x0402",
"at": "0x0000",
"eval": "Item.val = Attr.val + R.item('config/offset').val"
}
"eval": "Item.val = (Attr.val - R.item('config/offset').val) / 100"
},
"read": {
"fn": "zcl:attr",
"ep": 2,
"cl": "0x0402",
"at": "0x0000"
},
"refresh.interval": 360
},
{
"name": "state/temperature"
}
]
}
Expand Down
59 changes: 56 additions & 3 deletions devices/philips/sml003_motion_sensor.json
Expand Up @@ -413,6 +413,48 @@
{
"name": "attr/uniqueid"
},
{
"name": "cap/measured_value/max",
"parse": {
"fn": "zcl:attr",
"ep": 2,
"cl": "0x0402",
"at": "0x0002",
"eval": "Item.val = Attr.val / 100"
},
"read": {
"fn": "zcl:attr",
"ep": 2,
"cl": "0x0402",
"at": [
"0x0001",
"0x0002"
]
},
"refresh.interval": 86400
},
{
"name": "cap/measured_value/min",
"parse": {
"fn": "zcl:attr",
"ep": 2,
"cl": "0x0402",
"at": "0x0001",
"eval": "Item.val = Attr.val / 100"
}
},
{
"name": "cap/measured_value/quantity",
"static": "temperature"
},
{
"name": "cap/measured_value/substance",
"static": "air"
},
{
"name": "cap/measured_value/unit",
"static": "degC"
},
{
"name": "config/alert",
"default": "none"
Expand Down Expand Up @@ -447,14 +489,25 @@
"name": "state/lastupdated"
},
{
"name": "state/temperature",
"name": "state/measured_value",
"awake": true,
"parse": {
"fn": "zcl:attr",
"ep": 2,
"cl": "0x0402",
"at": "0x0000",
"eval": "Item.val = Attr.val + R.item('config/offset').val"
}
"eval": "Item.val = (Attr.val - R.item('config/offset').val) / 100"
},
"read": {
"fn": "zcl:attr",
"ep": 2,
"cl": "0x0402",
"at": "0x0000"
},
"refresh.interval": 360
},
{
"name": "state/temperature"
}
]
}
Expand Down
59 changes: 56 additions & 3 deletions devices/philips/sml004_motion_sensor.json
Expand Up @@ -413,6 +413,48 @@
{
"name": "attr/uniqueid"
},
{
"name": "cap/measured_value/max",
"parse": {
"fn": "zcl:attr",
"ep": 2,
"cl": "0x0402",
"at": "0x0002",
"eval": "Item.val = Attr.val / 100"
},
"read": {
"fn": "zcl:attr",
"ep": 2,
"cl": "0x0402",
"at": [
"0x0001",
"0x0002"
]
},
"refresh.interval": 86400
},
{
"name": "cap/measured_value/min",
"parse": {
"fn": "zcl:attr",
"ep": 2,
"cl": "0x0402",
"at": "0x0001",
"eval": "Item.val = Attr.val / 100"
}
},
{
"name": "cap/measured_value/quantity",
"static": "temperature"
},
{
"name": "cap/measured_value/substance",
"static": "air"
},
{
"name": "cap/measured_value/unit",
"static": "degC"
},
{
"name": "config/alert",
"default": "none"
Expand Down Expand Up @@ -447,14 +489,25 @@
"name": "state/lastupdated"
},
{
"name": "state/temperature",
"name": "state/measured_value",
"awake": true,
"parse": {
"fn": "zcl:attr",
"ep": 2,
"cl": "0x0402",
"at": "0x0000",
"eval": "Item.val = Attr.val + R.item('config/offset').val"
}
"eval": "Item.val = (Attr.val - R.item('config/offset').val) / 100"
},
"read": {
"fn": "zcl:attr",
"ep": 2,
"cl": "0x0402",
"at": "0x0000"
},
"refresh.interval": 360
},
{
"name": "state/temperature"
}
]
}
Expand Down

0 comments on commit 64ceb5b

Please sign in to comment.