Motion sensor to only turn the light on

Hello,

I want to use a motion sensor to only turn a light on, not off.

So if a motion sensor detects movement, it turn the light on, then start a timer of an hour until then the light stays on unless I manually turn the light off myself. (This is so that I don’t have to shake my arms around after 3 minute time out)

The problem may occur when I walk in the room again within that hour and so the light won’t turn on.

So for this, is there way to tell the motion sensor if the lights have changed states from on to off, then reset itself?

So essentially I know exactly what I want to achieve. But I don’t know how to go about it. Or if you have a better idea which is simpler and does the same thing share that with me

Thanks! :smile:

You can use wait_for_trigger to wait for your light be turned off, then another delay of a few seconds to avoid the light turning on immediately…

Let me create it and I will share here, hold on.

Something like this:


alias: New Automation
description: ""
trigger:
  - type: occupied
    platform: device
    device_id: 050cd12fb1ebdd3c61dd08dec3b080df
    entity_id: binary_sensor.hall_motion_occupancy
    domain: binary_sensor
condition: []
action:
  - type: turn_on
    device_id: 462b45dfcd601eb0ef1870665c24375c
    entity_id: light.hall_ceiling_light
    domain: light
  - wait_for_trigger:
      - platform: device
        type: turned_off
        device_id: 462b45dfcd601eb0ef1870665c24375c
        entity_id: light.hall_ceiling_light
        domain: light
        for:
          hours: 0
          minutes: 0
          seconds: 5
    timeout: "3600"
mode: single

But you can also take any light automation based on movement and set the timeout for 1h and you will have almost the same result, unless you stay quiet for more than 1h in the room, and have the advantage of the light turning off if you forget that.

Like this one: https://github.com/home-assistant/core/blob/7ca7a28db94c64e80fb70cc2e75c5610c6c18009/homeassistant/components/automation/blueprints/motion_light.yaml

Just select 1h (3600 sec) for the time to be on.

Have you looked at Entity Controller on HACS? It’s designed to handle this sort of thing.