Astro rule sunset_event, is this the correct syntax?

Saved a rule “donker.rules” in the rules-folder:
Is this the right syntax?

rule “sunrise”
when
Item Sunrise_Event received update ON
then
Item sunset==ON
end

rule “sunset”
when
Item Sunset_Event received update ON
then
Item sunset==OFF
end

do I need the make the items sunset_event and sunrise_event in the items-file?
or are these kinda ‘stock’-items which are already in the astro-binding?

edit : sunset is a switch-item in my items-file

edit : I did it this way as I understood the moment it gets dark, the Sunset_Event gets a brief ‘ON’ and is then back to ‘OFF’

Not sure why you’re turning it back on/off after it is triggered.

Here is how I handle a sunrise event in my setup.

Items:

DateTime Sunrise_Time “Sunrise [%1$tH:%1$tM]” {astro=“planet=sun, type=rise, property=start”}
DateTime Sunset_Time “Sunset [%1$tH:%1$tM]” {astro=“planet=sun, type=set, property=end”}
Switch Sunrise_HourA {astro=“planet=sun, type=rise, property=start, offset=60”}
Switch Sunset_60B4 {astro=“planet=sun, type=set, property=end, offset=-60”}
Switch Sunset_90B4 {astro=“planet=sun, type=set, property=end, offset=-90”}
Switch Sunset_120B4 {astro=“planet=sun, type=set, property=end, offset=-120”}

Rule:

rule “Morning End - 1 hour after sunrise”
when
Item Sunrise_HourA received update ON
then
//light scene
callScript(“lights_mornend”)
end

That’s just one rule for that particular event, there are other rules that use the other items.

I want to trigger (on for a second or less) gpio7 at sunset when item (Presence) is OFF
and at sunrise trigger (on for a second or less) gpio8 when item (Presence) is OFF

So I thought I needed to save the ‘state’ of sunset/rise somewhere before using it in another rule.

This is my next try:
(don’t know how to write all the syntax)

rule-file:

rule “simulateMORNING”
when
Item Sunrise received update ON
then
if (Item Precense==OFF) {
Item Gpio7 setvalue(ON)
}
end

rule “simulateEVENING”
when
Item Sunset received update ON
then
if (Item Precense==OFF) {
Item Gpio8 setvalue(ON)
}
end

item-file:

Contact Gpio7 “NO_Gpio7” { gpio=“pin:7 debounce:10” }
Contact Gpio8 “NO_Gpio8” { gpio=“pin:8 debounce:10” }

Please use MyItem.sendCommand(ON|OFF) or sendCommand(MyItem, ON|OFF) to set the State of MyItem (in case of MyItem being a Switch Item) within a rule.

Keep in mind that Contact is a read-only Item, you can’t use sendCommand to a Contact Item

Ok, thx… Think there is another problem
edit
solved other problem (with gpio)
now testing astro-binding