CasaSmart guide
Turns off lights, checks sensors and enables security.
CasaSmart
The "leaving home" scene is one of the most useful automations in a smart home, because you trigger it twice a day and every trigger saves energy and quiets your mind. The basic idea is simple: with one gesture the house turns off forgotten lights, shifts climate into an economy mode, arms security, and checks whether a door was left open or a leak is present. In practice, though, the difference between a scene that works flawlessly and one you stop trusting lies in the details: what triggers it, how long it "waits" before acting, and what happens when a sensor fails to answer.
In this guide we build the scene step by step, thinking like an integrator rather than a marketing app. We start from a rule we repeat on every project in Moldova: automation has to be predictable. A scene that kills the lights at the wrong moment, or arms the alarm while someone is still inside, will get disabled within a week. So we put the weight on safe triggers, a grace delay, state checks, and clear notifications, so you always know what the house did and why.
We use real, open technologies: Home Assistant as the brain of the automation, Zigbee or Wi-Fi devices for lights and sensors, Shelly relays for circuits, plus door, presence, and leak sensors. Every example can be reproduced either on a system you run yourself or in a turnkey install we configure for you. We do not invent consumption figures or savings percentages: we talk about verifiable mechanisms and how to make them work reliably in your home.
TL;DR
A reliable "leaving home" scene needs a safe trigger (button or confirmed absence), a grace delay, door and leak checks, selective light shutdown, climate in economy mode, security arming, and clear notifications — plus a paired "coming home" scene and a plan for when a sensor fails to answer.
Step 1
First decide what starts the scene, because this is where most errors are born. The safest option is a manual trigger: a Zigbee button by the door, an NFC tag, or an app command. Leaving is a clear intent, and a button does not make mistakes. The second option is presence: every resident's phone leaves the zone defined around the house. Here we recommend combining GPS detection with a Wi-Fi confirmation — the phone disconnected from the home network — to avoid false departures when the GPS signal jumps. For multi-person homes, the scene should arm only when everyone has left, using a person group in Home Assistant. Start with the button; add presence only after you trust the rest of the logic.
Step 2
No leaving scene should act instantly. Leave a grace delay — usually a few dozen seconds — between trigger and execution, so you can cancel if you came back for your keys or the departure was a false positive. In Home Assistant you do this with a `delay` action at the start of the automation, or with a `timer` that any renewed motion resets. During that window, send a notification with a "Cancel" button. If you tap it, the automation stops via `mode: restart` and nothing changes. For a presence trigger the delay matters doubly: it gives time to confirm you really left and did not just step out to the bins. A scene without grace will turn off the light in your face exactly as you hunt for your wallet.
Step 3
Before the scene arms security, check the state of doors and windows with contact sensors. The logic is a condition: if any door or window sensor reports "open", do not arm the alarm blindly — alert the user. In Home Assistant you group the sensors into a single `binary_sensor` and, at the arming step, put a condition on its state. If everything is closed, the scene continues. If the garage door was left open, send a clear notification: "Garage door is open — security was NOT armed". This avoids the most frustrating situation: believing you armed the house when an entrance is wide open. For the front door, a contact sensor plus a smart lock such as LOQED also lets you lock automatically as part of the scene.
Step 4
An empty house is exactly where a small leak turns into big damage, because no one notices it for hours. Add leak sensors under the sink, by the washing machine, at the boiler, and in the bathroom, then include a check in the leaving scene. If any water sensor is active at departure, the scene does not just notify — it can act: with a motorized valve or a Shelly-controlled relay, you shut off the water supply automatically. In Home Assistant you group the leak sensors and add a condition; on detection you fire the shutoff action and send a high-priority alert. This check costs little, but it is the kind of detail that, on a turnkey project, turns a smart home from a convenience into real protection for the property.
Step 5
Now the visible part: lights. The temptation is to send a single "all lights off" command, but that can break other automations. Better to turn them off selectively: include only the relevant groups in the scene — living room, kitchen, bedrooms, hallway — and deliberately exclude lights that simulate presence or outdoor ones you want a lux sensor to control. In Home Assistant you create an indoor-lights group and apply `light.turn_off` to it. If you use Zigbee bulbs or smart switches, the group command leaves almost simultaneously. Think about LED strips, lamps on a Wi-Fi plug, and the closet light too — all frequently forgotten. A useful detail: if someone is reading, the grace delay gives them time, and the cancel notification warns them before they are left in the dark.
Step 6
Climate is where the scene actually cuts your consumption, without shutting the system off entirely. Do not kill the boiler abruptly in winter — in Moldovan homes that means a slow warm-up and a freezing risk at low temperatures. Instead, drop the thermostat setpoint to an economical away value and switch the air conditioner off or to a protection threshold. In Home Assistant you use the `climate.set_temperature` service with an "away" preset if your thermostat supports it. For boilers or convectors driven by a relay, the scene can move them to a reduced schedule. Important: the away setpoint should be chosen together with you, based on insulation and season — which is why we give no universal figure. The paired "coming home" scene will restore comfort, ideally starting the heating shortly before you arrive.
Step 7
With doors checked and water under control, arm security. If you use an `alarm_control_panel` entity in Home Assistant, the scene moves it to the "armed_away" state, which activates all motion and contact sensors. If you have a dedicated integrated alarm, the scene sends the arm command to it. Immediately after, confirm with a notification what actually happened — not just "scene executed", but a list: "Lights off, climate in economy mode, security armed, all doors closed". This confirmation is essential: it builds your trust that the scene really did the right thing. Send the notification to all relevant residents, not only the last one out. If arming fails — an unavailable entity — the notification must say so clearly, so you can act manually before you get too far away.
Step 8
A leaving scene without its "coming home" partner is only half useful. Create a reverse automation, triggered by confirmed presence or by unlocking the door: it disarms security, restores climate to comfort, lights the hallway if it is evening. Just as important is handling failures. What do you do if a door sensor is "unavailable" at departure? Define the behavior explicitly: do not assume everything is fine. A safe approach is to treat an unavailable sensor as a warning and notify, letting the user decide. Add a log too: every scene run should leave a trace you can review. Test everything several times before you rely on it. In our turnkey installs, exactly these edge cases are what separate a demo from a system you trust every day.
The most common mistakes: the scene acts instantly, with no grace delay, and kills the lights while you are still inside; arming runs blindly without checking doors, leaving you convinced you secured a house with an open entrance; the boiler is shut off entirely in winter, risking a freeze; the presence trigger relies on GPS alone, producing false departures; and the scene sends no confirmation, so you never know whether it succeeded. Always handle unavailable sensors explicitly — do not assume everything is fine.
Yes, and it is often the more reliable option. A Zigbee button by the door or an NFC tag triggers the scene with a clear intent, without depending on GPS or an app. Many clients in Moldova prefer this approach for simplicity: tap on the way out, tap on the way back. You can add phone presence later as an extra layer without giving up the button.
If the scene runs locally in Home Assistant, the automation with a button, sensors, and Zigbee devices works without internet, because everything is processed in the house. What is temporarily lost is GPS presence detection and phone notifications, which need a connection. That is why we recommend a local button trigger as a safe baseline and use the internet only for extra functions, not the critical ones.
It can be safe if you add checks. With a smart lock such as LOQED, the scene can lock the door, but only after a contact sensor confirms the door is actually closed — otherwise you risk throwing the bolt into empty air. We also recommend a confirmation notification and keeping a physical backup key. In turnkey installs, we set up auto-locking only together with the client, once these safeguards are in place.
You use a person group in Home Assistant and a condition: the leaving scene runs in full only when every member is outside the zone. If the trigger is a button, you can add a check with presence sensors — if motion is still detected in the house, the scene asks for confirmation instead of arming directly. This "last one out" logic is essential for multi-resident homes.
Yes. As a turnkey integrator, we install and configure Home Assistant, the sensors, Shelly relays, and compatible locks, then build the "leaving home" scene together with its "coming home" partner, including door and leak checks and failure handling. The initial consultation is free; the on-site visit and design are paid services. We hand over a tested system you run from your own app, and we explain how to adjust it.
● CasaSmart · Chișinău
CasaSmart can configure the Home Assistant automation and test it on real devices.