OH4 CEN Configuration does not work

There hasn’t been a wiki for docs in OH since OH 1.x. All the docs can be found at Introduction | openHAB. The syntax for Rules DSL in specific can be found at Textual Rules | openHAB.

There have been some postings on the forum for working with ZonedDateTimes. DateTime Conversion (openHAB 2.x) is a tutorial that covers how DateTimes work in Rules DSL since OH 3.

During the lifetime of OH 2 the Joda library, which is what OH used, became deprecated. One of the breaking changes between OH 2 and OH 3 was a move to use the standard java.time library for DateTime instead. They are very similar but not identical, hence the breaking change.You can find the docs for java.time.ZonedDateTime at ZonedDateTime (Java SE 17 & JDK 17).

I’m not sure what you mean by it being straight forward before as the old Joda library and the new library work almost exactly the same but the names of the methods are slightly different.

In pretty much all of the other rules langauges OH now supports, working with DateTimes is usually even easier. For example, in JS Scripting to get a DateTime one week, three hours and 25 seconds from now you’d use time.toZDT('P1WT3H25S'). In Rules DSL that would be now.plusDays(7).plusHours(3).plusSeconds(25). In JS Scripting, to sumtract an hour from a DateTime stored in a DateTime Item you’s use time.toZDT(items.MyDateTimeItem).minusHours(1) and in Rules DSL it would be (MyDateTimeItem.state as DateTimeType).zonedDateTime.minusHours(1).

This is probably the least reason why I recommend against new development of rules in Rules DSL. Rules DSL has a bunch of problems and it’s no longer easier to work in than the other rules languages options. So you end up suffering through it’s half assed type system and lack of features but don’t even get the benefit of having a simpler and easier programming enviornmnet to learn in.