Continuous Motion Automation

Hello,

is there a way to make an motiona ctived automation with HASS, which works as good as the blueprint?
I have the problem, that when I do an auomation myself, I can’t detect continous motion, so it only works, if the motion sensor stops detect motion, when there’s continuous motion in the room, the light will just go off after at the end of the automation and the automation wont’ restart.

I have an example:
This blueprint automation works very good, even if there’s continous motion

alias: Flur Bewegung
description: ''
use_blueprint:
  path: homeassistant/motion_light.yaml
  input:
    motion_entity: binary_sensor.presence_2
    light_target:
      entity_id: light.flur
    no_motion_wait: 30

But this automation only works, when there’s a NEW motion detected:

alias: Flur Bewegung Tagsüber
description: ''
trigger:
  - type: motion
    platform: device
    device_id: 70a495065210ef38abc97fb3a3142baf
    entity_id: binary_sensor.presence_2
    domain: binary_sensor
condition:
  - condition: time
    after: '07:00:00'
action:
  - service: light.turn_on
    target:
      entity_id:
        - light.flur
    data:
      brightness_pct: 100
  - delay:
      hours: 0
      minutes: 0
      seconds: 30
      milliseconds: 0
  - service: light.turn_on
    target:
      entity_id:
        - light.flur
    data:
      brightness_pct: 50
  - delay:
      hours: 0
      minutes: 0
      seconds: 30
      milliseconds: 0
  - service: light.turn_off
    target:
      entity_id:
        - light.flur
mode: restart

Is there any possiblity to get the same function of continous motion like the blueprint has?

I hope someone can help me,

Greetings,
Simon

What you want to have is a trigger that tracks when the motion sensor goes from OFF to ON and have your time-out such that it won’t time out before the device resets.

I use Fibaro sensors everywhere and I can configure how long until it automatically goes from ON back to OFF again, but most defaults are 2-3 minutes, so if you have the light turn off in 4 minutes then this will always keep the light on because it detects motion:

trigger:
  - type: turned_on
    platform: device
    device_id: 70a495065210ef38abc97fb3a3142baf
    entity_id: binary_sensor.presence_2
    domain: binary_sensor

You could also use something like this:

mode: restart
trigger:
  - platform: state
    entity_id: binary_sensor.presence_2
    from: 'off'
    to: 'on'

The restart is key because it will just keep that light on in perpetuity so long as the off to on state is triggered.

Thanks, I knew I had to use restart, but the auto off feature was new to me, I have to look, if I finde something about that with my Hue Motion Sensor. But then there’s no other possibility, then the auto off? I can’t recreate the blueprint, wich seems to have an trigger for contious automation?