Motion based automation won't fire

Is there any chance someone could help me figure out why this isn’t wanting to trigger? I’m sure I’ve made some stupid little mistake, but I cannot figure it out. The idea is that motion turns some lights on (this part works fine) then a lack of motion activates a script that runs several functions. I know the script is good as I can run it effectively by pressing the “Run Actions” button, but it will not trigger on its own.

alias: Lack of motion Triggers Bedtime
description: ''
trigger:
  - platform: state
    entity_id: binary_sensor.living_room_motion_sensor_ias_zone
    to: Clear
    for:
      hours: 0
      minutes: 10
      seconds: 0
      milliseconds: 0
    from: Detected
condition:
  - condition: time
    after: '21:00:00'
action:
  - service: script.bedtime
mode: single

Validate the setting you are using for “to:”. On my motion sensors it is simply on or off. Also remember to use single quotes around the state
example

trigger:
  - platform: state
    entity_id: binary_sensor.living_room_motion_sensor_ias_zone
    to: 'off'
    for:
      hours: 0
      minutes: 10
      seconds: 0
      milliseconds: 0
    from: 'on'

That did it! Thank you.