I’m having some issues with my rules. My understanding was I could have multiple actions at the top level. But it seems whenever I add a second rule it will cause the first rule to not work or be inconsistent. Here’s an example of what I am doing.
{
"name": "Dining Room/Kitchen Rules",
"actions": [
{
"if": {
"equals": {
"left": {
"device": {
"devices": [
"Light Switch"
],
"component": "main",
"capability": "switch",
"attribute": "switch"
}
},
"right": {
"string": "on"
}
},
"then": [
{
"command": {
"devices": ["Cabinet Lights"],
"commands": [
{
"component": "main",
"capability": "switch",
"command": "on"
},
{
"component": "main",
"capability": "switchLevel",
"command": "setLevel",
"arguments": [{"integer": 100}]
},
{
"component": "main",
"capability": "colorTemperature",
"command": "setColorTemperature",
"arguments": [{"integer": 4600}]
}
]
}
}
],
"else": [
{
"command": {
"devices": [ "Cabinet Lights"],
"commands": [
{
"component": "main",
"capability": "switch",
"command": "off"
}]
}
}
],
"sequence": {
"then": "Parallel",
"else": "Parallel"
}
}
},
{
"if": {
"remains":{
"equals": {
"left": {
"device": {
"devices": ["Dishwasher Sensor"],
"component": "main",
"capability": "accelerationSensor",
"attribute": "acceleration",
"trigger": "Always"
}
},
"right": {
"string": "active"
}
},
"duration": {
"value": {
"integer": 3
},
"unit": "Minute"
}
},
"then": [
{
"command": {
"devices": ["Virtual Clean Status "],
"commands": [
{
"component": "main",
"capability": "switch",
"command": "on"
}
]
}
}
]
}
},
{
"if": {
"remains":{
"equals": {
"left": {
"device": {
"devices": ["Dishwasher Sensor"],
"component": "main",
"capability": "contactSensor",
"attribute": "contact",
"trigger": "Always"
}
},
"right": {
"string": "open"
}
},
"duration": {
"value": {
"integer": 2
},
"unit": "Minute"
}
},
"then": [
{
"command": {
"devices": ["Virtual Clean Status"],
"commands": [
{
"component": "main",
"capability": "switch",
"command": "off"
}
]
}
}
]
}
}
]
}
So I’m checking
If Kitchen Lights are On, Then turn on Cabinet Lights, Else Turn off Cabinet Lights
If Dishwasher Motion detected for 3 minutes, Then Set Dishes Status to Clean
If Dishwasher is Open for 2 minutes, Then Set Dishes Status to Dirty
The first one works perfectly when I don’t have the other two in the rule.
Any idea what I may be doing wrong?