Problem with Ikea bulbs and sensor not setting brightness

Hello

Im rather new to the whole HA scene and not the best at coding.

Wife brought me home stuff from Ikea last week, with the message: make it work asap.
So the thing is, the setup consists of the following

3 Stoftmoln lamps
2 Trådfri sensors
1 Rodret Button
Got a dirigera hub running atm which handless everything else smart lighting wise.

Im supposed to make it turn on by sensors @ 100% brightness during 6am and 10pm, and betweek 10pm and 6pm i only turns on at like 30 percent. And automaticly turn off after 5 min.
Rodret contact is supposed to turn on the lights for 20 mins, but havent really figured out to build that in yet.

As for my limited knowledge on coding, i made 2 simple scripts which is tested against a single bulp.
They work time wise and such, but the brightness change is working right. Sometimes works, sometimes it doesn’t.

So what am i doing wrong, do i need to use a transition instead or something?

Could it be merged to one?
Would that make

alias: Bryggers dag 
description: ""
trigger:
  - type: motion
    platform: device
    device_id: 474285bfb1bf87da89b096119325e448
    entity_id: cbc5d14c290a1847d6d3a2253ccd0353
    domain: binary_sensor
  - type: motion
    platform: device
    device_id: 2617a1438a6df396953f46c26a714c67
    entity_id: 2972245cacf60d5ab0da5c865f1416e5
    domain: binary_sensor
condition:
  - condition: time
    after: "06:00:00"
    before: "22:00:00"
    weekday:
      - fri
      - thu
      - wed
      - tue
      - mon
      - sun
      - sat
action:
  - type: turn_on
    device_id: a8b8bcdafe03a5ede8eccdfa30b97c8c
    entity_id: 14c5926b3332209479609531146a8941
    domain: light
    brightness_pct: 100
  - delay:
      hours: 0
      minutes: 5
      seconds: 0
      milliseconds: 0
  - type: turn_off
    device_id: a8b8bcdafe03a5ede8eccdfa30b97c8c
    entity_id: 14c5926b3332209479609531146a8941
    domain: light
mode: restart

alias: Bryggers nat 
description: ""
trigger:
  - type: motion
    platform: device
    device_id: 474285bfb1bf87da89b096119325e448
    entity_id: cbc5d14c290a1847d6d3a2253ccd0353
    domain: binary_sensor
  - type: motion
    platform: device
    device_id: 2617a1438a6df396953f46c26a714c67
    entity_id: 2972245cacf60d5ab0da5c865f1416e5
    domain: binary_sensor
condition:
  - condition: time
    after: "22:00:00"
    before: "06:00:00"
    weekday:
      - sat
      - fri
      - thu
      - wed
      - tue
      - mon
      - sun
action:
  - type: turn_on
    device_id: a8b8bcdafe03a5ede8eccdfa30b97c8c
    entity_id: 14c5926b3332209479609531146a8941
    domain: light
    brightness_pct: 30
  - delay:
      hours: 0
      minutes: 5
      seconds: 0
      milliseconds: 0
  - type: turn_off
    device_id: a8b8bcdafe03a5ede8eccdfa30b97c8c
    entity_id: 14c5926b3332209479609531146a8941
    domain: light
mode: restart

Hope it makes sense.

Kind regards Kim.