SmartThings Community

Running an automation once?

I’ve got an automation that switches the lights when a light sensor drops below a certain lux value. It works ok apart from that it keeps running after I turn the lights off. So, last night, I switched all the lights off with Alexa and 2 minutes later they all came on again. Took me a couple of iterations to realise what was going on.

Is there a way round this? I just want it to run the first time it drops below the level and then not again until the next day.

I had the same automation on webcore but found webcore very unreliable, even with really simple automations. So I’m trying to stick to the automations in the ST app.

:thinking: webCoRE, in my experience, has been more reliable than SmartLighting. However your experience is yours.

You can create a Virtual Switch and have that VS turn on when the Automation executes and have that same VS as a restriction if on.

Then create another rule to turn off the VS at a specific time each day.

Should work as you need it. They might have an “Only run once” option in the New App…

2 Likes

You could create an X counter.

X= 0;

If Lux is below this value and X = 0 then turn on light and set x= 1;

If time is 6:00 AM then set x= 0;

Something like this.

Nice plan but I don’t think you can create variables in the app?

woops, thought I was on the webcore community! Well thats the way id do, In webcore automation for ST

Yeah, I’ve abandoned webcore for the moment. I just found it too flaky. I’ve got round this one by setting using modes. So before I go to bed, I set the house to night. My automations only run when the house is in home mode. I know that’s what this is for and should have done this sooner but I hadn’t got my head round how to do it. Worked last night so I just need to finish setting it up with a virtual switch so that it changes modes with my “night night” Alexa routine.

1 Like

Using “Modes” for overrides can potentially make things harder to deal with. From my experience, it’s more advantageous to use Virtual Switches to add “Restrictions”.

This approach isolates automations based on Virtual Switches while Modes affect all automations.

For example, you have a room where you want to pause all automations in that room. If you are using Modes then the entire ST dynamics change. You could simply have a VS for that particular room and just turn off that VS which would then pause all automations that you have that VS tied to.

Here’s a SS:

Horses for courses I think. I only have a handful of automations at the moment. If you get into the habit of specifying which mode you want the automation to run in - Day, Away, Night - and make that a condition of every automation then you only have to deal with one thing: what the mode is. I think that’s probably good practice anyway.

3 Likes

Was my thoughts as well when I only had a handful of automations. As time went on, I realized the error in my thinking and had to redo everything.

I have now over 200 devices and way too many automations to quantify.

YMMV

1 Like