G’day all, is there a better way to dim a globe than this?
{
"name": "Test Dimming over 1 minute",
"actions": [
{
"if": {
"equals": {
"left": {
"string": "on"
},
"right": {
"device": {
"devices": [
"c47536d9-bf37-4995-9dee-87f31e9d9100"
],
"component": "main",
"capability": "switch",
"attribute": "switch",
"trigger": "Always"
}
}
},
"then": [
{
"command": {
"devices": [
"c47536d9-bf37-4995-9dee-87f31e9d9100"
],
"commands": [
{
"component": "main",
"capability": "switchLevel",
"command": "setLevel",
"arguments": [
{
"integer": 30
}
]
}
]
}
},
{
"sleep": {
"duration": {
"value": {
"integer": 10
},
"unit": "Second"
}
}
},
{
"command": {
"devices": [
"c47536d9-bf37-4995-9dee-87f31e9d9100"
],
"commands": [
{
"component": "main",
"capability": "switchLevel",
"command": "setLevel",
"arguments": [
{
"integer": 25
}
]
}
]
}
},
{
"sleep": {
"duration": {
"value": {
"integer": 10
},
"unit": "Second"
}
}
},
{
"command": {
"devices": [
"c47536d9-bf37-4995-9dee-87f31e9d9100"
],
"commands": [
{
"component": "main",
"capability": "switchLevel",
"command": "setLevel",
"arguments": [
{
"integer": 20
}
]
}
]
}
},
{
"sleep": {
"duration": {
"value": {
"integer": 10
},
"unit": "Second"
}
}
},
{
"command": {
"devices": [
"c47536d9-bf37-4995-9dee-87f31e9d9100"
],
"commands": [
{
"component": "main",
"capability": "switchLevel",
"command": "setLevel",
"arguments": [
{
"integer": 15
}
]
}
]
}
},
{
"sleep": {
"duration": {
"value": {
"integer": 10
},
"unit": "Second"
}
}
},
{
"command": {
"devices": [
"c47536d9-bf37-4995-9dee-87f31e9d9100"
],
"commands": [
{
"component": "main",
"capability": "switchLevel",
"command": "setLevel",
"arguments": [
{
"integer": 10
}
]
}
]
}
},
{
"sleep": {
"duration": {
"value": {
"integer": 10
},
"unit": "Second"
}
}
},
{
"command": {
"devices": [
"c47536d9-bf37-4995-9dee-87f31e9d9100"
],
"commands": [
{
"component": "main",
"capability": "switchLevel",
"command": "setLevel",
"arguments": [
{
"integer": 5
}
]
}
]
}
},
{
"sleep": {
"duration": {
"value": {
"integer": 10
},
"unit": "Second"
}
}
},
{
"command": {
"devices": [
"c47536d9-bf37-4995-9dee-87f31e9d9100"
],
"commands": [
{
"component": "main",
"capability": "switch",
"command": "off"
}
]
}
}
]
}
}
]
}
I’ve thought of maybe using an if statement so that if setlevel is >= 0 then setlevel = level -5 but can’t get anything to work
Cheers, Geoff