Need a bit of help with a night light/ status light automation

Hello all,

Could someone lend me a hand with helping modify the below automation? I would like the all of the night lights to turn red if the garage door is open bt 7 pm and 4 am while somehow keeping the current “brains” of the below automation intact.

I would also like to have all of the lights go back to their standard actions as shown in the automation below once the garage door is closed.

Thank you all for any guidance you can give one this.

alias: Night Light Brains
description: ""
triggers:
  - trigger: numeric_state
    entity_id:
      - sensor.master_bathroom_night_light_illuminance
    below: 40
    id: Master Bathroom Night Light Illuminance is below 40
  - trigger: numeric_state
    entity_id:
      - sensor.living_room_night_light_illuminance
    below: 40
    id: Living Room Night Light Illuminance is below 40
  - trigger: numeric_state
    entity_id:
      - sensor.den_night_light_illuminance
    below: 40
    id: Den Night Light Illuminance is below 40
  - trigger: state
    entity_id:
      - binary_sensor.master_bedroom_night_light_occupancy
    to: "on"
    id: Master Bedroom Night Light Motion During Darkness
  - trigger: sun
    event: sunrise
    offset: 0
    id: Night Lights off at Sunrise
conditions: []
actions:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - Master Bathroom Night Light Illuminance is below 40
        sequence:
          - action: light.turn_on
            metadata: {}
            data:
              kelvin: 5000
              brightness_pct: 40
            target:
              entity_id: light.master_bathroom_night_light
      - conditions:
          - condition: trigger
            id:
              - Master Bedroom Night Light Motion During Darkness
        sequence:
          - action: light.turn_on
            metadata: {}
            data:
              brightness_pct: 40
              kelvin: 5000
            target:
              entity_id: light.master_bedroom_night_light
          - delay:
              hours: 0
              minutes: 0
              seconds: 19
              milliseconds: 0
          - action: light.turn_off
            metadata: {}
            data: {}
            target:
              entity_id: light.master_bedroom_night_light
      - conditions:
          - condition: trigger
            id:
              - Den Night Light Illuminance is below 40
        sequence:
          - action: light.turn_on
            metadata: {}
            data:
              brightness_pct: 40
              kelvin: 5000
            target:
              entity_id: light.den_night_light
      - conditions:
          - condition: trigger
            id:
              - Living Room Night Light Illuminance is below 40
        sequence:
          - action: light.turn_on
            metadata: {}
            data:
              brightness_pct: 40
              kelvin: 5000
            target:
              entity_id: light.living_room_night_light
      - conditions:
          - condition: trigger
            id:
              - Night Lights off at Sunrise
        sequence:
          - action: light.turn_off
            metadata: {}
            data: {}
            target:
              entity_id: light.night_lights
mode: single

this would be a few automations in reality, I have 5 for a setup with 1 light and 4 door sensors.

can anyone simplify it past this

  • Automation 1 handles switching to red lights for security when the garage door is open at night.
  • Automation 2 reverts lights to normal when the garage door closes during nighttime hours.
  • Automation 3 ensures the lights behave normally based on ambient light levels when the garage door is closed.
  • Automation 4 turns off lights at sunrise to ensure they’re not running during the day.
  • Automation 5 turns on lights at sunset with their default settings for nighttime use.

I have seen enough people just say multiple automations is the way.

Remember you can go into

Filters

Categories

in automations.