Motion activated lights - extended

Hi friends,
In my our hallway I have a motion sensor and a light. I’m trying to achieve a HA-automation like this:
Given that sun is below horizon '(dark in the hallway)

  1. If motion triggered for less than 10 seconds. Fire script (night lamp)
  2. If motion continues to be triggered for 30 seconds Fire script (hallway dim)
  3. If motion continues to be triggered for 30 seconds. Fire script (hallway max)
    Really need your inputs and feedback.
    Thanks Fredrik

If your motion sensor stays on when it keeps detecting motion, and it doesn’t turn off and then immediately on, you could fire an automation with 3 different triggers and different activation ids, for exemple:

platform: state
entity_id: your motion sensor
id: night lamp / hallway dim / hallway max
for:
  hours: 0
  minutes: 0
  seconds: 10 / 30 / 60
to: on / motion_on

then have 3 choose conditions with each activation id to do what you need like this:

choose:
  - conditions:
      - condition: trigger
        id: night lamp / hallway dim / hallway max
    sequence:
      - service: //do what you want
default: []

of course you will have a condition for the whole automation to check if the sun is below horizion.

1 Like

Thanks,
Didn’t thought about this:

If your motion sensor stays on when it keeps detecting motion

Thanks :slight_smile:

1 Like