#Automation order

1 messages · Page 1 of 1 (latest)

cinder socket
#

Hi all.

Just got my head around the govee2mqtt stuff and now for scenes pulled in. Previously I was setting colours in app and just turning on and off with HA.

They are light strips in my kitchen above and below cupboards.

Now I’ve decided I’m going to make a handful of automations based on time period

Trigger is kitchen motion sensor

Eg

overnight, top strip only white 30% brightness

Daytime if room brightness below a certain amount on white top and bottom

Evening colour fade top and bottom

Morning orange high and white low or similar

This is all simple enough I set up 4 automations using the trigger, checking the time period and only the relevant automation will run.

But then I was thinking, if forecast is for rain I can set one of the strips to pulse a few blue colours as a visual queue

Is it possible to achieve?

My head is telling me that both automations would trigger in a case of rain and in which case which would win unless there is an order eg

If morning and rain is false it fails and goes to second automation where it’s morning and then it runs.

Done a fair bit of bash and powershell scripting over the years and I’m thinking of if/else if commands or nested if commands.

Maybe it’s not something that jumps out in the ui automation screens and needs to be done in yaml?

Appreciate any pointers

tropic sentinel
#

'Time periods' aren't triggers, specific times are

#

There's no set order if two automations are set to trigger at exactly the same time

cinder socket
#

Sorry should have been more clear

Trigger is motion
Then it runs a check (and if) time is between 10pm and 5am set light to nighttime scene

I may possibly have found my own answer now in that I do this with a script.

Script with a bunch of nested if statements or at least for the one where I need to check the weather as well.

lost karma
#

The choose block is useful for this, instead of nested if statements.

#

I’d suggest a single automation, nothing in the conditions (“and if”) section, a “choose” block for the action, and you can list all your options in that block. The “choose” block will evaluate the conditions for each option in the order the options are listed, and will only execute the first one that passes.

cinder socket
#

Simplicity would be great to reduce sprawl in automation section