Sure, but a fair warinig upfront: my aproach has some complexity… . Alternatively, there are apps out there that can probably help you, but I have no experience with that. So, here is how I would go about.
For starters, you need a so called whitelisted Hue user. You can find that in either your binding definition in the .things file or in Paper UI. It’s a string that looks like a bunch of randome letters and digits, like AvW8220ZezINkJpfelDisdXAvkP8HPgk4loHK1FM
. With your browser of choice go to http://hue-bridge-ip//debug/clip.html. You will be presented with a screen like this:
Enter the Hue user at the yellow marked field and press GET
(don’t use ENTER). This will give you a JSON formatted response with all kinds of details about your Hue bridge. If you leave the /config
part out, you get the entire configuration, existing of lights, groups, schedules, scenes, rules (yes, Hue has rules too…), and sensors.
I’ll show an example configuration from one of my montion sensors ('ll leave the temperature sensor, light level sensor and some irrelevant fields out):
"rules": {
...
"94": {
"name": "MotionSensor 28.day-on",
"conditions": [
{
"address": "/config/localtime",
"operator": "in",
"value": "T08:15:00/T19:00:00"
},
{
"address": "/sensors/28/state/presence",
"operator": "eq",
"value": "true"
},
{
"address": "/sensors/28/state/presence",
"operator": "dx"
},
{
"address": "/sensors/31/state/status",
"operator": "lt",
"value": "1"
},
{
"address": "/sensors/29/state/dark",
"operator": "eq",
"value": "true"
}
],
"actions": [
{
"address": "/groups/9/action",
"method": "PUT",
"body": {
"on": true,
"bri": 112,
"ct": 359
}
},
{
"address": "/sensors/31/state",
"method": "PUT",
"body": {
"status": 1
}
}
]
},
"95": {
"name": "MotionSensor 28.day-dark-on",
"conditions": [
{
"address": "/config/localtime",
"operator": "in",
"value": "T08:15:00/T19:00:00"
},
{
"address": "/sensors/28/state/presence",
"operator": "eq",
"value": "true"
},
{
"address": "/sensors/29/state/dark",
"operator": "eq",
"value": "true"
},
{
"address": "/sensors/29/state/dark",
"operator": "dx"
},
{
"address": "/sensors/31/state/status",
"operator": "lt",
"value": "1"
}
],
"actions": [
{
"address": "/groups/9/action",
"method": "PUT",
"body": {
"on": true,
"bri": 112,
"ct": 359
}
},
{
"address": "/sensors/31/state",
"method": "PUT",
"body": {
"status": 1
}
}
]
},
"96": {
"name": "MotionSensor 28.night-on",
"conditions": [
{
"address": "/config/localtime",
"operator": "in",
"value": "T19:00:00/T08:15:00"
},
{
"address": "/sensors/28/state/presence",
"operator": "eq",
"value": "true"
},
{
"address": "/sensors/28/state/presence",
"operator": "dx"
},
{
"address": "/sensors/31/state/status",
"operator": "lt",
"value": "1"
},
{
"address": "/sensors/29/state/dark",
"operator": "eq",
"value": "true"
}
],
"actions": [
{
"address": "/groups/9/action",
"method": "PUT",
"body": {
"scene": "-U6HUKmize7diXS"
}
},
{
"address": "/sensors/31/state",
"method": "PUT",
"body": {
"status": 1
}
}
]
},
"97": {
"name": "MotionSensor 28.night-dark-on",
"conditions": [
{
"address": "/config/localtime",
"operator": "in",
"value": "T19:00:00/T08:15:00"
},
{
"address": "/sensors/28/state/presence",
"operator": "eq",
"value": "true"
},
{
"address": "/sensors/29/state/dark",
"operator": "eq",
"value": "true"
},
{
"address": "/sensors/29/state/dark",
"operator": "dx"
},
{
"address": "/sensors/31/state/status",
"operator": "lt",
"value": "1"
}
],
"actions": [
{
"address": "/groups/9/action",
"method": "PUT",
"body": {
"scene": "-U6HUKmize7diXS"
}
},
{
"address": "/sensors/31/state",
"method": "PUT",
"body": {
"status": 1
}
}
]
},
"98": {
"name": "MotionSensor 28.dim",
"status": "enabled",
"conditions": [
{
"address": "/sensors/28/state/presence",
"operator": "eq",
"value": "false"
},
{
"address": "/sensors/28/state/presence",
"operator": "ddx",
"value": "PT00:04:00"
},
{
"address": "/groups/9/state/any_on",
"operator": "eq",
"value": "true"
}
],
"actions": [
{
"address": "/scenes/R3YHvRbI5ZIMj7W",
"method": "PUT",
"body": {
"storelightstate": true
}
},
{
"address": "/groups/9/action",
"method": "PUT",
"body": {
"bri_inc": -128
}
},
{
"address": "/sensors/31/state",
"method": "PUT",
"body": {
"status": 2
}
}
]
},
"99": {
"name": "MotionSensor 28.recover",
"conditions": [
{
"address": "/sensors/28/state/presence",
"operator": "eq",
"value": "true"
},
{
"address": "/sensors/28/state/presence",
"operator": "dx"
},
{
"address": "/sensors/31/state/status",
"operator": "gt",
"value": "1"
}
],
"actions": [
{
"address": "/groups/9/action",
"method": "PUT",
"body": {
"on": true,
"bri": 112,
"ct": 359
}
},
{
"address": "/sensors/31/state",
"method": "PUT",
"body": {
"status": 1
}
}
]
},
"100": {
"name": "MotionSensor 28.off",
"conditions": [
{
"address": "/sensors/28/state/presence",
"operator": "eq",
"value": "false"
},
{
"address": "/sensors/31/state/status",
"operator": "ddx",
"value": "PT00:00:30"
},
{
"address": "/sensors/31/state/status",
"operator": "gt",
"value": "1"
}
],
"actions": [
{
"address": "/groups/9/action",
"method": "PUT",
"body": {
"on": false
}
},
{
"address": "/sensors/31/state",
"method": "PUT",
"body": {
"status": 0
}
}
]
},
"101": {
"name": "MotionSensor 28.arm",
"conditions": [
{
"address": "/groups/9/state/any_on",
"operator": "eq",
"value": "false"
},
{
"address": "/sensors/28/state/presence",
"operator": "eq",
"value": "false"
}
],
"actions": [
{
"address": "/sensors/31/state",
"method": "PUT",
"body": {
"status": 0
}
}
]
},
...
"sensors": {
....
"28": {
"state": {
"presence": false,
"lastupdated": "2019-01-10T10:01:11"
},
"config": {
"on": true,
"alert": "none"
},
"name": "Hue motion sensor Toilet",
"type": "ZLLPresence",
"productname": "Hue motion sensor",
},
"29": {
"state": {
"lightlevel": 0,
"dark": true,
"daylight": false,
"lastupdated": "2019-01-10T10:40:07"
},
"config": {
"on": true,
"alert": "none",
"tholddark": 17576,
"tholdoffset": 7000
},
"name": "Hue ambient light sensor 1",
"type": "ZLLLightLevel"
},
....
"31": {
"state": {
"status": 0,
"lastupdated": "2019-01-10T10:33:55"
},
"config": {
"on": true,
"reachable": false
},
"name": "MotionSensor 28.Companion",
"type": "CLIPGenericStatus",
"modelid": "PHA_STATE"
},
As can be seen, there are 3 sensors involved, a motion sensor (28), a light level sensor (29) and a companion sensor (31), and many rules. The rules are where the dimming takes place, so they are the interesting part. They have conditions and actions, much like OH rules when and then sections. Conditions are for instance about whether it is in a certain time slot, presence is detected or the light level is below or above a certain value. Rule 98 is an example of how the dimming takes place after 4 minutes of no presence detected (and rule 99 recovers the light level if motion is detected during the dimming period).
Before ‘we’ go about deleting rules, you should determine if this kind of configuration is active in your Hue bridge.