It is controlled by rules using the astro binding.
rule "Sunset"
when
Channel 'astro:sun:local:civilDusk#event' triggered START
then
IsItDark.postUpdate(ON)
end
rule "Sunrise"
when
Channel 'astro:sun:local:civilDawn#event' triggered START
then
IsItDark.postUpdate(OFF)
end
Your item DayOrNight is of type string, but you try to apply a value ON (without “”), which is an openhab-special ENUM. Either you make DayOrNight a Switch:
Switch DayOrNight "Day or Light" <day_or_night>
or you set the state as a String in your rule:
DayOrNight.postUpdate("ON")
NOTE: you can’t (or maybe only shouldn’t) simply do DayOrNight.state = ON.
Sidenote: I doubt there is an icon in openhab called “day_or_night” - so unless you’ve added your own there will be nothing shown