this post was submitted on 06 May 2025
13 points (93.3% liked)

homeassistant

14104 readers
33 users here now

Home Assistant is open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts. Perfect to run on a Raspberry Pi or a local server. Available for free at home-assistant.io

founded 2 years ago
MODERATORS
 

I currently have a lot of my light automations setup by first having an automation that turns the light on at a certain time, then another that turns the light off at another time. This works, and it has for years, but I'm imagining there must be blueprints or other methods to do this on/ off behavior in a single automation rather than having them in pairs (this is not scaling very well).

Anyone have suggestions? The image is a blueprint I have for turning lights on/ off based on a time window which is very handy, and I'm hoping there's something similar out there for my needs.

you are viewing a single comment's thread
view the rest of the comments
[–] jrke3ok2@lemmy.world 3 points 7 hours ago (2 children)

In fact there is the option. What I do is: I set two triggers, for example, tine to turn on the lights and time to turn the off. There is an option called name ID or soemthing like that and I set a name for each trigger.

When you then set the actions, in the advanced actions there is an action called "choose" if you select this action, on the conditions you can choose your trigger base din the ID name and the action you want to perform once the trigger is activated.

[–] echutaaa@sh.itjust.works 3 points 6 hours ago

This is usually the best method, but just beware if you’re trying to get performant on demand execution the larger decision trees will cause issues. If you find the automation taking too long to trigger/execute you’ll want to break up the automation into smaller ones and just group them.

[–] mhzawadi@lemmy.horwood.cloud 1 points 5 hours ago

Look for the new if, then if on turn on light. Else turn the light off.