“Dog at home” mode: the hallway that looks after Archi while we’re away
When all the room doors are closed, Home Assistant sends a notification, waits five minutes and starts the dog mode: it turns off the lamps, leaves a dim light in the hallway and runs the fans when needed.
- Level
- Intermediate
- Active time
- 60–120 minutes
Our French bulldog Archi doesn’t like being alone: as soon as we all go out, he starts making puddles all around the house. That is why at our place the room doors are closed and Archi spends the day in the hallway. Over time this hallway became a smart place: the light, the climate and the fans look after him without anyone having to touch them.
What you will get
A mode that switches on by itself when all the room doors are closed and switches off as soon as one opens. While it is on, the hallway lights up dimly, the other lamps in the house go out, and your phones get a notification. The automation only watches the doors: it doesn’t track Archi and doesn’t send photos.
What you need
- Sonoff SNZB-04PR1: a Zigbee door sensor, one for each door you close. At our place there are three doors (living room, children’s room, bedroom), so three sensors. Ours are from the previous model SNZB-04P; SNZB-04PR1 is its successor.
- Lighting in the hallway that Home Assistant controls.
- A helper
input_booleanthat switches the hallway’s automatic lighting on and off. - The Home Assistant mobile app for the notifications.
You need a Zigbee hub or Home Assistant with a Zigbee adapter.
Optional: a temperature and humidity sensor in the hallway and a fan that Home Assistant can start. They are not needed for the basic mode.
Setup time: about an hour, plus a few days to see how the mode behaves in your usual leaving routine.
How it works
- You close the last door → Home Assistant sends a notification: “the mode starts in 5 minutes”.
- During those five minutes it watches whether any door opens. If one does, the mode is cancelled and you get a new notification.
- If the doors stay closed, the hallway’s automatic lighting switches off, all the other lamps go out, and the hallway lights up at 35% and after a second at 55% at 4308 K: bright enough not to be in the dark, and soft enough for napping.
- When a door opens, a second automation restores the automatic lighting and the normal light in the hallway.
The five minutes leave time for a door that closes for a moment and opens again. That way the mode doesn’t switch on at every closing.
What else we have
The mode is not only light. At our place several things are tied together and work in concert:
- Notifications. Both our phones get a warning when the mode is about to start, and a separate message when it has started. It comes at random from a list of playful texts, for example “King of the castle” or “The house is in good paws”.
- Light. The dim light leaves the hallway bright enough for Archi, without disturbing his nap.
- Climate. Temperature and humidity are tied to the hallway, and the bathroom and wardrobe fans are started when needed, with the doors of those rooms open. The bathroom fan works by humidity: it starts on a fast rise and stops when the humidity drops.
All this happens while the doors of the living room, the children’s room and the bedroom are closed and Archi is in the hallway.
Steps
- Review the door sensors. A closed door should be
off, an open one:on. - Make
input_boolean, for exampleinput_boolean.hallway_auto_lights, and switch it on. - Create the first automation from the example. Replace the entity names, the area and the notification services with your own.
- Create the second automation, which restores the helper and the normal lighting when a door opens.
- Close all the doors and wait. The notification should come immediately, and the change in the lighting after five minutes.
All the entity names below are examples. You paste each automation as a new one, through the three-dots menu and “Edit in YAML”.
alias: Mode "Dog at home" (example)
mode: single
triggers:
- trigger: state
entity_id:
- binary_sensor.bedroom_door_opening
- binary_sensor.kids_bedroom_door_opening
- binary_sensor.living_room_door_opening
to: "off"
conditions:
- condition: state
entity_id: binary_sensor.bedroom_door_opening
state: "off"
- condition: state
entity_id: binary_sensor.kids_bedroom_door_opening
state: "off"
- condition: state
entity_id: binary_sensor.living_room_door_opening
state: "off"
actions:
- action: notify.mobile_app_telefon # replace with your phone
data:
title: The dog mode starts soon
message: All the doors are closed. If they stay closed, the mode switches on in 5 minutes.
- wait_for_trigger:
- trigger: state
entity_id:
- binary_sensor.bedroom_door_opening
- binary_sensor.kids_bedroom_door_opening
- binary_sensor.living_room_door_opening
to: "on"
timeout: "00:05:00"
continue_on_timeout: true
- if:
- condition: template
value_template: "{{ wait.trigger is not none }}"
then:
- stop: The mode is cancelled because a door has opened.
- action: input_boolean.turn_off
target:
entity_id: input_boolean.hallway_auto_lights
- action: light.turn_off
target:
entity_id: >-
{{ states.light | map(attribute='entity_id')
| reject('in', area_entities('hallway')) | list }}
- action: light.turn_on
target:
area_id: hallway
data:
brightness_pct: 35
transition: 0.3
- delay: "00:00:01"
- action: light.turn_on
target:
area_id: hallway
data:
brightness_pct: 55
color_temp_kelvin: 4308
The conditions guarantee that all three doors are closed. If any sensor is unavailable, the mode doesn’t start.
alias: Mode "Dog at home" - switch off (example)
mode: single
triggers:
- trigger: state
entity_id:
- binary_sensor.bedroom_door_opening
- binary_sensor.kids_bedroom_door_opening
- binary_sensor.living_room_door_opening
to: "on"
conditions:
- condition: state
entity_id: input_boolean.hallway_auto_lights
state: "off"
actions:
- action: input_boolean.turn_on
target:
entity_id: input_boolean.hallway_auto_lights
- action: script.hallway_lights_normal_on # your script for the normal light
The second condition makes the automation work only when the mode has been on.
Checking the result
- Normal run: you close the last door and the notification comes immediately. After five minutes the hallway lights up dimly and the other lamps go out.
- Edge case: you open a door during the five minutes. The mode is cancelled and a cancellation notification comes.
- Restoring: you open a door when the mode is on. The hallway’s automatic lighting returns and the light becomes normal.
- Missing data: if a sensor’s battery runs down, it becomes
unavailableand the mode simply doesn’t start until you bring it back.
If it doesn’t work
- The mode doesn’t start → some door is
unavailable→ check the sensor’s battery and connection. - Lamps don’t go out → the template for “all lamps except the hallway” caught only some of them → check which lamps are in the hallway’s area.
- The second automation doesn’t restore the light →
input_boolean.hallway_auto_lightsis already on → check its state.
How to stop it
Switch off the two automations from Settings → Automations & scenes. The hallway lighting is controlled as before, and the switches and the apps keep working.
Sources and verification status
The door and lighting automations were read in Marto’s Home Assistant on 23.11.2026 (read-only): doors, notifications, the five-minute wait and the hallway lighting. The examples are simplified and use example entity names.
At home
Marto
Our French bulldog Archi makes puddles when he is left alone, so when we leave we close the doors of the living room, the children's room and the bedroom, and Archi spends the day in the hallway. Three doors with Sonoff SNZB-04P sensors track when all are closed: Home Assistant sends a notification to both phones, waits five minutes, turns off the remaining lamps and leaves the hallway at 35%, then at 55% at 4308 K. When a door opens, everything is restored.
Need a hand?
We can set up and install everything in this project. In some regions we install it ourselves — ask us.
Contact us


