IKEA Lights Auto Off w/ Dim warning / Cancel - Not restoring correct brightness

Concept
I have some rooms in my house that I want to have the lights go off automatically. I am using a “time since motion” automation to do this, but I also wanted to notify people in the room that they will be going off and give them a chance to interrupt it.

Implementation
So I designed two automation.

One that dims the lights to 100 after 5 minutes without motion.
Waits 1 minute and checks if the lights are still at 100 then power them off.

The second one is triggered on motion and checks if the lights are at 100 and then turns the back to 255 brightness. (This will restore brightness and cancel the second half of the first automation.)

This works in principle. Kids could be playing blocks in their room and if the motion sensor hasn’t seen them move for 5 minutes the lights dim a little and they can wave an arm and the lights restore to full brightness.

Problem
The issue I ran into was that these bulbs are IKEA bulbs and when you turn the lights back on they restore the last state they were in. Thus when you come back to a room and turn the lights on, they come on dim.

Attempt to fix
To fix this I added a few extra steps to my first automation, that after it’s checked that no one has canceled it, it will then restore brightness to full and then power them off. However, this did not fix my issue. They still came back on dim. I then increased the time that they are fully bright to longer and longer intervals. At this point, the lights go fully bright for 30 seconds and then power off and they still come back on dim.

Question
Does anyone know a better way to do this?
Does anyone know how long an IKEA bulb has to be in a state to think of it as its restore state?
Is there a way to turn off restore previous state on IKEA bulbs?

CODE:

Automation #1

alias: Motion - Stop 15m - (BEDROOM) - Dim then Turn off Room Lights
description: >-
  After 5 minutes of no motion, it will dim lights for one minute.  It will then
  verify the lights are still dim, max them to 100% and turn them off.

#Triger 5 minutes from motion detected
trigger:
  - type: no_motion
    platform: device
    device_id: b02ea0f70cce11eb89d46d2296d3c634
    entity_id: binary_sensor.bedroom_motion
    domain: binary_sensor
    for:
      hours: 0
      minutes: 5
      seconds: 0
      milliseconds: 0

#Verify Light is On
condition:
  - condition: state
    entity_id: light.bedroom_1
    state: 'on'

#Set Brightness to Dim (100)
action:
  - service: light.turn_on
    data:
      brightness: 100
      transition: 1
    target:
      entity_id: light.bedroom

#Wait 1 minute
  - delay:
      hours: 0
      minutes: 1
      seconds: 0
      milliseconds: 0

#Verify Light still Dim (100)
  - condition: numeric_state
    entity_id: light.bedroom_1
    attribute: brightness
    below: '101'
    above: '98'

#Set lights back to bright
  - service: light.turn_on
    data:
      brightness: 254
      transition: 1
    target:
      entity_id: light.bedroom

#Wait 30 seconds
  - delay:
      hours: 0
      minutes: 0
      seconds: 30
      milliseconds: 0

#Turn off lights
  - service: light.turn_off
    data:
      transition: 1
    target:
      entity_id: light.bedroom
mode: single

Automation #2

alias: Motion - Stop 15M Cancel - (BEDROOM) - Turn Lights Back On
description: ''

#Trigger from motion
trigger:
  - type: motion
    platform: device
    device_id: b02ea0f70cce11eb89d46d2296d3c634
    entity_id: binary_sensor.bedroom_motion
    domain: binary_sensor

#Check if lights are set to dim (100)
condition:
  - condition: numeric_state
    entity_id: light.bedroom_1
    attribute: brightness
    below: '101'
    above: '98'

#Turn lights back to bright
action:
  - service: light.turn_on
    data:
      brightness: 254
      transition: 1
    target:
      entity_id: light.bedroom
mode: single