Motion direction detection

Tags: #<Tag:0x00007f7399bc98a0>

Hi,

I would like to trigger an automation if a person enter a room through a specific door / direction.

The room setup looks like this:

My idea is to check of motion sensor 1 is triggered, but motion sensor 2 not.
This is my implementation:

- id: '1601549256313'
  alias: Hallway motion
  description: ''
  trigger:
  - platform: state
    entity_id: binary_sensor.motion_sensor_1
    to: 'on'
  condition:
  - condition: state
    entity_id: binary_sensor.motion_sensor_2
    state: 'off'
  action:
  - type: turn_on
    device_id: 8d950be504ea11eb9b13f166cdb5cbf8
    entity_id: light.color_temperature_light_6
    domain: light
    brightness_pct: 30
  mode: restart

Unfortunately the automation is never triggered. Does someone has an idea what the problem could be?

I tried to track the motion states and I see sometimes a delay of changed status.

I’m using a Zigbee motion sensor through a Conbee2 stick.