Brightness and time dependence illumination

Hi there,

I would like to switch on some light (dimmed at 45%), if the brightness is below 50 lux and if the time is between 4 pm and 11 pm.
These parameters should also be the condition, for switching off (switch off, if it gets brighter or after the time slot).

I also would like to use sth. like this in the morning (brightness below 50 lux and time between 6 and 8 am). Perhaps it is possible to put it in one automation? I don’t know.

So I added a automation like this:

alias: Fassadenbeleuchtung, Abends, Wochenende
description: ""
triggers:
  - trigger: numeric_state
    entity_id:
      - sensor.wetterstation_helligkeit
    below: 50
conditions:
  - condition: time
    weekday:
      - fri
      - sat
    after: "16:00:00"
    before: "23:00:00"
actions:
  - action: light.turn_on
    metadata: {}
    data:
      brightness_step_pct: 45
    target:
      entity_id:
        - light.fassade_wandlampen_strasse
        - light.fassade_wandlampen_zur_einfahrt
        - light.fassade_wandlampen_terrasse_sud_ost
mode: single

I created it in the visual editor because I don’t understand Yaml that well, but I think Yaml is more international, than the german, visual editor.

Works so far - but the lights stay on until eternity. Seems like, the parameters are no condition for switching off.

Can anyone help?

Kind regards

When do you want them to turn off?

Brighter than 50 Lux before 4pm or after 11 pm?

Those are your second automation triggers and conditions.

Don’t try to do it all in one, two automations (one for on, one for off) is simpler to implement and easier to debug.

At 11 pm, or if it gets brighter than 50 lux, they should turn off.

Or other - if one of the conditions (time between 4pm and 11 pm and brightness below 50 lux) isn’t right anymore, the lights can turn off.

So no time condition at all then?

As what you wrote covers all hours of the day.

That makes it easy. Two triggers. One trigger at 11pm and one for lux > 50. Then turn off your light.

I don’t understand, what you mean.

The conditions are:
If the time is between 4pm and 11pm AND the brightness lowers under 50 lux, the lights have to get on at 45%

If it gets later then 11pm, the lights have to go off.

So how should that look like in the visual editor?