HassIO automation brightness

Hey guys,

My setup:
Pi4 - zigbee2mqtt - USB CC dongle - Hue bridge > Light

When I enter my hall or bathroom my light is turned on at 100% but between 00:30 - 06:00 I set brightness to 5% because I assume that if you walk at that time frame you don’t want bright light. Everything is working like a charm the problem is that the bulb light up at 100% and instantly decreases to 5% which is like a fast bright flash and then drops to 5%.

Anyone experience that issue. I assume that you cannot light the bulb at 5% but first, you light up in the last state and then a new state 5% brightness is applied which causes this flash. The problem is after 00:30 i can walk 2-3 times and its the same flash, so it’s not the last state issue it seems the bulb start at 100% every time.

 # Bathrom light
  - id: Bathroom_light_100
    alias: Turn on bathroom light at 100% when there is movement
    trigger:
    - platform: state
      entity_id: binary_sensor.bathroom_occupancy
      to: 'on'
    action:
    - service: light.turn_on
      entity_id: light.bathroom
      data:
        brightness_pct: 100
  - id: Bathroom_light_5
    alias: Turn on bathroom lights at 5% at night
    trigger:
    - platform: state
      entity_id: binary_sensor.bathroom_occupancy
      to: 'on'
    condition:
    - condition: time
      after: '00:30'
      before: '06:00'
    action:
    - service: light.turn_on
      entity_id: light.bathroom
      data:
        brightness_pct: 5

Maybe it is because both automations run at the same time. You can try adding a condition to your ‘bathroom_light_100’ to only run after 06:00 and before 00:30. That way, only the second automation runs in the morning.

Mother of god I was watching the log and didn’t notice it at all that both are executing one after another. That is because i use the search bar. Thank you for poiting that out.

It seems Hue last state is also involved here i will try your approach and leave Hue bulb at last state.

Thank you.