Smart Home Assistant

How to Automate Christmas Lights with Home Assistant (UK)

SepehrBy Sepehr· 19 October 2026· Updated 22 October 2026· 7 min read
✓ Independent — no paid placements✓ UK-tested in real homes✓ Cited sources
Decorated Christmas tree glowing with warm white lights beside a fireplace and wrapped presents in a dark living room

Key takeaways

  • Ordinary mains Christmas lights can be automated with a smart plug, but it only switches them on and off.
  • Trigger the on-switch from a sunset trigger with an offset such as -00:30:00 so it follows the changing light.
  • Electrical Safety First says outdoor Christmas lights must connect via a 30mA RCD-protected socket.
  • Twinkly, Philips Hue, Shelly and Govee integrations in Home Assistant all run locally, without going via a cloud service.
  • Add a rule that turns the lights off when everyone leaves, as Electrical Safety First advises switching off when you go out.
On this page[tap to expand]

You can automate Christmas lights with Home Assistant by putting them on a smart plug or a smart-light integration, then switching them on at dusk and off at bedtime. It takes about 20 minutes, works with ordinary mains-powered strings, and can keep them off when nobody is home.

The one thing that trips people up is the plug and its load: a smart plug only suits lights if the combined draw stays within the plug's rating, and outdoors it must sit behind RCD protection. Get that right and the rest is a single short automation.

What do you need before you start?

  • Lights: either ordinary mains-powered strings (UK 3-pin plug with a fuse fitted) or a smart string such as Twinkly, Philips Hue or Govee.
  • A switch Home Assistant can control: a Wi-Fi smart plug (TP-Link Tapo, Shelly and similar) for non-smart lights. Our best smart plug UK roundup covers the options, and best outdoor smart plug UK covers garden displays.
  • Home Assistant already running with your location set, because sunset times come from it. If you are still setting up, start with Home Assistant UK setup.
  • A person entity (the Home Assistant companion app on your phone) if you want the lights to stay off when you are out.

Going away over the festive period? The same randomised-delay approach powers a Home Assistant holiday mode that simulates someone being home.

Step 1: Check the lights and the socket

Before any automation, check the basics, because an automation will run the lights for hours you might not otherwise have them on. Electrical Safety First says mains-powered Christmas lights must be fitted with a UK 3-pin plug and fuse, that you should not overload sockets, and that it is best not to rely on extension leads or adaptors if you can avoid them.

A smart plug counts as an adaptor, so plug it straight into a wall socket rather than into a multi-way extension. Check the lights for damage first, and look at the rating printed on the smart plug against the combined load of everything you intend to run through it. LED strings draw little, but a tree string plus an inflatable and a projector on one plug is a different sum.

For anything outdoors, Electrical Safety First says the lights must be connected via a 30mA RCD-protected socket, and that if you do not have RCD protection you should use an RCD plug on that socket. A smart plug does not replace that.

Step 2: Choose how Home Assistant will switch them

There are two routes, and the right one depends on the lights you own. A smart plug turns the whole string on or off but cannot change colour. A smart-light integration controls colour, brightness and effects, and usually still needs the lights powered all the time.

LightsHow Home Assistant controls themLocal or cloudWhat you can automate
Ordinary mains string on a Tapo plugTP-Link integrationLocal (Tapo plugs need your TP-Link account details to authenticate)On and off only
Ordinary mains string on a Shelly plugShelly integrationLocal push, no cloud neededOn and off only
Twinkly stringTwinkly integrationLocal pollingOn/off, brightness, colour, effects you saved in the app
Philips Hue lightsPhilips Hue integration (via the bridge)Local pushOn/off, brightness, colour, Hue scenes
Govee lightsGovee Lights Local integrationLocal pushOn/off, brightness, colour (per supported model)

If you are buying new, a smart plug is the cheapest and most reliable way to automate lights you already own, while a smart string suits anyone who wants different colours at different times of day. Our best smart fairy lights UK guide compares the strings themselves.

Step 3: Add the plug or lights to Home Assistant

Go to Settings, then Devices & services. Anything Home Assistant discovers on your network appears as Discovered, and you can add it with one click. If it does not appear, choose Add Integration and search for the brand.

  • Twinkly: Home Assistant can auto-discover it. If you add it by IP address, give the string a static IP on your router. Effects only show up in Home Assistant once you have saved them in the Twinkly app, and Music mode is not supported.
  • Philips Hue: add the integration and follow the prompts. Hue scenes are imported automatically as scene entities, but you create and edit them only in the Hue app.
  • Govee: turn on LAN control for each device in the Govee app first, then add Govee Lights Local. Check your model against the supported list, because some scenes do not work on every model.
  • Tapo or Shelly plugs: add the TP-Link or Shelly integration. Tapo devices need your TP-Link email and password to authenticate, even though control stays local.

Rename the entity to something obvious, such as "Tree lights". You will pick it from a list in the next step, and a name like switch.tapo_p100_3 is easy to get wrong.

Step 4: Switch the lights on at sunset and off at bedtime

Create a new automation in Settings, then Automations & scenes. A fixed clock time drifts out of step with the light through the winter, because sunset keeps moving, so trigger the on-switch from the sun and use a clock time only for switching off.

The sun trigger takes an event of sunset or sunrise and an optional offset, in seconds or hh:mm:ss, where a negative value fires before the event. Home Assistant's documentation also notes that twilight length changes through the year, and suggests the Dusk trigger or a sun-elevation threshold between 0° and -6° if you want the lights to match how dark it actually is.

automation:
  - alias: "Christmas lights on at dusk"
    triggers:
      - trigger: sun
        event: sunset
        offset: "-00:30:00"
    conditions:
      - condition: state
        entity_id: person.you
        state: "home"
    actions:
      - action: switch.turn_on
        target:
          entity_id: switch.tree_lights

  - alias: "Christmas lights off at bedtime"
    triggers:
      - trigger: time
        at: "23:00:00"
    actions:
      - action: switch.turn_off
        target:
          entity_id: switch.tree_lights

Swap person.you for your own person entity and switch.tree_lights for your plug. If you use a smart light rather than a plug, use light.turn_on and light.turn_off with the light's entity. For a general grounding in how triggers, conditions and actions fit together, see our Home Assistant automations guide.

Step 5: Add a safety backstop so they never stay on

Electrical Safety First's advice is to switch lights off and unplug them before bed or when you go out, so the automation should enforce that rather than rely on one trigger firing. Add a second off rule that fires when everyone leaves, and treat the bedtime rule as a backstop in case your phone was offline at the time.

  - alias: "Christmas lights off when nobody is home"
    triggers:
      - trigger: state
        entity_id: zone.home
        to: "0"
    actions:
      - action: switch.turn_off
        target:
          entity_id: switch.tree_lights

This uses the Home zone's person count, which drops to zero when everyone has left. If you share the house with someone who does not use Home Assistant, skip this rule or the lights will go off whenever your own phone leaves.

Step 6: Add a manual override to the dashboard

Add the plug or light entity to a dashboard card so anyone in the house can switch it by hand. Automations that fight the people living with them get disabled, so an obvious toggle matters more than it sounds. A Hue scene can also be added as a button if you want a one-tap "party" colour for guests, with the automation resuming at the next sunset.

Can you automate Christmas lights that aren't smart?

Yes, any ordinary mains-powered string works, provided the lights stay switched on at their own inline switch and the plug supplies power. The smart plug does the switching, so Home Assistant sees a simple on/off device. The limit is features: you cannot dim or recolour a basic string, and some cheap strings with built-in flashing modes restart on that mode each time power returns, so test it once before relying on it.

Is it safe to put Christmas lights on a smart plug?

It can be, with the same caution as any plug-in device. Keep the combined load within the plug's printed rating, plug it directly into a wall socket instead of an extension lead, and for outdoor use connect through a 30mA RCD-protected socket. A smart plug adds a small standby draw and a point of failure, so inspect the plug and cable as you would the lights, and stop using anything that gets warm or looks damaged.

Why won't my Christmas lights turn on at sunset?

Check the automation trace first: Settings, Automations, then the three-dot menu and Traces. It shows whether the sun trigger fired and which condition blocked it. The usual culprits are a condition that fails because your phone shows as away, a wrong entity name, or the plug having dropped off Wi-Fi so the action ran against an unavailable entity. Give a Wi-Fi plug a reserved address on your router, and check that Home Assistant's home location is correct, because sunset is calculated from it.

What should you build next?

Once the basics work, try a front-door scene that brightens outdoor lights when a parcel is detected, or tie the tree to a presence sensor so it only runs when someone is in the room. Our best smart garden lights UK guide covers outdoor options, and the Shelly Plug S review shows how a local-only plug behaves in practice.

Buy the picks in this guide

Recommended for Smart Lighting

See all devices →
Shop these picks on our Amazon storefront →

Frequently asked questions

How do I automate Christmas lights with Home Assistant?
To automate Christmas lights with Home Assistant, connect them through a smart plug (for ordinary mains strings) or the brand's integration (Twinkly, Philips Hue, Govee), then create an automation with a sunset trigger that turns them on and a time trigger that turns them off. Add a condition so they only come on when someone is home, and a second rule that switches them off when everyone leaves. The whole setup takes around 20 minutes and runs locally for Tapo, Shelly, Twinkly, Hue and Govee devices. The caveat is the plug's rating: check the combined load of your lights against the label on the smart plug, and use an RCD-protected socket for anything outdoors.
Can Home Assistant change the colours of Christmas lights?
Home Assistant can change colours only if the lights themselves are smart. A smart plug simply switches power on and off, so a basic mains string stays whatever colour it is. With Twinkly, Philips Hue or Govee lights, the Home Assistant integration exposes brightness and colour, and Hue scenes appear as scene entities you can trigger from an automation. Twinkly effects only show in Home Assistant after you have saved them in the Twinkly app, and its Music mode is not supported. Govee needs LAN control switched on per device, and some scenes do not work on every model. If you want different looks at different times, a smart string is the better buy than a plug.
Do smart plugs work with Christmas lights in the UK?
Smart plugs work with most UK Christmas lights, provided the lights stay switched on at their own switch and the combined draw is within the plug's printed rating. Plug the smart plug straight into a wall socket rather than an extension lead, because Electrical Safety First advises against relying on extension leads and adaptors where you can avoid them. For outdoor lights, connect through a 30mA RCD-protected socket and use a plug designed for outdoor use. One practical catch is that some budget strings with built-in flashing modes restart on the first mode each time power returns, so test yours once. Also inspect the lights and plug before each season for damage.

Sources

Sources verified 2026-10-19

  1. Electrical Safety First — Electrical Safety Advice for Christmas Lights
  2. Home Assistant — Automation triggers: sun trigger
  3. Home Assistant — Twinkly integration
  4. Home Assistant — Philips Hue integration
  5. Home Assistant — Govee lights local integration
  6. Home Assistant — TP-Link Smart Home integration
  7. Home Assistant — Shelly integration
›How we researched this

Claims in this article are checked against primary sources — manufacturer specifications, official documentation, Which? research, Ofgem guidance, or gov.uk — rather than forum threads or video reviews. Where the author has direct hands-on experience with a product (most Home Assistant, Zigbee, and home-networking gear is running in his own homelab), that is stated explicitly in the text.

For categories outside that personal setup — such as boilers, heat pumps, and other areas that are traditionally a heating engineer's domain — verdicts are built from cross-referenced manufacturer data, published lab results, and vetted expert and owner reviews rather than a claim of personal hands-on testing. See the editorial policy for the full methodology.

Sepehr

Written by

Sepehr

10+ years hands-on with Home Assistant & networking · Research-backed elsewhere · No brand deals

Smart home specialist with 10+ years running a self-hosted Home Assistant setup — Zigbee2MQTT, Frigate NVR, and local-first automations. Independent coverage for UK homes, no brand deals.

LinkedIn →

Citing this page? Please use a dofollow link back to the original article — it helps us keep the data on this page accurate and up to date.

Related reading