Hello all,
I am swItching to Openhab2, and trying to set up the new Astro binding. And I’m having problems with earliest/latest and offset channel features.
I want to have two DateTime items - Civil_Dawn_End_Offset_Time and Civil_Dusk_Start_Offset_Time, which will store the following:
-
Civil_Dawn_End_Offset_Time - Civil Dawn end time, but moved forward by 180 minutes (offset), and having earliest time limit of 10:00;
-
Civil_Dusk_Start_Offset_Time - Civil Dusk start time, but having latest time limit of 19:00
I didn’t find out how to do it via PaperUI, because there is no way to configure earliest/latest for Start/End time, so I switched to text-based configuration. I’ve created an “astro.things” file in “/etc/openhab2/things” directory with the following content (following examples in Documentation):
astro:sun:localoffset [ geolocation="55.677585,37.630706", interval=60 ] {
Channels:
Type start : civilDusk#start [
latest="19:00"
]
Type end : civilDawn#end [
offset=180,
earliest="10:00"
]
}
and linked my two items in the “home.items” file with these channels:
DateTime Civil_Dawn_End_Offset_Time "Civil Dawn End Offset Time [%1$tH:%1$tM]" (Home) {channel="astro:sun:localoffset:civilDawn#end"}
DateTime Civil_Dusk_Start_Offset_Time "Civil Dusk Start Offset Time [%1$tH:%1$tM]" (Home) {channel="astro:sun:localoffset:civilDusk#start"}
The real Civil Dawn end time and Civil Dusk start time in my location are 04:39 and 20:16 respectively, so I’m expecting my items to have values “10:00” (as 04:39 + 180 mins = 07:39 is earlier than 10:00), and “19:00” (as 20:16 is later than 19:00) respectively, but in fact my items are getting values 04:39 and 20:16, so neither offset nor earliest/latest is applied. Moreover, item Civil_Dawn_End_Offset_Time has somehow duplicated, but with another label (“End Time”), despite I haven’t created any items in UI, and don’t have such an item in any of my “.items” files:
openhab> smarthome:items list *Offset*
Civil_Dawn_End_Offset_Time (Type=DateTimeItem, State=2017-05-05T04:39:00.000+0300, Label=Civil Dawn End Offset Time, Category=null, Groups=[Home])
Civil_Dusk_Start_Offset_Time (Type=DateTimeItem, State=2017-05-05T20:16:00.000+0300, Label=Civil Dusk Start Offset Time, Category=null, Groups=[Home])
Civil_Dawn_End_Offset_Time (Type=DateTimeItem, State=2017-05-05T04:39:00.000+0300, Label=End time, Category=null)
The same is in UI:
What am I doing wrong, and how can I achieve my goal?