Sunset scene only if

Hello, I would like to create a scene that turns on a spotlight when I open my gate, but only when it’s night using the sunset.

I don’t know how to achieve this, if you can help me out with this one.

If I’m not mistaken, the logic implies (if tuba doesn’t have a light sensor) to create a virtual MQTT device, which you can call « night ».
The idea is that 2 scenes define the state of this device:

  • at sunset, set the sensor state to 1
  • at sunrise, set the sensor to 0.

Once that’s done, in your light activation scene, you can retrieve the value of Night, and say to continue if and only if Night=1

:+1:

The advantage is that this night variable is a bit generic, and usable in other scenarios!