#Two separate automations, or combine into one?

1 messages ยท Page 1 of 1 (latest)

hot tulip
#

I have an automation which I want to run based on two different humidity ranges, each of which are based on the time of year. Would you guys opt to having two separate automations with the date as a condition, or one automation with an If/Else action that checks for the date range to be true or false? Here's how I'm checking the date using the Time and Date integration:
{% set month = states('sensor.date')[5:7] | int %} {{ month >= 9 or month <= 2 }}
This is currently a condition to run the automation if it's between September and February and then I can change it to be
{% set month = states('sensor.date')[5:7] | int %} {{ month >= 3 and month <= 8 }} for the spring/summer period.

fierce current
#

Personally I would make a single automation but make the trigger limits that you change be triggered template sensors that update every day at midnight

crude warren
#

I had a feeling you were using seasons. You should take a look at the Season integration as it does all the calculations for you.

full bloomBOT
hot tulip
crude warren
#

lol this is why I had you make the post ๐Ÿ˜‰

#

I use the season sensor in a lot of spots... SUPER easy instead of figuring out dates and such.

hot tulip
#

for sure

#

thanks for the suggestion, I'll tinker around with it and see. you'd still use it as a condition in two separate automations or both in one?

crude warren
#

I agree with @fierce current ... Make it one.

hot tulip
#

gotcha

#

thanks

crude warren
#

But really, it doesn't matter all that much. It's just how complicated or simple you want to make things.

hot tulip
#

for sure

#

I'll mark as completed ๐Ÿ™‚