If you look at the JSON for a Rule that was created by the app which has a delayed action, it creates an action of type “group” which executes serially, starting with a sleep. For example:
{
"group": {
"actions": [
{
"sleep": {
"duration": {
"value": {
"integer": 10,
"type": "integer"
},
"unit": "Second"
},
"strategy": "Ignore"
},
"type": "sleep"
},
{
"command": {
"devices": [
"<device ID>"
],
"commands": [
{
"component": "main",
"capability": "switch",
"command": "on"
}
],
"sequence": {
"commands": "Serial",
"devices": "Serial"
}
},
"type": "command"
}
],
"sequence": {
"actions": "Serial"
}
},
"type": "group"
}
However, “group” is not recognized by the Rules API when creating a Rule with the CLI. The work around I’ve found is to use an “if” statement with an always true condition (ex: 1 == 1), and then control the sequence of the “then” clause. This allows me to run the overall rule actions serially while parallelizing certain portions of them or vice versa.
Is there a cleaner (if poorly documented) way to do this? Some equivalent of “group” in Rules API?
Mike