Lights fade out on inactivity, but can't be interrupted?

Hey folks,
I’m using Xiaomi motion sensors to change an input_select to ‘active’ when it detects motion, and then to change it back to ‘inactive’ when it hasn’t detected anything for 15 minutes. The idea behind this is for the input_select to be used to trigger a bunch of automations, such as turn on the fan and lights when entering the room, then off on inactivity.

It works great, except for an edge case of when I enter the room immediately after inactivity has been set. As the lights are instructed to fade out over 30 seconds on inactivity, if I walk into the room during those 30 seconds the lights continue to fade to black. This is because the command lights.turn_on does not work on lights that have been instructed to fade out, as their state registers as ‘on’ during the dimming process.

Can anyone recommend a more efficient way to achieve this?

The input_select

input_select:
  bedroom_activity:
    name: Bedroom Activity
    options:
      - active
      - inactive
    icon: mdi:motion-sensor

The Automations

- id: '1564051753896'
  alias: Bedroom Activity to Active
  trigger:
  - entity_id: binary_sensor.bedroom_presence
    from: 'off'
    platform: state
    to: 'on'
  condition: []
  action:
  - data:
      entity_id: input_select.bedroom_activity
      option: active
    service: input_select.select_option

- id: '1564052026599'
  alias: Bedroom Activity to Inactive
  trigger:
  - entity_id: binary_sensor.bedroom_presence
    for: 00:15:00
    from: 'on'
    platform: state
    to: 'off'
  condition: []
  action:
  - data:
      entity_id: input_select.bedroom_activity
      option: inactive
    service: input_select.select_option

- id: '1565803704027'
  alias: Bedroom Lights Auto On
  trigger:
  - entity_id: input_select.bedroom_activity
    from: inactive
    platform: state
    to: active
  condition:
  - condition: state
    entity_id: group.bedroom
    state: 'off'
  action:
  - data:
      entity_id: group.bedroom
      transition: '10'
    service: light.turn_on
- id: '1565803891036'
  alias: Bedroom Lights Auto Off
  trigger:
  - entity_id: input_select.bedroom_activity
    from: active
    platform: state
    to: inactive
  condition:
  - condition: state
    entity_id: input_boolean.bedroom_lights_automation
    state: 'on'
  - condition: state
    entity_id: group.bedroom
    state: 'on'
  action:
  - data:
      entity_id: group.bedroom
      transition: '30'
    service: light.turn_off

The way I dealt with it was to stop using long (any) transitions.

I’d be interested if anyone comes up with anything but I suspect once the command is given to the light there is no way to interrupt what the light is doing.

Yep that’s what I reckon also. Don’t really want to suddenly plunge the room into darkness for safety reasons, so was hoping there’s a more elegant way to handle things.

I have the same issue, but did anyone ever find a solution? Besides not using transitions?