I’ll point you to the Time of Day Design Pattern
This should be if(now.isAfter((SunSet_Time.state as DateTimeType).calendar.timeInMillis){
I think you are mistaken in this belief. Items are and will remain the primary way your HA system is represented and manipulated inside OH including Rules, Persistence, and Sitemaps. Even the new Experimental Rules engines is based on Items.
Secondly, Virtual Items are key to implementing state machines which are a very well proven approach to implementing many if not most automation tasks. @KjetilA’s solution and the Time of Day Design pattern are nothing more than a simple state machine that is driven by time.
The Astro 2 binding no longer sends ON/OFF commands to Items. It only supports setting DateTime Items or Trigger Events.[quote=“KjetilA, post:6, topic:20937”]
“virtual item” sounds a bit mysterious - and maybe I should not use that term.
[/quote]
I prefer “unbound Item”, as in an Item that is not bound to a binding nor linked to a channel.
You just react the Item and do not link it to any channel.
Furthermore, except as triggering events, Things are not accessible within Rules. However, if you have Simple Mode enabled, OH automatically creates an Item for each Thing. that might be what @ptmuldoon is accessing here. In which case astro_sun_local_daylight is a DateTime Item, not a Switch and this Item gets populated once every midnight, not at the time that it occurs. You need to use the triggering events as illustrated by @KjetilA.