Automation for a Aqara motion sensor to trigger light on

Hello

I tried different blueprints. Howevery I get with none of them so really happy and created a simple automation by myself. And this really works.

What I want:
A Aqara motion sensor should trigger a light blub to switch on. After inactivity the light should get off automatically. I don’t wand any short switch off and on of the blub. The solution should work with 1 or 2 motion sensors.

This is the simple solution, if somebody else has the same need:

- id: light_keller_werkraum_licht_ein
  description: ""
  mode: restart
  trigger:
  - platform: state
    entity_id:
      - binary_sensor.motion_werkraum
    to: "on"
  action:
  - service: light.turn_on
    entity_id: light.licht_werkraum
- id: light_keller_werkraum_licht_aus
  description: ""
  mode: restart
  trigger:
  - platform: state
    entity_id:
      - binary_sensor.motion_werkraum
    to: "off"
  condition:
  - condition: state
    entity_id: binary_sensor.motion_werkraum
    state: "off"
  action:
  - delay: 00:02:00
  - if:
    - condition: state
      entity_id: binary_sensor.motion_werkraum
      state: "off"
    then:
    - service: light.turn_off
      entity_id:
        - light.licht_werkraum

Some explainations:

 mode: restart 

is needed that the light stays off, if the motion sensor triggers again.

The conditions are needed to check of the motion sensor has triggered again in the mean time.

1 Like