Automation - If -> While -> Than

Hi guys,

For some of the automation that I have, I use the SmartRules app which allows me to have the following:
If this happens:
Multipurpose Sensor Opens
While any of things are true:
Kitchen Lights are on
TV is on
Than do these:
Turn off kitchen lights
Turn off TV

Now the problem is that this is not always reliable because it does not always triggers the actions…

My question is, can I use something similar (simple as that one) in order have this While any of things are true option between conditions?

Check out webCoRE

1 Like

Custom automation creator in the new app can handle this.

2 Likes

The custom automation tool wouldn’t work in this case. You can’t use a device as a condition and an action in the same automation with it. Unless something has changed.

2 Likes

Ah, yes. That is true. Need more :coffee:

1 Like

This was one time I was kinda hoping I was wrong… I’d love for that to change, honestly.

@jkp I’ve read about webCoRE but I was hoping on something much simple instead of this :slight_smile:

Can I ask why you need the while for that particular rule?

Why not just “if multipurpose Sensor opens, turn off the Kitchen light and the TV.“?

1 Like

Sure @JDRoberts, is just because I have another rule based on open the door, more precisely to start the TV and Kitchen lights if they are OFF

1 Like

I see. :sunglasses: So the door opening is acting as a toggle for the lights.

Yep :wink:

1 Like

Any reason you can’t just use the toggle option in Smart Lights or custom automation creator then?

1 Like

The problem with Toggle, if I remember, is that it doesn’t check the state of the devices, it only remembers the state it stores, which can end up causing problems. (Though, that may not matter, considering the way the OP stated the problem.)

In that line of thinking, though. Create a virtual switch, and use a couple of Smart Lights rules to control the virtual switch (one for on, and one for off). The restrictions in Smart Lights do allow you to check the switch you’re controlling. Then, create another Smart Lights rule, and use the Mirror option in Smart Lights to control the TV and kitchen lights with that virtual switch. Just a thought.

custom automation creator version of toggle works much better. Doesn’t depend on Smart Lights doing the action in order to keep things in sync.

2 Likes