Noob need help cleaning up multiple automations

Hi

I want the lights to come on wen someone is home and it is between 6:00 and 23:00.
chirstmas lights :slight_smile:

so right now i made 4 automation.
-some1 come home between 6:00-23:00
-turn on at 6:00 if we where already home
-turn off wen evry1 leave the home
-turn off at 23:00 even wen we are home.

This is kinda messy and there must be a way better method to do this in 1 simple automation.
Kan you guys point me in the good direction. What am i missing here?

Right now im using frontend to make this. Would be easyer to keep doing this but may the moment to learn yaml.

You can use trigger IDs on your triggers.

Then, choose and/or if statements for which trigger ID along with other criteria.

I like doing it this way and have all actions for something in a single automation. It can certainly make the automation more complex though.

First off, don’t confuse combining/consolidating automations with organizing automations and don’t confuse having numerous automations with having disorganized automations.

There are a number of tools to help organize and sort automations in the Automations dashboard. If you haven’t assigned at least one of an Area, Category, or Label to each automation you are really missing out on the sorting, searching, and filtering tools that are available in the frontend.

seems like a new thing to learn next weekend. Thanks for the tip. I will look into it.

While i have been adding, labels, zones,… to devices i havent done this to autmations. You are right this is something i should start doing.
But i dont realy think this sloved my “problem”.
What happend is that i wanted to add an extra light in de automation and i needed to do it in all automations instead of in 1 bigger 1. While this would have helpt to find them faster i would stil mean the same amount of work. Not realy a big problem → but im also asking the question the keep learning.

thanks for the tips i have more stuff to read.

You can create a group light helper. Turn that on and off in your automations. Add your new light to the group.

Here is a start if you choose to go this route. Paste it into an empty automation then switch to UI mode if you don’t want to play with yaml yet :slight_smile:

This uses my home zone to know if the house goes empty or if someone comes home. You’ll need to add the two time triggers and actions for them.

description: ""
mode: single
triggers:
  - trigger: state
    entity_id:
      - zone.home
    to:
      - "0"
    id: empty_house
  - trigger: numeric_state
    entity_id:
      - zone.home
    above: 0
    id: arrived_home
conditions: []
actions:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - empty_house
        sequence:
          - action: switch.turn_off
            metadata: {}
            target:
              entity_id: switch.christmas_tree
            data: {}
      - conditions:
          - condition: trigger
            id:
              - arrived_home
        sequence:
          - if:
              - condition: time
                after: "06:00:00"
                before: "23:00:00"
            then:
              - action: switch.turn_on
                metadata: {}
                target:
                  entity_id: switch.christmas_tree
                data: {}