Adjust brightness action does not affect the on/off state, a sensible default I actually defended. That’s useful to reach the minimum brightness of a light, otherwise would turn off, and also to avoid turning on every light in a group when you expect to control only the lights that are on. The assumption is that you control on/off with specific buttons or scenes.
On/Off control by rotating is possible with two easy automations:
- If the light is at 1% (the minimum usually, check yours) and you rotate left, turn off the light.
- If the light is off and you rotate right, turn on the light.
The catch is the knob rotation is not exposed to the app routines so you need to create the rules in the advanced website Rules → + Add Rule and paste the following, replacing the device ID of the light and the rotary knob or wheel that you can find in the devices section of the website. You may need to change the component name too, for the scroll wheel they are main/group2/group3.
Rule 1. Turn Off light when rotated left, precondition it is at 1%
[
{
"if": {
"and": [
{
"lessThan": {
"left": {
"device": {
"devices": [
"KNOB-OR-WHEEL-DEVICE-ID"
],
"component": "main",
"capability": "knob",
"attribute": "rotateAmount",
"trigger": "Always"
}
},
"right": {
"integer": 0
},
"changesOnly": false
}
},
{
"equals": {
"left": {
"device": {
"devices": [
"LIGHT-DEVICE-ID"
],
"component": "main",
"capability": "switchLevel",
"attribute": "level",
"trigger": "Never"
}
},
"right": {
"integer": 1
},
"changesOnly": false
}
}
],
"then": [
{
"command": {
"devices": [
"LIGHT-DEVICE-ID"
],
"commands": [
{
"component": "main",
"capability": "switch",
"command": "off"
}
]
}
}
],
"sequence": {
"then": "Parallel",
"else": "Parallel"
}
}
}
]
Rule 2. Turn On light when rotated right, precondition it is Off
[
{
"if": {
"and": [
{
"greaterThan": {
"left": {
"device": {
"devices": [
"KNOB-OR-WHEEL-ID"
],
"component": "main",
"capability": "knob",
"attribute": "rotateAmount",
"trigger": "Always"
}
},
"right": {
"integer": 0
},
"changesOnly": false
}
},
{
"equals": {
"left": {
"device": {
"devices": [
"LIGHT-DEVICE-ID"
],
"component": "main",
"capability": "switch",
"attribute": "switch",
"trigger": "Never"
}
},
"right": {
"string": "off"
},
"changesOnly": false
}
}
],
"then": [
{
"command": {
"devices": [
"LIGHT-DEVICE-ID"
],
"commands": [
{
"component": "main",
"capability": "switch",
"command": "on"
}
]
}
}
],
"sequence": {
"then": "Parallel",
"else": "Parallel"
}
}
}
]
The rules are valid for any rotary device with knob capability and compatible with stock drivers. For custom drivers you may not need the rules if the driver also exposes the rotation as Swipe Left / Right or other means right inside the app, e.g. you would just do a “if Swipe Left, precondition light is 1%, turn light off”.
