[SOLVED] How to create a rule

hello everyone here beginner with open hab I would like to create a rule

when I arrive at home and it’s dark my outdoor light comes on

my light to light:
Switch inter_applique_exterior “Applique” (light, glumiere) [“Lighting”] {channel = “openwebnet: bus_on_off_switch: MYHOMESERVER1: external_application: switch”}

my geolocation:
Switch atHomeEX “home” {channel = “gpstracker: tracker: Vincent: regionTrigger” [profile = “gpstracker: trigger-geofence”, regionName = “home”]}

and the astro:
astro: sun: home: eveningNight # event triggered START
here is

if anyone could help me

New Item:

Switch ItsDark
rule "It's Dark"
when
    Channel 'astro:sun:home:set#event' triggered START
then
    ItsDark.postUpdate(ON)
end

rule "It's not dark"
when
    Channel 'astro:sun:home:rise#event' triggered START
then
    ItsDark.postUpdate(OFF)
end


rule "Vincent arrive a la maison et il a peur du noir"
when
    Item atHomeEX changed to ON
then
    if (ItsDark.state == ON) {
        inter_applique_exterior.sendCommand(ON)
    }
end

You need the new Item and the two rules to tell openHAB if it is dark or not
Then when you arrive at home Location item turns ON you check if it is dark and turn the light on accordingly

Have a look at Design Pattern: Time Of Day to give an idea on how to define different periods in the day to create rules with different behaviours

his walk nickel thank you very much !!!

Please tick the solution post, thanks