Ephemeris ToD: init problem

Hardware: RPi 3
OS: Raspbian GNU/Linux 8 (jessie)
JRE: OpenJDK Runtime Environment (Zulu (build 1.8.0_181-b122)
OH: 2.5.6 (Build)

I’m in the process of migrating my rules to jython and the NGRE. Good, if slow (a function of my available time, rusty programming skills and learning python at thr same time), progress being made.

I’m at the point where I’m moving over to the ToD rules provided here: https://github.com/rkoshak/openhab-rules-tools

The current problem I’m having is working our why it’s not working - TimeOfDay gets set to Dawn, but then I get the following error:

2020-07-31 00:02:03.918 [WARN ] [jsr223.jython.Ephemeris Time of Day ] - The following Items are are NULL: [u'Default_Night'] kicking off initialization
2020-08-02 11:24:58.734 [INFO ] [jsr223.jython.Ephemeris Time of Day ] - Today is a weekend day, there are 3 time periods today.
2020-08-02 11:24:58.764 [WARN ] [jsr223.jython.Ephemeris Time of Day ] - The following Items are are NULL: [u'Weekend_Day', u'Weekend_Morning', u'Weekend_Night'] kicking off initialization
2020-08-02 11:24:58.767 [WARN ] [internal.defaultscope.ScriptBusEvent] - Item 'InitItems' does not exist.
2020-08-02 11:25:03.791 [ERROR] [jsr223.jython.Ephemeris Time of Day ] - There are still etod Items that are NULL, cancelling

btw: my log files are full of the output for the get-key-value and get-metadata for what looks like every single item defined - is that correct?



DateTime Default_Dawn       { channel="astro:sun:local:civilDawn#start", etod="DAWN"[type="default"] }
DateTime Default_Morning    { channel="astro:sun:local:rise#start", etod="MORNING"[type="default"] }
DateTime Default_Day        { channel="astro:sun:local:rise#end", etod="DAY"[type="default"] }
DateTime Default_Dusk       { channel="astro:sun:local:civilDusk#start", etod="DUSK"[type="default"] }
DateTime Default_Evening    { channel="astro:sun:local:set#start", etod="EVENING"[type="default"] }
DateTime Default_Night      { init="22:10:00", etod="NIGHT"[type="default"] }

DateTime Weekend_Morning    { init="07:30:00", etod="MORNING"[type="weekend"] }
DateTime Weekend_Day        { channel="astro:sun:set120:set#start", etod="DAY"[type="weekend"] }
DateTime Weekend_Night      { init="22:45:00", etod="NIGHT"[type="weekend"] }


org.openhab.ephemeris:dayset-weekend = [SATURDAY,SUNDAY]
org.openhab.ephemeris:dayset-school = [MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY]

console output:

openhab> smarthome:items list | grep Default_
Default_Morning (Type=DateTimeItem, State=2020-08-02T05:20:00.000+0100, Label=null, Category=null)
Default_Night (Type=DateTimeItem, State=NULL, Label=null, Category=null)
Default_Dusk (Type=DateTimeItem, State=2020-08-02T19:46:00.000+0100, Label=null, Category=null)
Default_Day (Type=DateTimeItem, State=2020-08-02T09:00:00.000+0100, Label=null, Category=null)
Default_Dawn (Type=DateTimeItem, State=2020-08-02T04:39:00.000+0100, Label=null, Category=null)
Default_Evening (Type=DateTimeItem, State=2020-08-02T20:42:00.000+0100, Label=null, Category=null)

openhab> smarthome:items list | grep Weekend_
Weekend_Day (Type=DateTimeItem, State=NULL, Label=null, Category=null)
Weekend_Night (Type=DateTimeItem, State=NULL, Label=null, Category=null)
Weekend_Morning (Type=DateTimeItem, State=NULL, Label=null, Category=null)

openhab> smarthome:items list | grep TimeOfDay
TimeOfDay (Type=StringItem, State=DAWN, Label=null, Category=null)

Solved with a fresh look - hadn’t installed the item_init script!

If there is anything I can add or change in the READMEs to make it more clear that there are dependencies between the libraries I’m open to suggestions.

I’m glad you go it working!

I might add a note that if you see the warning “Item ‘InitItems’ does not exist.” that likely means that init_items is not installed.

Thanks @rlkoshak, Not sure how I missed it, when I took a look this morning, is was obvious. I wonder if I saw the optional bit and didn’t copy it over.

I’ll report back as I get myself more acquainted with the NGRE and Python; everything I’ve seen so far with the openhab-rules-tools has been excellently documented!


Well, seeing the error you saw that means that it really isn’t optional after all. I need to add some error checking and or better logging about that. I try very hard to make meaningful and actionable error and warning logs and the above doesn’t fit that bill.