Compare commits

...

No commits in common. "ce1851cf5a4f5fc58f19507d90fc6cd623737535" and "4c565e59c23dd01f72656924ef16bfbc50efa00f" have entirely different histories.

26 changed files with 580 additions and 14 deletions

View File

@ -0,0 +1,27 @@
# Dimmer Switch Ruleset for Color Control
This ruleset is a configuration that can change
color and temperature for a group of lights.
This may be the case in the bedroom.
The on and off buttons work as expected.
Pressing the on button longer toggles color and temperature mode.
Pressing the brightness buttons change the brightness,
holding the brightness buttons change the color or temperature accordingly.
## Devices
```sh
# IDS="s/BASENAME/xxx/g; s/GROUP/xxx/g; s/DIMMER/xxx/g; s/MEM/xxx/g"
```
Install the memory sensor and note its ID before proceding.
Use the `mem.sensor.json` file, replace the `BASENAME`, and POST it to the /api/KEY/sensors URL.
* `BASENAME` Basename of the ruleset
* `GROUP` ID of the group to handle
* `DIMMER` ID of the dimmer switch
* `MEM` ID of the memory sensor

View File

@ -0,0 +1,29 @@
{
"name": "BASENAME.dn-hold-ct",
"conditions": [
{
"address": "/sensors/MEM/state/status",
"operator": "gt",
"value": "0"
},
{
"address": "/sensors/DIMMER/state/buttonevent",
"operator": "eq",
"value": "3001"
},
{
"address": "/sensors/DIMMER/state/lastupdated",
"operator": "dx"
}
],
"actions": [
{
"address": "/groups/GROUP/action",
"method": "PUT",
"body": {
"transitiontime": 1,
"ct_inc": 24
}
}
]
}

View File

@ -0,0 +1,29 @@
{
"name": "BASENAME.dn-hold-hue",
"conditions": [
{
"address": "/sensors/MEM/state/status",
"operator": "lt",
"value": "1"
},
{
"address": "/sensors/DIMMER/state/buttonevent",
"operator": "eq",
"value": "3001"
},
{
"address": "/sensors/DIMMER/state/lastupdated",
"operator": "dx"
}
],
"actions": [
{
"address": "/groups/GROUP/action",
"method": "PUT",
"body": {
"transitiontime": 1,
"hue_inc": -10000
}
}
]
}

View File

@ -0,0 +1,24 @@
{
"name": "BASENAME.dn-short",
"conditions": [
{
"address": "/sensors/DIMMER/state/buttonevent",
"operator": "eq",
"value": "3002"
},
{
"address": "/sensors/DIMMER/state/lastupdated",
"operator": "dx"
}
],
"actions": [
{
"address": "/groups/GROUP/action",
"method": "PUT",
"body": {
"transitiontime": 1,
"bri_inc": -25
}
}
]
}

View File

@ -0,0 +1,8 @@
{
"name": "BASENAME.mem",
"type": "CLIPGenericStatus",
"modelid": "MEM001",
"manufacturername": "Adrium",
"swversion": "1.0",
"uniqueid": "00:ad:10:f3:2a:9b-03"
}

View File

@ -0,0 +1,23 @@
{
"name": "BASENAME.off-short",
"conditions": [
{
"address": "/sensors/DIMMER/state/buttonevent",
"operator": "eq",
"value": "4002"
},
{
"address": "/sensors/DIMMER/state/lastupdated",
"operator": "dx"
}
],
"actions": [
{
"address": "/groups/GROUP/action",
"method": "PUT",
"body": {
"on": false
}
}
]
}

View File

@ -0,0 +1,37 @@
{
"name": "BASENAME.on-long-ct",
"conditions": [
{
"address": "/sensors/MEM/state/status",
"operator": "gt",
"value": "0"
},
{
"address": "/sensors/DIMMER/state/buttonevent",
"operator": "eq",
"value": "1003"
},
{
"address": "/sensors/DIMMER/state/lastupdated",
"operator": "dx"
}
],
"actions": [
{
"address": "/groups/GROUP/action",
"method": "PUT",
"body": {
"bri": 203,
"hue": 60000,
"sat": 240
}
},
{
"address": "/sensors/MEM/state",
"method": "PUT",
"body": {
"status": 0
}
}
]
}

View File

@ -0,0 +1,36 @@
{
"name": "BASENAME.on-long-hue",
"conditions": [
{
"address": "/sensors/MEM/state/status",
"operator": "lt",
"value": "1"
},
{
"address": "/sensors/DIMMER/state/buttonevent",
"operator": "eq",
"value": "1003"
},
{
"address": "/sensors/DIMMER/state/lastupdated",
"operator": "dx"
}
],
"actions": [
{
"address": "/groups/GROUP/action",
"method": "PUT",
"body": {
"bri": 203,
"ct": 357
}
},
{
"address": "/sensors/MEM/state",
"method": "PUT",
"body": {
"status": 1
}
}
]
}

View File

@ -0,0 +1,23 @@
{
"name": "BASENAME.on-short",
"conditions": [
{
"address": "/sensors/DIMMER/state/buttonevent",
"operator": "eq",
"value": "1002"
},
{
"address": "/sensors/DIMMER/state/lastupdated",
"operator": "dx"
}
],
"actions": [
{
"address": "/groups/GROUP/action",
"method": "PUT",
"body": {
"on": true
}
}
]
}

View File

@ -0,0 +1,29 @@
{
"name": "BASENAME.up-hold-ct",
"conditions": [
{
"address": "/sensors/MEM/state/status",
"operator": "gt",
"value": "0"
},
{
"address": "/sensors/DIMMER/state/buttonevent",
"operator": "eq",
"value": "2001"
},
{
"address": "/sensors/DIMMER/state/lastupdated",
"operator": "dx"
}
],
"actions": [
{
"address": "/groups/GROUP/action",
"method": "PUT",
"body": {
"transitiontime": 1,
"ct_inc": -24
}
}
]
}

View File

@ -0,0 +1,29 @@
{
"name": "BASENAME.up-hold-hue",
"conditions": [
{
"address": "/sensors/MEM/state/status",
"operator": "lt",
"value": "1"
},
{
"address": "/sensors/DIMMER/state/buttonevent",
"operator": "eq",
"value": "2001"
},
{
"address": "/sensors/DIMMER/state/lastupdated",
"operator": "dx"
}
],
"actions": [
{
"address": "/groups/GROUP/action",
"method": "PUT",
"body": {
"transitiontime": 1,
"hue_inc": 10000
}
}
]
}

View File

@ -0,0 +1,24 @@
{
"name": "BASENAME.up-short",
"conditions": [
{
"address": "/sensors/DIMMER/state/buttonevent",
"operator": "eq",
"value": "2002"
},
{
"address": "/sensors/DIMMER/state/lastupdated",
"operator": "dx"
}
],
"actions": [
{
"address": "/groups/GROUP/action",
"method": "PUT",
"body": {
"transitiontime": 1,
"bri_inc": 25
}
}
]
}

View File

@ -1,13 +1,11 @@
# Dimmer Switch Ruleset for Two Light Groups # Dimmer Switch Ruleset for Two Light Groups
This ruleset assumes two light groups inside the same room. This ruleset assumes two light groups inside the same room.
This may be the case in the living room.
The on button first turns on one group and then the other. The on button first turns on one group and then the other.
So does the off button in reverse order. So does the off button in reverse order.
The lights are only switched on without changing
the previously configured state.
The lights can be reset to a bright but confortable mood for the evening The lights can be reset to a bright but confortable mood for the evening
when pressing the on button longer. when pressing the on button longer.

View File

@ -1,8 +1,8 @@
{ {
"name": "BASENAME.mem", "name": "BASENAME.mem",
"type": "CLIPGenericStatus", "type": "CLIPGenericStatus",
"modelid": "Adrium Memory", "modelid": "MEM001",
"manufacturername": "Adrium", "manufacturername": "Adrium",
"swversion": "1.0", "swversion": "1.0",
"uniqueid": "d0:ac:4e:d3:93:3b:7a:00-01" "uniqueid": "00:ad:10:f3:2a:9b-01"
} }

View File

@ -4,7 +4,7 @@
{ {
"address": "/sensors/DIMMER/state/buttonevent", "address": "/sensors/DIMMER/state/buttonevent",
"operator": "eq", "operator": "eq",
"value": "1001" "value": "1003"
}, },
{ {
"address": "/sensors/DIMMER/state/lastupdated", "address": "/sensors/DIMMER/state/lastupdated",

View File

@ -0,0 +1,13 @@
# Turn Off All Lights
This ruleset is a simple configuration that turns off all
lights when the motion sensor does not register movement within a 2 hour timeframe.
## Devices
```sh
IDS="s/BASENAME/xxx/g; s/MOTION/xxx/g"
```
* `BASENAME` Basename of the ruleset
* `MOTION` ID of the motion sensor

View File

@ -0,0 +1,24 @@
{
"name": "BASENAME.all-off",
"conditions": [
{
"address": "/sensors/MOTION/state/presence",
"operator": "eq",
"value": "false"
},
{
"address": "/sensors/MOTION/state/lastupdated",
"operator": "stable",
"value": "PT02:00:00"
}
],
"actions": [
{
"address": "/groups/0/action",
"method": "PUT",
"body": {
"on": false
}
}
]
}

View File

@ -0,0 +1,24 @@
# Intelligent Motion Sensor Ruleset
This ruleset is an improved configuration that turns on a
group of lights when the motion sensor registers movement.
It does not trigger an action, if a light in the group is already switched on.
In the night, it only turns on the lights dim.
The daylight sensor is checked for sunrise times.
It does not switch off the lights, if they were not switched on by the sensor.
## Devices
```sh
IDS="s/BASENAME/xxx/g; s/GROUP/xxx/g; s/MOTION/xxx/g; s/AMBIENT/xxx/g; s/DAYLIGHT/1/g; s/MEM/xxx/g"
```
* `BASENAME` Basename of the ruleset
* `GROUP` ID of the group to handle
* `MOTION` ID of the motion sensor
* `AMBIENT` ID of the ambient light sensor inside the motion sensor
* `DAYLIGHT` ID of the daylight sensor (usually 1)
* `MEM` ID of the memory sensor

View File

@ -0,0 +1,8 @@
{
"name": "BASENAME.mem",
"type": "CLIPGenericStatus",
"modelid": "MEM001",
"manufacturername": "Adrium",
"swversion": "1.0",
"uniqueid": "00:ad:10:f3:2a:9b-02"
}

View File

@ -0,0 +1,36 @@
{
"name": "BASENAME.off",
"conditions": [
{
"address": "/sensors/MEM/state/status",
"operator": "gt",
"value": "0"
},
{
"address": "/sensors/MOTION/state/presence",
"operator": "eq",
"value": "false"
},
{
"address": "/sensors/MOTION/state/lastupdated",
"operator": "ddx",
"value": "PT00:02:00"
}
],
"actions": [
{
"address": "/groups/GROUP/action",
"method": "PUT",
"body": {
"on": false
}
},
{
"address": "/sensors/MEM/state",
"method": "PUT",
"body": {
"status": 0
}
}
]
}

View File

@ -0,0 +1,52 @@
{
"name": "BASENAME.on-bright",
"conditions": [
{
"address": "/sensors/AMBIENT/state/dark",
"operator": "eq",
"value": "true"
},
{
"address": "/groups/GROUP/state/any_on",
"operator": "eq",
"value": "false"
},
{
"address": "/config/localtime",
"operator": "not in",
"value": "T00:00:00/T05:00:00"
},
{
"address": "/sensors/DAYLIGHT/state/daylight",
"operator": "eq",
"value": "true"
},
{
"address": "/sensors/MOTION/state/presence",
"operator": "eq",
"value": "true"
},
{
"address": "/sensors/MOTION/state/lastupdated",
"operator": "dx"
}
],
"actions": [
{
"address": "/groups/GROUP/action",
"method": "PUT",
"body": {
"on": true,
"bri": 240,
"ct": 357
}
},
{
"address": "/sensors/MEM/state",
"method": "PUT",
"body": {
"status": 1
}
}
]
}

View File

@ -0,0 +1,52 @@
{
"name": "BASENAME.on-dim-morning",
"conditions": [
{
"address": "/sensors/AMBIENT/state/dark",
"operator": "eq",
"value": "true"
},
{
"address": "/groups/GROUP/state/any_on",
"operator": "eq",
"value": "false"
},
{
"address": "/config/localtime",
"operator": "not in",
"value": "T00:00:00/T05:00:00"
},
{
"address": "/sensors/DAYLIGHT/state/daylight",
"operator": "eq",
"value": "false"
},
{
"address": "/sensors/MOTION/state/presence",
"operator": "eq",
"value": "true"
},
{
"address": "/sensors/MOTION/state/lastupdated",
"operator": "dx"
}
],
"actions": [
{
"address": "/groups/GROUP/action",
"method": "PUT",
"body": {
"on": true,
"bri": 13,
"ct": 1000
}
},
{
"address": "/sensors/MEM/state",
"method": "PUT",
"body": {
"status": 1
}
}
]
}

View File

@ -0,0 +1,47 @@
{
"name": "BASENAME.on-dim-night",
"conditions": [
{
"address": "/sensors/AMBIENT/state/dark",
"operator": "eq",
"value": "true"
},
{
"address": "/groups/GROUP/state/any_on",
"operator": "eq",
"value": "false"
},
{
"address": "/config/localtime",
"operator": "in",
"value": "T00:00:00/T05:00:00"
},
{
"address": "/sensors/MOTION/state/presence",
"operator": "eq",
"value": "true"
},
{
"address": "/sensors/MOTION/state/lastupdated",
"operator": "dx"
}
],
"actions": [
{
"address": "/groups/GROUP/action",
"method": "PUT",
"body": {
"on": true,
"bri": 13,
"ct": 1000
}
},
{
"address": "/sensors/MEM/state",
"method": "PUT",
"body": {
"status": 1
}
}
]
}

View File

@ -32,7 +32,7 @@
"method": "PUT", "method": "PUT",
"body": { "body": {
"on": true, "on": true,
"bri": 230 "bri": 240
} }
} }
] ]

View File

@ -34,12 +34,6 @@
"on": true, "on": true,
"bri": 5 "bri": 5
} }
},
{
"address": "/groups/GROUP/action",
"method": "PUT",
"body": {
}
} }
] ]
} }

View File

@ -17,7 +17,7 @@
"method": "PUT", "method": "PUT",
"body": { "body": {
"on": true, "on": true,
"bri": 205, "bri": 203,
"ct": 182 "ct": 182
} }
} }