configure scene to be active only certain hours/days?

I have configured a few scenes I want to be only active at night - is this possible?

I know I can set schedules in a scene, but as far as I understand - that means a scene runs at day X and time Y - but that is not sufficient for my requirements because I have a few scenes with a PIR - and I want that the PIR only works between certain hours (I know I can create a scene to arm my PIR and to disarm my PIR - and configure the main scene to work only if the PIR is armed, but this is also not sufficient for my requirements).

any advice?

Put this code in the scene’s Luup window:

if (luup.is_night()) then
return true
else
return false
end

The scene will then only run at night.

See Conditional Scene Execution for an explanation and more examples of the technique @racarter suggested.