Garage light doesn't turn on

Hello. Here is my simple automation which turn on light and off 2 min after movement.

- id: Turn on Garage light when there is movement
  alias: Turn on Garage light when there is movement
  trigger:
  - platform: state
    entity_id: binary_sensor.garaz_motion
    to: 'on'
  condition: []
  action:
  - service: light.turn_on
    entity_id: light.garaz_swiatlo
  mode: single
- id: Turn off Garage light 2 minutes after last movement
  alias: Turn off Garage light 2 minutes after last movement
  trigger:
  - platform: state
    entity_id: binary_sensor.garaz_motion
    to: 'off'
    for: 0:2:00
  condition: []
  action:
  - service: light.turn_off
    entity_id: light.garaz_swiatlo
  mode: single

Everything works until I manually turn off light. I still need to wait 2 minutes to turn light automaticly.
In othe words:

  • I open the doors and light turns on
  • I close the doors wait 2 min and light turns off
    then
  • I open the doors and light turns on
  • I press button to turn off light
  • I am still in garage and moving and light doesn’t turn on
  • After 2 minutes light turns on

That is because the state never changes to ‘on’ for motion since it always sensed motion. It never goes off then on; it stays on for motion and your trigger is the state changes from anything to ‘on’.

What type of motion sensor is this?

It is SONOFF ZIGBEE SNZB-03

Aaa you you are right.
Ok now I know why so I have to figure out how to solve this.

What exactly do you want to accomplish?
You want the light to stay off if you turned it off whether motion or not?

I opened the Doors. Light turns on. I turned off lights by pressing switch on wall and shut the doors. The I chceked motion sensor in developer tools and state was “on” for 2 minutes. Why?
I want light turns on immediately if open the doors. As it was first time.

The only answer is because that’s the way it was designed. Niot very satisfying but there are a lot of motion sensors that are designed that way. In fact, I’d say most are designed tht way.

The only option you have is to look at the docs for the sensor to see if the re-trigger time is configurable.

Not sure if this will work but you can try starting a timer when motion is sensed that switches off the light after 2 minutes. Make sure that timer is reset whenever new motion is sensed.

But the problem isn’t the two minute off delay. It’s the “anti-bounce” delay built into the motion sensor that can’t detect new motion for two minutes after it initially detects motion.

Aside from re-configuring the hardware (if thats even possible) then there isn’t much to be done to fix it via an automation.