Ok, here’s the JSON that you would create for a rule:
{
"if": {
"changes": {
"equals": {
"left": {
"device": {
"devices": [
"17ec5cb1-25a0-4923-8fa7-f5b6c95521d6"
],
"component": "main",
"capability": "switch",
"attribute": "switch"
}
},
"right": {
"array": {
"operands": [
{
"string": "on"
},
{
"string": "off"
}
]
}
}
}
},
"then": [
{
"scene": {
"scenes": [
"d733090e-2ff5-4212-8472-fbc9b3ed0c63"
]
}
},
{
"command": {
"devices": [
"8c350809-d794-4e44-abcc-102d253e8bc9"
],
"commands": [
{
"component": "main",
"capability": "switch",
"command": "on"
}
]
}
}
]
}
}
and now roughly the same behavior if you create a Routine from the SmartThings IOS app. Note that I recovered the JSON from the SmartThings API Browser as this seems to not be possible from the CLI directly.
{
"if": {
"or": [
{
"equals": {
"left": {
"device": {
"devices": [
"17ec5cb1-25a0-4923-8fa7-f5b6c95521d6"
],
"component": "main",
"capability": "switch",
"attribute": "switch",
"trigger": "Always"
},
"type": "device"
},
"right": {
"string": "on",
"type": "string"
},
"aggregation": "Any",
"changesOnly": false
},
"type": "equals"
},
{
"equals": {
"left": {
"device": {
"devices": [
"17ec5cb1-25a0-4923-8fa7-f5b6c95521d6"
],
"component": "switch2",
"capability": "switch",
"attribute": "switch",
"trigger": "Always"
},
"type": "device"
},
"right": {
"string": "off",
"type": "string"
},
"aggregation": "Any",
"changesOnly": false
},
"type": "equals"
}
],
"type": "or",
"then": [
{
"scene": {
"scenes": [
"d733090e-2ff5-4212-8472-fbc9b3ed0c63"
],
"sequence": {
"scenes": "Parallel"
}
},
"type": "scene"
},
{
"command": {
"devices": [
"17ec5cb1-25a0-4923-8fa7-f5b6c95521d6"
],
"commands": [
{
"component": "main",
"capability": "switch",
"command": "off"
}
],
"sequence": {
"commands": "Serial",
"devices": "Serial"
}
},
"type": "command"
}
],
"sequence": {
"then": "Parallel",
"else": "Serial"
}
},
"type": "if"
}
Note that even if you insert the “name” and “actions” wrapper, then basic constructs are different. Example, the requirement for “type” which is not recognized in Rules and many more inconsistencies.
Hope this helps getting my point across.