Automation

Home Assistant Holiday Lights Automation: A Beginner Guide

On this page

    A Home Assistant holiday lights automation does three simple jobs: it turns your lights on a little before sunset, turns them off at bedtime, and only does this during the holiday season. Add a check that someone is home, and you never have to plug in or unplug a light string again.

    You do not need fancy gear. A cheap smart plug turns any plain light string into a smart one. If you want colors and effects, an LED strip running WLED gives you twinkles, chases and color changes you can control from Home Assistant.

    Below: the hardware, the helpers, and three complete automations you can copy.

    What you need

    • Home Assistant running on any hardware (a Raspberry Pi, a mini PC or Home Assistant Green all work).
    • One smart plug per plain light string. Zigbee or Wi-Fi both work. Use an outdoor-rated plug for anything outside.
    • Optional: a Zigbee or Wi-Fi LED strip, or an addressable LED strip (WS2812B type) with an ESP32 controller running WLED.
    • Optional: a Zigbee USB coordinator, if you go with Zigbee plugs or strips.
    • The Home Assistant Companion app on your phone, so Home Assistant knows when you are home.
    What you needAqara Wireless Mini Switch (Zigbee button)A physical button for any helper, scene or toggle. Single, double and long press.Check price on AliExpressZigbee smart plug with energy monitoringLocal Zigbee plug that reports watts and kWh, and doubles as a mesh repeater.Check price on AliExpressSONOFF ZBDongle-E (Zigbee 3.0 USB)Cheap, well supported Zigbee coordinator for ZHA or Zigbee2MQTT.Check price on AliExpressESP32 development boardThe default board for ESPHome sensors and Bluetooth proxies.Check price on AliExpress

    Pick your lights: smart plugs, LED strips or WLED

    Smart plugs for plain light strings

    The easiest way in. Your existing lights plug into a smart plug, and Home Assistant switches the plug. You get on and off, no colors.

    A quick word on the radio types. Zigbee is a low-power wireless network made for smart home devices. It needs a small USB stick (a coordinator) on your Home Assistant machine, but it works locally and is very reliable. Wi-Fi plugs connect straight to your router, so no extra stick is needed. If you are not sure which to pick, our comparison of Wi-Fi, Zigbee, Z-Wave and Matter explains the trade-offs.

    Zigbee and Wi-Fi LED strips

    Ready-made LED strips show up in Home Assistant as a light entity. An entity is one thing Home Assistant can read or control, like a light or a sensor. You get on, off, brightness, color and sometimes a few effects.

    AliExpress deals

    WLED for real holiday effects

    WLED is free firmware for ESP32 and ESP8266 boards that drives addressable LED strips. “Addressable” means every LED can have its own color, which is what makes twinkles, chases and fireworks possible. WLED comes with over a hundred effects and color palettes, and Home Assistant has a built-in WLED integration (an integration is the piece of Home Assistant that talks to a brand or device).

    You can buy controllers that come with WLED already installed, or flash a board yourself from the official web installer at install.wled.me. If you like building things, our guide to a DIY smart LED strip with ESPHome covers the wiring side, which is the same for WLED.

    Step 1: Add your lights to Home Assistant

    1. Smart plugs: pair them with the integration for their type (ZHA or Zigbee2MQTT for Zigbee, or the brand’s integration for Wi-Fi). Give each one a clear name like “Tree plug” or “Porch lights plug”.
    2. WLED: once the controller is on your network, Home Assistant usually finds it on its own. Go to Settings > Devices & services and look for WLED under Discovered. If it is not there, select Add integration, search for WLED and type the controller’s IP address. The integration needs WLED 0.14.0 or newer.

    WLED creates a light entity (for example light.wled), a preset selector (select.wled_preset), a color palette selector, and speed and intensity sliders. Your entity names will match the name of your controller, so check them under Settings > Devices & services > Entities.

    Step 2: Put all the holiday lights in one group

    Automations are much easier to read when one entity controls everything. Smart plugs show up as switches, so first turn each plug into a light:

    1. Go to Settings > Devices & services > Helpers and select Create helper. A helper is a small virtual entity you create yourself.
    2. Pick Change device type of a switch (the docs call it Switch as X), choose your plug, and set the new type to Light. Repeat for each plug.
    3. Create one more helper: Group > Light group. Name it “Holiday lights” and add the converted plugs plus your WLED or LED strip lights.

    You now have light.holiday_lights. Turning it on turns on every string and strip at once.

    Step 3: Create a holiday season switch

    You only want this running for a few weeks a year. There are three good ways to limit it, from simplest to most automatic.

    Option A: a Toggle helper

    Go to Settings > Devices & services > Helpers > Create helper > Toggle and name it “Holiday season”. That gives you input_boolean.holiday_season, an on/off switch you flip when the decorations go up and again when they come down. While you are there, create a second toggle called “Vacation mode”. We will use it later.

    Option B: a Local Calendar event

    If you would rather set it once and forget it, add the Local Calendar integration: Settings > Devices & services > Add integration > Local calendar, and name the calendar “Holiday lights”. Then open the Calendar page in the sidebar and add an all-day event from, say, December 1 to January 6. A calendar entity is “on” while one of its events is active, so calendar.holiday_lights is on for exactly the season.

    Option C: a date range in a template

    No helper at all: a template condition checks today’s date. A template is a small formula Home Assistant fills in when the automation runs. Example 3 below uses this one.

    Note: the Schedule helper only knows days of the week, not dates. It is good for weekly hours, not for the season.

    Example 1: Holiday lights on at sunset

    This automation fires 15 minutes before sunset. It only runs when the season toggle is on, and when someone is home or vacation mode is on. Then it turns on the light group and loads a WLED preset you saved earlier in the WLED app.

    To add it, go to Settings > Automations & scenes > Create automation > Create new automation, open the three-dot menu, choose Edit in YAML and paste this in. YAML is just the plain text format Home Assistant uses for settings, and indentation matters, so keep the spaces as they are.

    alias: Holiday lights on at sunset
    description: Turns on the holiday lights 15 minutes before sunset during the season.
    triggers:
      - trigger: sun
        event: sunset
        offset: "-00:15:00"
    conditions:
      - condition: state
        entity_id: input_boolean.holiday_season
        state: "on"
      - condition: or
        conditions:
          - condition: numeric_state
            entity_id: zone.home
            above: 0
          - condition: state
            entity_id: input_boolean.vacation_mode
            state: "on"
    actions:
      - action: light.turn_on
        target:
          entity_id: light.holiday_lights
      - action: select.select_option
        target:
          entity_id: select.wled_preset
        data:
          option: "Candy Cane"
    mode: single

    A few things worth knowing:

    • The offset uses hours:minutes:seconds. A minus sign means before sunset, so "-00:15:00" is 15 minutes early. Use "00:30:00" for 30 minutes after.
    • The state of zone.home is the number of people at home, so “above 0” means at least one person is in. This works once each person has the Companion app linked to their person profile.
    • Replace "Candy Cane" with the exact name of a preset you saved in WLED. If you have no WLED, delete the last action.
    • Using the calendar instead of the toggle? Change the first condition’s entity to calendar.holiday_lights. The state stays "on".

    Example 2: Off at bedtime, or when everyone leaves

    Lights should go off at a fixed time, every night, no matter what. They should also go off if the house empties out, unless vacation mode is on. Trigger IDs let one automation handle both cases.

    alias: Holiday lights off
    description: Turns the holiday lights off at 23:00, or 10 minutes after everyone leaves.
    triggers:
      - trigger: time
        at: "23:00:00"
        id: bedtime
      - trigger: numeric_state
        entity_id: zone.home
        below: 1
        for:
          minutes: 10
        id: everyone_left
    conditions:
      - condition: or
        conditions:
          - condition: trigger
            id: bedtime
          - condition: state
            entity_id: input_boolean.vacation_mode
            state: "off"
    actions:
      - action: light.turn_off
        target:
          entity_id: light.holiday_lights
    mode: single

    How it reads in plain words: at 23:00, always turn the lights off. When nobody has been home for 10 minutes, turn them off too, but only if vacation mode is off. There is no season check on purpose: turning off lights that are already off does no harm.

    Example 3: Random WLED effects all evening

    This is the fun one. Every 10 minutes, while the strip is on and it is between December 1 and January 6, WLED switches to a random effect from a short list of holiday-friendly ones.

    alias: Holiday lights random WLED effect
    description: Picks a new WLED effect every 10 minutes during the holiday season.
    triggers:
      - trigger: time_pattern
        minutes: "/10"
    conditions:
      - condition: state
        entity_id: light.wled
        state: "on"
      - condition: template
        value_template: "{{ now().month == 12 or (now().month == 1 and now().day <= 6) }}"
    actions:
      - action: light.turn_on
        target:
          entity_id: light.wled
        data:
          effect: "{{ ['Twinkle', 'Twinklefox', 'Colortwinkles', 'Candle Multi', 'Fireworks', 'Chase'] | random }}"
    mode: single

    The template condition is the date range from Option C: it is true for all of December and the first six days of January. Change the numbers to fit the holidays you celebrate.

    Effect names must match WLED exactly. To see the full list, open Developer tools, go to the States tab, search for your WLED light and look at the effect_list attribute. If you want any effect at all, the WLED docs show a version that picks from the whole list:

    effect: "{{ state_attr('light.wled', 'effect_list') | reject('eq', 'RSVD') | list | random }}"

    The full list includes strobe effects, so a short hand-picked list usually looks better. You can also randomize the color palette with select.select_option on the palette entity, picking from its options attribute the same way.

    Add a dashboard button

    Sometimes you want the lights on right now, for guests or a photo. Put the group on your dashboard:

    1. Open your dashboard, select the pencil icon to edit, then Add card.
    2. Choose the Tile card and pick light.holiday_lights. Tapping the icon turns everything on or off.
    3. Add two more tiles for input_boolean.holiday_season and input_boolean.vacation_mode, so the whole family can see and change them.
    4. For WLED, add a tile for select.wled_preset to switch presets from the dashboard.

    Want a nicer single button that does several things at once? Our guides on a Home Assistant toggle switch and on helpers that toggle several entities as one button show how.

    Presence: only when someone is home

    Example 1 already uses zone.home, which counts the people at home based on their phones. Phone location can lag a few minutes, which is why Example 2 waits 10 minutes before acting. Our post on geofencing in Home Assistant covers zones in more depth, and conditional automations explains how “and” and “or” conditions stack.

    Vacation mode: look lived-in while you travel

    Going away? Dark windows on a street full of lights say nobody is home. Flip the Vacation mode toggle before you leave, and Example 1 still turns the lights on at sunset even though zone.home is 0. Example 2 still turns them off at 23:00, but ignores the “everyone left” trigger.

    To make it less predictable, add a random delay as the first action in Example 2, so the off time changes every night:

      - delay:
          minutes: "{{ range(0, 45) | random }}"

    That turns the lights off somewhere between 23:00 and 23:45. Remember to switch vacation mode off when you get back.

    Testing before the big night

    • Use the three-dot menu and Run actions to test the actions without waiting for a trigger.
    • After the first sunset, open Traces to see which condition stopped a run.
    • Check your location and time zone under Settings > System > General. Sunset times come from them.

    For the full list of trigger types, the official automation trigger docs are a good reference, and the WLED integration page lists every WLED entity and example.

    Frequently asked questions

    Can I automate plain Christmas lights with Home Assistant?

    Yes. Plug each light string into a smart plug and Home Assistant can switch it on and off on a schedule. You get on and off only, but that covers most of what people want from holiday lights.

    How do I turn on lights at sunset with an offset in Home Assistant?

    Use a Sun trigger with the sunset event and an offset in hours:minutes:seconds. A negative offset such as -00:15:00 fires 15 minutes before sunset, a positive one fires after it.

    How do I make the automation run only during the holiday season?

    Add a condition that checks a Toggle helper you flip on and off, a Local Calendar with an all-day holiday event, or a template condition that checks the month and day. The calendar option is the most hands-off.

    What if I come home after sunset and the lights are off?

    Add a second trigger to the sunset automation that fires when zone.home goes above 0, plus conditions that it is after sunset and before your off time. Then the lights also come on when the first person gets home.

    Ad

    About us

    The Home Smart Home Team

    One house and a Home Assistant setup that grew one device at a time. Everything here was set up in that house first, in plain steps, and when something breaks the fix ends up in a post.

    More about us

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

    Coming soon
    The ready-made Home Assistant dashboard
    One email when it's ready, with an early-bird price. No spam. Privacy