Automation trigger state for XX minutes, won't triggger anymore

Since I updated from 0.85.1 tot 0.86.4 this automation does not work anymore as intended:

- id: turn_on_kitchen_lights_on_motion
  alias: Turn on the kitchen lights on motion
  trigger:
    platform: state
    entity_id: binary_sensor.hue_motion_sensor_motion_keuken
    to: 'on'
  condition:
    condition: numeric_state
    entity_id: sensor.keuken_lux
    below: '12'
  action:
    service: light.turn_on
    entity_id: light.aanrecht

- id: turn_off_kitchen_lights_after_5min
  alias: Turn the kitchen lights off 5 min after last motion
  trigger:
    platform: state
    entity_id: binary_sensor.hue_motion_sensor_motion_keuken
    to: 'off'
    for:
      minutes: 5
  action:
    service: light.turn_off
    entity_id: light.aanrecht

The light will turn on. but never off.
If I manually trigger the ‘Turn the kitchen lights off 5 min after last motion’ it works, but I’t won’t trigger at the 5 minutes past last motion.

Strange thing is, before the update this worked flawlessly.

I have checked everything, but no luck.

Anyone?

Is the automation enabled?

I’m on 0.86.4 and just checked that my very similar automation does work:

- id: ensuite_lights_auto_off
  alias: 'Ensuite Lights Auto Off'
  trigger:
    platform: state
    entity_id: binary_sensor.pir_ensuite
    to: 'off'
    for:
      minutes: 1
  condition:
    - condition: state
      entity_id: light.lifx_ensuite
      state: 'on'
  action:
    - service: light.turn_off
      entity_id: light.lifx_ensuite

Yes they are.

I use the same automation on my own system and there it works as well. It just doesn’t on my parents system.

I’m puzzled by this problem. I have one idea why it may not work. However, it’s only based on a wild guess, and is only a remote possibility, so don’t get your hopes up! :slight_smile:

Are you using the same kind of motion sensor (Philips Hue) in your system and in your parents’ system? If the sensors are the same then I don’t know why it fails to work. However, if the sensors are different, perhaps the automation is failing because something has changed in the Hue sensor’s operation between versions 0.85.1 and 0.86.4. There have been several recent changes to the Hue component.

Like I said, it’s only a remote possibility …

Are you sure?

try putting this in for the second automation then reload your automations:

- id: turn_off_kitchen_lights_after_5min
  alias: Turn the kitchen lights off 5 min after last motion
  initial_state: 'on'
  trigger:
    platform: state
    entity_id: binary_sensor.hue_motion_sensor_motion_keuken
    to: 'off'
    for:
      minutes: 5
  action:
    service: light.turn_off
    entity_id: light.aanrecht

Otherwise everything looks OK. Especially if it worked before.

Thanks, but the automation was on. I have it working again, after rebooting the docker container.