Outdoor lights on at sunset, off at midnight

Outdoor lights on at sunset, off at midnight

How it works

A Shelly 1 Gen4 fits behind the switch that already runs your porch, path or garden lights, and switches the circuit for you. It knows your location, so a schedule set to sunset moves with the seasons: earlier in June, later in December.

You set two schedules in the Shelly app: on at sunset, off at midnight, every day. Both are stored on the relay, and the wall switch still turns the lights on and off in between.

  1. Shelly app schedule screen for a Shelly 1 Gen4 named Outdoor lights, with On at Sunset and Off at 00:00, every day. 01

    Your phone

    Set the two times once in the app. After that it runs every evening without you.

  2. 1 Gen4 Smart Relay 02

    The Shelly kit

    Turns the lights on at sunset and off at midnight, every day.

  3. 03

    Your outdoor lights

    Come on a little earlier or later as the seasons change.

What it looks like on your phone

  • Two schedules. On at sunset and off at 00:00, every day of the week.

  • Sunset, not a set time. An offset brings the lights on earlier or later.

  • One button. Switch the lights from the app whenever you like.

Step by step

How you'll set it up

Add the device to Wi-Fi from your phone, or straight from a browser.

  1. Fit the Shelly behind the switch

    Mains goes to L and N, with a short bridge from L to I. O runs to the outdoor lights, and the existing wall switch moves to SW, so it still turns them on and off. The diagram follows the relay you picked under What you'll need: the 2PM Gen4 has two outputs (O1, O2) and switch inputs (S1, S2), and the 1L Gen3 takes no N, with the Bypass fitted across the light.

    Wire map 1 Gen4
    • Active (supply) L
    • Neutral N
    • Bridge from L I
    • Light or appliance O
    • Wall switch SW
    Circuit overview
    LN230 V~ 50 Hz1Light / appliance2Wall switchOISWLNShelly 1 Gen4
    1Light / appliance2Wall switch
    Active (supply)Neutral / 0 VSwitched loadSwitch signal / dry contact

    In Australia, fixed 230 V wiring is licensed-electrician work. Use these diagrams to plan the job and brief your electrician.

    Showing the whole circuit

    Shelly 1 Gen4

    100%
    LN230 V~ 50 Hz1Light / appliance2Wall switchOISWLNShelly 1 Gen4
    1Light / appliance2Wall switch

    Select a terminal to follow its wiring.

  2. Add the Shelly in the app

    Add the relay in the Shelly Smart Control app and name it Outdoor lights.

  3. Add the sunset schedule

    Open Schedule and tap Add schedule. Leave Simple selected, tick every day under Choose Weekday and tap Next. Under Choose time interval, pick Sunrise / Sunset, then tap Sunset and leave the offset at 00h 00min. Tap Next, add a local action, choose Control Output and set it to On. In the web interface, click Create schedule under Schedules. Select every day, tick Use sunset or sunrise offset and choose At sunset, set the action's Output State to On, then click Save.

  4. Add the midnight schedule

    Add a second schedule for every day. This time choose Time under Choose time interval, set it to 00:00 and tap Next, then set the Control Output action to Off. In the web interface, click Create schedule again, enter 00:00 in Time, select every day and leave Use sunset or sunrise offset unticked. Set the action's Output State to Off and click Save.

  5. Check both schedules

    Schedule now lists both: On at Sunset and Off at 00:00, every day of the week. The lights come on at sunset tonight, and the start time follows sunset from then on.

Frequently asked questions

Should I use Shelly or Philips Hue?

Use Shelly if you're happy with the outdoor lights you have: the relay fits behind the existing switch and runs whatever is on that circuit. Use Philips Hue if you're putting in new lights and want to dim them or pick a scene from the app. Hue lights need a Hue Bridge. Both work in Home Assistant as well, if you'd rather run the schedule there.

Will the wall switch still work?

Yes. The switch connects to the relay's SW input, so it turns the lights on and off as before. The schedules carry on regardless: flick the lights off at 9 pm and they still come on at sunset tomorrow.

How does it know when sunset is?

The Shelly works out sunset from its location and time zone, which it detects when it goes online. You can check or change both in the device settings.

Can the lights come on a little before sunset?

Yes. A sunset schedule takes an offset in hours and minutes, before or after sunset, so you can have the lights on 15 minutes early while there's still some light in the sky.

What happens if the internet drops out?

Both schedules are stored on the relay, so they don't rely on Shelly's cloud to run. The relay does set its clock over the internet, though, so a long outage or a reset can leave the times out until it reconnects.

My switch box has no neutral. Can I still do this?

Yes, with the Shelly 1L Gen3 in place of the 1 Gen4. It runs without a neutral, but it needs a Shelly Bypass fitted next to the light, and together they switch lights above 5 W.

Can I run the porch and garden lights on different times?

Yes. The Shelly 2PM Gen4 switches two circuits from one relay, and each has its own schedules. Or fit a relay on each circuit.

Do I need a Hue Bridge?

Yes. The Appear, Impress and Discover outdoor lights all need one. The Bridge supports up to 50 lights and 12 accessories, and the Bridge Pro supports 150 or more lights and 50 or more accessories.

What happens as the seasons change?

Sunset comes from your home location, so the start time moves with it through the year while the end time stays at 12:00 AM. The Hue app suggests checking the times now and then as the seasons change. If you'd rather the lights come on a little before or after sunset, change the start time on the automation.

Can the lights come on at different times on weekends?

Yes. Turn Repeat on and choose the days, or make a second schedule with its own days and times.

Are these lights weatherproof?

The Appear, Impress and Discover are rated IP44, which covers splashing water from any direction. They suit a wall, a covered porch or under an eave.

Can I use an indoor Hue light outside?

Not out in the open. Indoor lights aren't made for the weather, so use an outdoor light like the ones in the kit.

Can I add a motion sensor?

Yes. The Hue Outdoor Motion Sensor is battery powered, rated IP54, and turns your outdoor lights on when someone walks by. It has a daylight sensor too, so it can leave the lights alone while it's still light.

How does Home Assistant know when sunset is?

From your home's location in Home Assistant's settings. The sun trigger works out sunset from it every day, so the lights come on a little earlier or later as the seasons change.

What happens if Home Assistant is offline?

The automations live in Home Assistant, so they won't run while it's down, but the wall switch still works. If you'd rather the schedule kept running on its own, set it in the Shelly app instead: those schedules are stored on the relay.

Why go through the Hue Bridge?

The lights stay in the Hue app with your Hue scenes and show up in Home Assistant as well, with no Zigbee adapter to add. Pairing straight to Home Assistant's Zigbee skips the Bridge, but the lights are then only in Home Assistant.

What do I give up without a Hue Bridge?

The Hue app. Paired straight to Home Assistant, the lights only run from there, so Hue's own scenes and schedules aren't available. Home Assistant's automations do the sunset timing instead.

Do I need a Zigbee adapter?

Yes. Home Assistant talks to Zigbee devices through a coordinator plugged into the machine it runs on. If you already run Zigbee in Home Assistant, the adapter you have will do.

Still need a hand?

We answer most messages within one business day. If your question is about an existing order, have your order number ready. It speeds things up.

Contact us