I donāt use .items files.
The first error is you chose the wrong Item for the Time of Day State Item. You need to choose your TimeOfDay Item, not Default_Day. The TimeOfDay Item is properly defined as a String.
The second error is because all the members of TimesOfDay need to be DateTime Items and all of them must have a non NULL and non UNDEF state. Ony the time portion of the DateTime will be used though so you donāt have to worry about the date. Youāve defined them as String Items.
Thatās weird. It only complains about that one Item? Iām on OH 4.2 release too.
What do you get output from the following two lines (run them from -Scratchpad- or a temporary rule or something:
console.info('openhab-js version: ' + utils.OPENHAB_JS_VERSION);
console.info('OHRT version: ' + helpers.OHRT_VERSION);
Also put the logging level to DEBUG for org.openhab.automation.rules_tools.TimeStateMachine. You can do this all the usual ways including by editing the line at the top of the script action:
//osgi.getService('org.apache.karaf.log.core.LogService').setLevel(console.loggerName, 'INFO');
becomes
osgi.getService('org.apache.karaf.log.core.LogService').setLevel(console.loggerName, 'DEBUG');
That will change the logging level in the rule itself. Run the rule manually then comment the line out so it doesnāt try to change the level every time the rule runs. If a rule is triggered too quickly and it changes itās log level every time you run the risk of wiping out your log4j2.xml file.
Please post the debug logs. Also click on the code tab and post what you find under āconfigurationā. For example hereās mine.
configuration:
namespace: etod
timesOfDayGrp: TimesOfDay
timeOfDay: TimeOfDay
Alternatively you can look at scrpt action and post the properties. Hereās mine for example:
// Properties
var STATE_ITEM = "TimeOfDay";
var DT_GROUP = "TimesOfDay";
var DAY_TYPES = ['custom', 'holiday', 'dayset', 'weekend', 'weekday', 'default'];
var NAMESPACE = 'etod';