How to NOT run an action if the device state is equal to or more than

I have an automation that turns on various accent lights around the house, including an Inovelli dimmer for the dining room. The automation runs, sets the dining light to 45 percent brightness 30 minutes before sunset and all is relatively good.

However, I grumbles from the family because sometimes they will be in the dining room working and especially on a cloudy-ish day where they’ve turned the light on to full bright before the automation has gone off.

Is there a way to set something like if dining is already at X brightness don’t change ?
Or a range of brightness: If dining is 45-100%, don’t change

Thanks!
Wayne

Well sure, use conditions.
What did you try? Show us your automation code…

I pasted the wrong code in, disregard this one…

- id: ‘1600834386423’
alias: Evening Accent Lights
description: ‘’
trigger:
- event: sunset
offset: -00:40:00
platform: sun
action:
- type: turn_on
device_id: d8d2cb6aef796c54b8228749f3cd76b6
entity_id: switch.kitchen_under_cabinet
domain: switch
- type: turn_on
device_id: 3ccc2b4220a9135eacdc359d9a84739c
entity_id: light.master_powder_level_2
domain: light
brightness_pct: 42
- type: turn_on
device_id: b6773b73f18e6ae01708f2a6eb362586
entity_id: switch.master_bedroom_powerstrip_2
domain: switch
- type: turn_on
device_id: b6773b73f18e6ae01708f2a6eb362586
entity_id: switch.master_bedroom_powerstrip_1
domain: switch
- type: turn_on
device_id: 690b8b126d95011ee6eb4a86178cd855
entity_id: switch.laundry_room_1
domain: switch
- type: turn_on
device_id: 18d74ecc7e3e60d8f1384b45b9764285
entity_id: light.living_room_left
domain: light
brightness_pct: 30
- type: turn_on
device_id: f5947035a507ab4976acb0b2fdef04a1
entity_id: light.living_room_right
domain: light
brightness_pct: 30
- type: turn_on
device_id: 7e9eb181f4d20c8a4661e7df874e068a
entity_id: light.color_light_3
domain: light
brightness_pct: 5
mode: single

I looked at Conditions but didn’t get far, is it Condition and Condition State, then specify the range? Where does the Condition set go in conjunction with the DIning Light?

What was your blocking point, exactly?
You basically have an example at

See Conditions - Home Assistant to add a condition on the brightness attribute.

This is what I setup, which did not turn the lights on at all, when they were off this morning. Conditional State, above set to 75. So, if the light is on and above 75% brightness I don’t want it to run because that assumes we already turned the light on. Do I need a “below” number as well?

id: '1611112956352'
  alias: Turn on Powder
  description: Turn on Powder room lights - Weekday
  trigger:
  - platform: time
    at: 06:30:00
  condition:
  - condition: time
    weekday:
    - mon
    - tue
    - wed
    - thu
    - fri
  - condition: numeric_state
    entity_id: light.master_powder_level_2
    above: '75'
  action:
  - type: turn_on
    device_id: 3ccc2b4220a9135eacdc359d9a84739c
    entity_id: light.master_powder_level_2
    domain: light
    brightness_pct: 50
  - delay: 00:05:00
  - type: turn_on
    device_id: 3ccc2b4220a9135eacdc359d9a84739c
    entity_id: light.master_powder_level_2
    domain: light
    brightness_pct: 75
  - delay: 00:05:00
  - type: turn_on
    device_id: 3ccc2b4220a9135eacdc359d9a84739c
    entity_id: light.master_powder_level_2
    domain: light
    brightness_pct: 100
  - type: turn_on
    device_id: 66a2d01c29cdfadaa364ced0c9d54d62
    entity_id: switch.master_vanity_switch_3
    domain: switch
  mode: single

You have to specify that you’re testing the brightness attribute.
Also, it goes form 0 → 255, so 75% would be 192 (unless your light have someting like an brightness_pct attribute. See the state in the developer tools to know.
Also, if I understand you correctly, you actually only want the action to run if brightness is below a value

  - condition: numeric_state
    entity_id: light.master_powder_level_2
    attribute: brightness
    below: 192

I’ll give that a try.

Yes, if the light is already on I don’t want it to run the “wakeup” cycle. As in; on a normal day 6:30am is a good enough start time for my wife and I’s wake up routine. On occasion one of us has to go into work early in which we’d have already turned the bathroom lights on to full bright at say 6:15am. I don’t want the “wake-up” routine to run because it’s going to dim the light back down to 50% then 75% then 100 finally.

And my sincerest apologies for pasting in the wrong code to start with. The last one, Turn on Powder is what I’m working on.

This is the current code which did not turn the lights on this morning. Brightness of 108 is about 40%, so I went with 120 as the “below”. It seems like were on the right track, the light was off this morning so brightness was at zero, so why wouldn’t it pass the condition and turn things on?

id: '1611112956352'
  alias: Turn on Powder
  description: Turn on Powder room lights - Weekday
  trigger:
  - platform: time
    at: 06:30:00
  condition:
  - condition: time
    weekday:
    - mon
    - tue
    - wed
    - thu
    - fri
  - condition: numeric_state
    entity_id: light.master_powder_level_2
    attribute: brightness
    below: '120'
  action:
  - type: turn_on
    device_id: 3ccc2b4220a9135eacdc359d9a84739c
    entity_id: light.master_powder_level_2
    domain: light
    brightness_pct: 50
  - delay: 00:05:00
  - type: turn_on
    device_id: 3ccc2b4220a9135eacdc359d9a84739c
    entity_id: light.master_powder_level_2
    domain: light
    brightness_pct: 75
  - delay: 00:05:00
  - type: turn_on
    device_id: 3ccc2b4220a9135eacdc359d9a84739c
    entity_id: light.master_powder_level_2
    domain: light
    brightness_pct: 100
  - type: turn_on
    device_id: 66a2d01c29cdfadaa364ced0c9d54d62
    entity_id: switch.master_vanity_switch_3
    domain: switch
  mode: single

if the lights are off, there is no brightness so that condition will not pass.

I’m obviously no expert, but to me if the light is off that equals a condition attribute of zero so why does it not pass and move on? Looking at the Conditions example it should:

condition:
  alias: "Paulus home OR temperature below 20"
  condition: or
  conditions:
    - condition: state
      entity_id: "device_tracker.paulus"
      state: "home"
    - condition: numeric_state
      entity_id: "sensor.temperature"
      below: 20

Zero brightness is still below 120 brightness so it should pass that condition move on down correct?

Check the attributes on the light when it’s off, you’ll notice that brightness is missing. Therefore that condition will fail.