Deze eenvoudige Home Assistant automatisering zet een lamp automatisch aan zodra er beweging wordt gedetecteerd én er iemand thuis is — en weer uit zodra er een tijdje geen beweging meer is. Geen schemer- of lux-logica, geen uitzonderingen: dit is de simpele basisversie, ideaal als startpunt voordat je uitbreidt met bijvoorbeeld schemerdetectie.

Concreet regelt deze automatisering-set:

  • Beweging (of een deursensor) zet een “recent beweging”-status aan, die na een paar minuten vanzelf weer uitgaat
  • Zodra die status aan staat én er iemand thuis is, gaat de lamp aan
  • Zodra de status weer uit gaat (of er is niemand meer thuis), gaat de lamp weer uit

In dit artikel krijg je een volledig werkend voorbeeld van de 2 automatiseringen die samen deze flow vormen, inclusief uitleg zodat ook beginners dit zelf kunnen opzetten. Onderaan kun je de complete, kant-en-klare YAML ook downloaden.

De 2 automatiseringen zijn: beweging naar “PIR-status”, en lamp aan/uit op basis van die status en aanwezigheid.

⚙️ Wat heb je nodig?

In Home Assistant:

  • Een binary_sensor voor bewegingsdetectie (PIR-sensor) en/of een deursensor
  • Een light-entiteit voor de lamp die je wilt aansturen
  • Een input_boolean die aangeeft of er iemand thuis is (input_boolean.iemand_aanwezig) — dit kun je zelf bepalen op basis van je person-entiteiten, of vervangen door een vaste conditie als je dat niet hebt

Zelf aan te maken helpers:

  • input_boolean.pir_garage — houdt bij of er recent beweging is geweest
  • input_boolean.iemand_aanwezig — geeft aan of er iemand thuis is

🧩 De 2 automatiseringen

Automatisering: Beweging naar PIR-status

Wat doet dit: zet een tijdelijke “er is beweging geweest”-status aan zodra de bewegingssensor of deursensor afgaat, en zet die na een paar minuten automatisch weer uit. Dit voorkomt dat de lamp meteen uitgaat bij een korte pauze in beweging.

Hoe maak je dit:

trigger: state
entity_id:
  - binary_sensor.garage_deursensor
  - binary_sensor.garage_bewegingssensor
to: "on"

Actie: input_boolean.turn_on op input_boolean.pir_garage, dan delay: 2 minuten, dan input_boolean.turn_off op diezelfde helper. Gebruik mode: restart zodat een nieuwe beweging de timer weer opnieuw laat lopen in plaats van dat er twee timers naast elkaar draaien.

Automatisering: Lamp aan/uit bij PIR-status en aanwezigheid

Wat doet dit: zet de lamp aan zodra er beweging is geweest én er iemand thuis is, en zet hem weer uit zodra dat niet langer het geval is.

Hoe maak je dit:

trigger: state
entity_id:
  - input_boolean.pir_garage
  - input_boolean.iemand_aanwezig

Bepaal met een variabele of de lamp aan moet (is_state('input_boolean.pir_garage', 'on') and is_state('input_boolean.iemand_aanwezig', 'on')) en of hij al aan staat. Zet de lamp aan als hij aan moet maar nog uit staat; zet hem uit als hij niet meer aan hoeft te zijn maar nog aan staat. Zo stuurt de automatisering de lamp maar één keer aan bij een statuswijziging, in plaats van steeds opnieuw een “aan”-commando te sturen.

🧠 Gebruikte templates

Geen losse templates buiten de twee is_state()-condities hierboven — dat is precies wat deze variant zo simpel maakt.

❓ Veelgestelde vragen

Kan ik dit ook zonder de “iemand aanwezig”-helper gebruiken? Ja, laat die conditie dan gewoon weg (of vervang hem door true) zodat de lamp altijd op beweging reageert, ook als er niemand thuis is.

Werkt dit ook met meerdere bewegingssensoren of lampen? Ja, voeg extra entity-ID’s toe aan de trigger-lijst (voor meer sensoren) of dupliceer de actie voor meerdere lampen.

Is dit uit te breiden met schemerdetectie? Zeker — dat is precies de volgende stap. Voeg dan een lux-sensor en een extra conditie toe die controleert of het al donker genoeg is voordat de lamp aangaat. zie andere blog!


Hieronder kun je bovenstaande flow downloaden incl. de genoemde helpers en de volledige YAML als Word-bijlage.

De genoemde helpers kun je zelf aanmaken in Home Assistant onder apparaten en diensten -> helpers -> Helper toevoegen.

Let op gebruik is op eigen risico!!


💡 Home Assistant PIR motion and lighting: automatic light on motion

This simple Home Assistant automation turns on a light automatically whenever motion is detected and someone’s home — and turns it back off once there’s been no motion for a while. No twilight or lux logic, no exceptions: this is the simple base version, ideal as a starting point before you extend it with, for example, twilight detection.

Specifically, this automation set handles:

  • Motion (or a door sensor) sets a “recent motion” status, which automatically turns off after a few minutes
  • Once that status is on and someone’s home, the light turns on
  • Once that status turns off again (or nobody’s home anymore), the light turns off

This article gives you a fully working example of the 2 automations that make up this flow, with explanations so beginners can set it up too. At the bottom, you can also download the complete, ready-made YAML.

The 2 automations are: motion to “PIR status”, and light on/off based on that status and presence.

⚙️ What do you need?

In Home Assistant:

  • binary_sensor for motion detection (PIR sensor) and/or a door sensor
  • light entity for the light you want to control
  • An input_boolean indicating whether someone’s home (input_boolean.iemand_aanwezig) — you can determine this yourself based on your person entities, or replace it with a fixed condition if you don’t have one

Helpers to create yourself:

  • input_boolean.pir_garage — tracks whether there’s been recent motion
  • input_boolean.iemand_aanwezig — indicates whether someone’s home

🧩 The 2 automations

Automation: Motion to PIR status

What it does: turns on a temporary “there’s been motion” status when the motion sensor or door sensor fires, and automatically turns it off again after a few minutes. This prevents the light from turning off immediately during a brief pause in motion.

How to build it:

trigger: state
entity_id:
  - binary_sensor.garage_deursensor
  - binary_sensor.garage_bewegingssensor
to: "on"

Action: input_boolean.turn_on on input_boolean.pir_garage, then delay: 2 minutes, then input_boolean.turn_off on that same helper. Use mode: restart so new motion resets the timer instead of running two timers side by side.

Automation: Light on/off based on PIR status and presence

What it does: turns the light on once there’s been motion and someone’s home, and turns it back off once that’s no longer the case.

How to build it:

trigger: state
entity_id:
  - input_boolean.pir_garage
  - input_boolean.iemand_aanwezig

Use a variable to determine whether the light should be on (is_state('input_boolean.pir_garage', 'on') and is_state('input_boolean.iemand_aanwezig', 'on')) and whether it’s already on. Turn the light on if it should be on but isn’t yet; turn it off if it shouldn’t be on anymore but still is. This way the automation only sends a command on an actual state change, instead of repeatedly resending “on”.

🧠 Templates used

No separate templates beyond the two is_state() conditions above — that’s exactly what keeps this version so simple.

❓ Frequently asked questions

Can I use this without the “someone’s home” helper? Yes, just leave that condition out (or replace it with true) so the light always responds to motion, even when nobody’s home.

Does this work with multiple motion sensors or lights? Yes, add extra entity IDs to the trigger list (for more sensors) or duplicate the action for multiple lights.

Can this be extended with twilight detection? Definitely — that’s exactly the next step. Add a lux sensor and an extra condition that checks whether it’s dark enough before the light turns on.


You can download the flow above, including the mentioned helpers and the full YAML as a Word attachment, below.

You can create the mentioned helpers yourself in Home Assistant under Settings -> Devices & Services -> Helpers -> Add Helper.

Please note: use is at your own risk!!


Geef een reactie

Je e-mailadres wordt niet gepubliceerd. Vereiste velden zijn gemarkeerd met *