DateTime, time, and Astro binding questions

Though I highly recommend using VSCode with the openHAB extension. Then you just type “now.” and a dialog will pop up with all the available methods.

You need the Item to access the value in the Rule. You cannot check the state of a Channel within Rules. You must use Items.

Assuming you have Astro installed and still have simple mode enabled, you probably already have an Item named astro_sun_mystrothing_night.

Now also it is important to realize that now is a Joda DateTime and a DateTime Item carries a DateTimeType and the two are not super compatible. See Textual Rules | openHAB for how to compare and convert the two to each other. The simplest would probably be to turn the DateTimeType into a Joda DateTime.

val night = new DateTime(astro_sun_myastrothing_night.state.toString)
if(now.isAfter(night)

Again, VSCode will help you a lot here as well with autocompletion and suggestions.

Every night a few seconds after midnight.

Night_Begin.state

See above

You might learn a lot from Design Pattern: Simple State Machine (e.g. Time Of Day). Not only is it a good way to centralize these sorts of calculations, it shows examples for a lot of the time comparisons you are after.