Aqara Motion sensor not working

Hi,

I would like to make a simple automation.

An Aqara motion sensor is used as a trigger to turn a light on when motion is detected. But the light is not turned on, This is the automation:

Trigger
Device: motion sensor
Trigger: motion is detected

No conditions

Action
Service: light turn on
Entity: light hallway

I also tried this:

Trigger
Trigger-type: State
Entity: binary_sensor_xxx
From: off….none……not_detected
To: on…detected……detected

No conditions

Action
Service: light turn on
Entity: light hallway

What I’m doing wrong? The sensor is succesfully recognized in Phoscon.

This is what your automation would look like in yaml:

id: Turn on Hallway light when there is movement
alias: Turn on Hallway light when there is movement
trigger:
  - platform: state
    entity_id: binary_sensor.hallway_motion_sensor
    to: 'on'
action:
  - service: light.turn_on
    target:
      entity_id:
        - light.hallway

Also, make sure that your sensor is recognized in HomeAssistant.

well you are posting something that is not yaml. Please post your automation as yaml.