[SOLVED] Help to create a rule "turn on a lamp when motion is detected but only after sunset until sunrise"

You can look at the post above or you can use a flag item
Please feel free to name it as you want

Items file:

Switch flagItem

Rules file:

rule "Set 1900 or Sunset flag"
    Time cron "0 0 19 * * ?" or
    Channel ‘astro:sun:home:set#start’ triggered START
then
    flagItem.sendCommand(ON) //sets flagItem
end

rule "Turn Off flag item"
when
    Time cron "0 0 6 * * ?" //6am
then
    flagItem.sendCommand(OFF) //resets flag item at 6am
end

rule " Light on when motion is detected after 1900 or sunset"
when
    Item Motion_GF_Corridor_Stiege received update ON
then
    if (flagItem.state == ON) {
        Light_FF_Stiege.sendCommand(ON)
    }
end

Also next time, try yo use the code fences as it help reading your code:

Good luck