Dimming different after sunset

Hi

I have one pushbutton where I control some lights with.
I have 2 scenarios:

  • During daylight:
    • short press → light goes on 100%
    • long press → dimming
  • After daylight:
    • short press → light goes on 50%
    • long press → dimming

Whenever the light is on, when you press short, the light has to go off.
How do I this efficient as possible (with as few virtual relais as possible).

Thanks

There’s a simple solution, if you have a mini computer with either

  • NodeRed
  • Home Assistant
  • openHAB

Just run a rule that monitors the dim level Vs time of day

Between xPM & xAM, if the dim level goes over 50%, drop it back down.

Then your button action need be nothing more than
Toggle at short press, Dim at long press.