openhab-scripters / openhab-helper-libraries

Scripts and modules for use with openHAB
Eclipse Public License 1.0
88 stars 70 forks source link

Fixed bug if Timestamp state is NULL #75

Closed fastlorenzo closed 5 years ago

fastlorenzo commented 5 years ago

Added a check to skip the Forecast update if Forecast_Timestamp state is NULL Was breaking after iteration 35 for me (Forecast_Timestamp_108 and more has NULL state)

5iver commented 5 years ago

None of the Items should be NULL, unless OH has restarted and persistence is not being used, or the Items were just created. I haven't had this happen, but seems to be due to slower hardware, and the binding taking longer to update the Items than it takes for the script to run. I think your solution could foul things up later in the script... I need to take a better look at it. But could you try changing the trigger to this...

@when("Item Forecast_Timestamp_120 changed")

If the binding updates the Items in order, this might ensure that all timestamp Items have been updated before the rule triggers. A sleep could also do the trick.

fastlorenzo commented 5 years ago

Well, its more than concurrency issue, looks like the Forecast_Timestamp[108-120] are still NULL after some hours:

openhab> smarthome:items list | grep Timestamp | sort
Current_Timestamp (Type=DateTimeItem, State=2019-01-23T04:50:00.000+0100, Label=Current: Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gCurrent, gForecast_Timestamp_1])
Forecast_Timestamp_03 (Type=DateTimeItem, State=2019-01-23T07:00:00.000+0100, Label=Forecast (7:00am): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_1, gForecast_Timestamp_2])
Forecast_Timestamp_06 (Type=DateTimeItem, State=2019-01-23T10:00:00.000+0100, Label=Forecast (10:00am): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_1, gForecast_Timestamp_2])
Forecast_Timestamp_09 (Type=DateTimeItem, State=2019-01-23T13:00:00.000+0100, Label=Forecast (1:00pm): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_1, gForecast_Timestamp_2])
Forecast_Timestamp_102 (Type=DateTimeItem, State=2019-01-26T19:00:00.000+0100, Label=Forecast (7:00pm): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_5, gForecast_Timestamp_4])
Forecast_Timestamp_105 (Type=DateTimeItem, State=2019-01-26T22:00:00.000+0100, Label=Forecast (10:00pm): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_5, gForecast_Timestamp_4])
Forecast_Timestamp_108 (Type=DateTimeItem, State=NULL, Label=Forecast (108): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap])
Forecast_Timestamp_111 (Type=DateTimeItem, State=NULL, Label=Forecast (111): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap])
Forecast_Timestamp_114 (Type=DateTimeItem, State=NULL, Label=Forecast (114): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap])
Forecast_Timestamp_117 (Type=DateTimeItem, State=NULL, Label=Forecast (117): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap])
Forecast_Timestamp_12 (Type=DateTimeItem, State=2019-01-23T16:00:00.000+0100, Label=Forecast (4:00pm): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_2, gForecast_Timestamp_1])
Forecast_Timestamp_120 (Type=DateTimeItem, State=NULL, Label=Forecast (120): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap])
Forecast_Timestamp_15 (Type=DateTimeItem, State=2019-01-23T19:00:00.000+0100, Label=Forecast (7:00pm): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_2, gForecast_Timestamp_1])
Forecast_Timestamp_18 (Type=DateTimeItem, State=2019-01-23T22:00:00.000+0100, Label=Forecast (10:00pm): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_2, gForecast_Timestamp_1])
Forecast_Timestamp_21 (Type=DateTimeItem, State=2019-01-24T01:00:00.000+0100, Label=Forecast (1:00am): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_2, gForecast_Timestamp_1])
Forecast_Timestamp_24 (Type=DateTimeItem, State=2019-01-24T04:00:00.000+0100, Label=Forecast (4:00am): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_2, gForecast_Timestamp_1])
Forecast_Timestamp_27 (Type=DateTimeItem, State=2019-01-23T16:00:00.000+0100, Label=Forecast (4:00pm): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_2, gForecast_Timestamp_1, gForecast_Timestamp_3])
Forecast_Timestamp_30 (Type=DateTimeItem, State=2019-01-23T19:00:00.000+0100, Label=Forecast (7:00pm): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_2, gForecast_Timestamp_1, gForecast_Timestamp_4])
Forecast_Timestamp_33 (Type=DateTimeItem, State=2019-01-23T22:00:00.000+0100, Label=Forecast (10:00pm): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_2, gForecast_Timestamp_1, gForecast_Timestamp_5])
Forecast_Timestamp_36 (Type=DateTimeItem, State=2019-01-24T01:00:00.000+0100, Label=Forecast (1:00am): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_3, gForecast_Timestamp_2])
Forecast_Timestamp_39 (Type=DateTimeItem, State=2019-01-24T04:00:00.000+0100, Label=Forecast (4:00am): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_3, gForecast_Timestamp_2])
Forecast_Timestamp_42 (Type=DateTimeItem, State=2019-01-24T07:00:00.000+0100, Label=Forecast (7:00am): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_3, gForecast_Timestamp_2])
Forecast_Timestamp_45 (Type=DateTimeItem, State=2019-01-24T10:00:00.000+0100, Label=Forecast (10:00am): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_3, gForecast_Timestamp_2])
Forecast_Timestamp_48 (Type=DateTimeItem, State=2019-01-24T13:00:00.000+0100, Label=Forecast (1:00pm): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_3, gForecast_Timestamp_2])
Forecast_Timestamp_51 (Type=DateTimeItem, State=2019-01-24T16:00:00.000+0100, Label=Forecast (4:00pm): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_3, gForecast_Timestamp_2])
Forecast_Timestamp_54 (Type=DateTimeItem, State=2019-01-24T19:00:00.000+0100, Label=Forecast (7:00pm): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_3, gForecast_Timestamp_2])
Forecast_Timestamp_57 (Type=DateTimeItem, State=2019-01-24T22:00:00.000+0100, Label=Forecast (10:00pm): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_3, gForecast_Timestamp_2])
Forecast_Timestamp_60 (Type=DateTimeItem, State=2019-01-25T01:00:00.000+0100, Label=Forecast (1:00am): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_4, gForecast_Timestamp_3])
Forecast_Timestamp_63 (Type=DateTimeItem, State=2019-01-25T04:00:00.000+0100, Label=Forecast (4:00am): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_4, gForecast_Timestamp_3])
Forecast_Timestamp_66 (Type=DateTimeItem, State=2019-01-25T07:00:00.000+0100, Label=Forecast (7:00am): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_4, gForecast_Timestamp_3])
Forecast_Timestamp_69 (Type=DateTimeItem, State=2019-01-25T10:00:00.000+0100, Label=Forecast (10:00am): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_4, gForecast_Timestamp_3])
Forecast_Timestamp_72 (Type=DateTimeItem, State=2019-01-25T13:00:00.000+0100, Label=Forecast (1:00pm): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_4, gForecast_Timestamp_3])
Forecast_Timestamp_75 (Type=DateTimeItem, State=2019-01-25T16:00:00.000+0100, Label=Forecast (4:00pm): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_4, gForecast_Timestamp_3])
Forecast_Timestamp_78 (Type=DateTimeItem, State=2019-01-25T19:00:00.000+0100, Label=Forecast (7:00pm): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_4, gForecast_Timestamp_3])
Forecast_Timestamp_81 (Type=DateTimeItem, State=2019-01-25T22:00:00.000+0100, Label=Forecast (10:00pm): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_4, gForecast_Timestamp_3])
Forecast_Timestamp_84 (Type=DateTimeItem, State=2019-01-26T01:00:00.000+0100, Label=Forecast (1:00am): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_5, gForecast_Timestamp_4])
Forecast_Timestamp_87 (Type=DateTimeItem, State=2019-01-26T04:00:00.000+0100, Label=Forecast (4:00am): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_5, gForecast_Timestamp_4])
Forecast_Timestamp_90 (Type=DateTimeItem, State=2019-01-26T07:00:00.000+0100, Label=Forecast (7:00am): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_5, gForecast_Timestamp_4])
Forecast_Timestamp_93 (Type=DateTimeItem, State=2019-01-26T10:00:00.000+0100, Label=Forecast (10:00am): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_5, gForecast_Timestamp_4])
Forecast_Timestamp_96 (Type=DateTimeItem, State=2019-01-26T13:00:00.000+0100, Label=Forecast (1:00pm): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_5, gForecast_Timestamp_4])
Forecast_Timestamp_99 (Type=DateTimeItem, State=2019-01-26T16:00:00.000+0100, Label=Forecast (4:00pm): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_5, gForecast_Timestamp_4])
gForecast_Timestamp_1 (Type=GroupItem, Members=7, State=NULL, Label=Today: Timestamp, Category=null)
gForecast_Timestamp_2 (Type=GroupItem, Members=2, State=NULL, Label=Thursday: Timestamp, Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_2])
gForecast_Timestamp_3 (Type=GroupItem, Members=1, State=NULL, Label=Friday: Timestamp, Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_3])
gForecast_Timestamp_4 (Type=GroupItem, Members=1, State=NULL, Label=Saturday: Timestamp, Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_4])
gForecast_Timestamp_5 (Type=GroupItem, Members=1, State=NULL, Label=Sunday: Timestamp, Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_5])

Might be that no forecast for that period is provided for the location I chose, what do you think?

5iver commented 5 years ago

Might be that no forecast for that period is provided for the location I chose, what do you think?

I'm not familiar with OWM enough to know if that is possible. I would have guessed that all areas have all of the forecasts. First thing I'd do is confirm that the Thing is configured for 120 hours and 0 days.

Another thought... the links may not be setup properly. If you were using an earlier version of the script, but didn't clear out the Items, this might explain it. You could confirm in Paper UI, and check the Channels to make sure they are linked (blue circle will have a dot in the center). To fix, uncomment the removeOWMItems() line and comment out the addOWMItems() line, and save. Then confirm in Karaf that your Items are actually removed. In early versions of the script, I recall something similar happening, but implementing the tag helped to sort it out. If you still have Items left, you can use the commented out lines in removeOWMItems, just make sure it isn't removing any of your other Items.

Karaf commands to verify OWM Items have been removed...

openhab> smarthome:items list |grep gForecast | wc -l
     654    654
openhab> smarthome:items list |grep OpenWeatherMap | wc -l                                                                                                                                                
     656    656

The second one confirms that they all have the OpenWeatherMap tag. There are two additional with tags... gOpenWeatherMap and gCurrent.

5iver commented 5 years ago

Is this working for you now, so that we can close this?

fastlorenzo commented 5 years ago

Sorry, forgot to check that one. Here is the output:


openhab> smarthome:items list |grep gForecast | wc -l
     584    584
openhab> smarthome:items list |grep OpenWeatherMap | wc -l
     655    655

I still have the NULL issue with the Timestamp:

openhab> smarthome:items list | grep Timestamp | sort
Current_Timestamp (Type=DateTimeItem, State=2019-01-29T19:20:00.000+0100, Label=Current: Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gCurrent, gForecast_Timestamp_1])
Forecast_Timestamp_03 (Type=DateTimeItem, State=2019-01-29T22:00:00.000+0100, Label=Forecast (10:00pm): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_1, gForecast_Timestamp_2])
Forecast_Timestamp_06 (Type=DateTimeItem, State=2019-01-30T01:00:00.000+0100, Label=Forecast (1:00am): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_1, gForecast_Timestamp_2])
Forecast_Timestamp_09 (Type=DateTimeItem, State=2019-01-30T04:00:00.000+0100, Label=Forecast (4:00am): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_1, gForecast_Timestamp_2])
Forecast_Timestamp_102 (Type=DateTimeItem, State=2019-01-26T19:00:00.000+0100, Label=Forecast (7:00pm): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_5, gForecast_Timestamp_4])
Forecast_Timestamp_105 (Type=DateTimeItem, State=2019-01-26T22:00:00.000+0100, Label=Forecast (10:00pm): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_5, gForecast_Timestamp_4])
Forecast_Timestamp_108 (Type=DateTimeItem, State=NULL, Label=Forecast (108): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap])
Forecast_Timestamp_111 (Type=DateTimeItem, State=NULL, Label=Forecast (111): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap])
Forecast_Timestamp_114 (Type=DateTimeItem, State=NULL, Label=Forecast (114): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap])
Forecast_Timestamp_117 (Type=DateTimeItem, State=NULL, Label=Forecast (117): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap])
Forecast_Timestamp_12 (Type=DateTimeItem, State=2019-01-30T07:00:00.000+0100, Label=Forecast (7:00am): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_2, gForecast_Timestamp_1])
Forecast_Timestamp_120 (Type=DateTimeItem, State=NULL, Label=Forecast (120): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap])
Forecast_Timestamp_15 (Type=DateTimeItem, State=2019-01-30T10:00:00.000+0100, Label=Forecast (10:00am): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_2, gForecast_Timestamp_1])
Forecast_Timestamp_18 (Type=DateTimeItem, State=2019-01-30T13:00:00.000+0100, Label=Forecast (1:00pm): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_2, gForecast_Timestamp_1])
Forecast_Timestamp_21 (Type=DateTimeItem, State=2019-01-30T16:00:00.000+0100, Label=Forecast (4:00pm): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_2, gForecast_Timestamp_1])
Forecast_Timestamp_24 (Type=DateTimeItem, State=2019-01-30T19:00:00.000+0100, Label=Forecast (7:00pm): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_2, gForecast_Timestamp_1])
Forecast_Timestamp_27 (Type=DateTimeItem, State=2019-01-23T16:00:00.000+0100, Label=Forecast (4:00pm): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_2, gForecast_Timestamp_1, gForecast_Timestamp_3])
Forecast_Timestamp_30 (Type=DateTimeItem, State=2019-01-23T19:00:00.000+0100, Label=Forecast (7:00pm): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_2, gForecast_Timestamp_1, gForecast_Timestamp_4, gForecast_Timestamp_3])
Forecast_Timestamp_33 (Type=DateTimeItem, State=2019-01-23T22:00:00.000+0100, Label=Forecast (10:00pm): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_2, gForecast_Timestamp_1, gForecast_Timestamp_5, gForecast_Timestamp_4, gForecast_Timestamp_3])
Forecast_Timestamp_36 (Type=DateTimeItem, State=2019-01-24T01:00:00.000+0100, Label=Forecast (1:00am): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_3, gForecast_Timestamp_2, gForecast_Timestamp_5, gForecast_Timestamp_4])
Forecast_Timestamp_39 (Type=DateTimeItem, State=2019-01-24T04:00:00.000+0100, Label=Forecast (4:00am): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_3, gForecast_Timestamp_2, gForecast_Timestamp_5, gForecast_Timestamp_4])
Forecast_Timestamp_42 (Type=DateTimeItem, State=2019-01-24T07:00:00.000+0100, Label=Forecast (7:00am): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_3, gForecast_Timestamp_2, gForecast_Timestamp_5, gForecast_Timestamp_4])
Forecast_Timestamp_45 (Type=DateTimeItem, State=2019-01-24T10:00:00.000+0100, Label=Forecast (10:00am): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_3, gForecast_Timestamp_2, gForecast_Timestamp_5, gForecast_Timestamp_4])
Forecast_Timestamp_48 (Type=DateTimeItem, State=2019-01-24T13:00:00.000+0100, Label=Forecast (1:00pm): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_3, gForecast_Timestamp_2, gForecast_Timestamp_5, gForecast_Timestamp_4])
Forecast_Timestamp_51 (Type=DateTimeItem, State=2019-01-24T16:00:00.000+0100, Label=Forecast (4:00pm): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_3, gForecast_Timestamp_2, gForecast_Timestamp_5, gForecast_Timestamp_4])
Forecast_Timestamp_54 (Type=DateTimeItem, State=2019-01-24T19:00:00.000+0100, Label=Forecast (7:00pm): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_3, gForecast_Timestamp_2, gForecast_Timestamp_5, gForecast_Timestamp_4])
Forecast_Timestamp_57 (Type=DateTimeItem, State=2019-01-24T22:00:00.000+0100, Label=Forecast (10:00pm): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_3, gForecast_Timestamp_2, gForecast_Timestamp_5, gForecast_Timestamp_4])
Forecast_Timestamp_60 (Type=DateTimeItem, State=2019-01-25T01:00:00.000+0100, Label=Forecast (1:00am): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_4, gForecast_Timestamp_3, gForecast_Timestamp_5])
Forecast_Timestamp_63 (Type=DateTimeItem, State=2019-01-25T04:00:00.000+0100, Label=Forecast (4:00am): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_4, gForecast_Timestamp_3, gForecast_Timestamp_5])
Forecast_Timestamp_66 (Type=DateTimeItem, State=2019-01-25T07:00:00.000+0100, Label=Forecast (7:00am): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_4, gForecast_Timestamp_3, gForecast_Timestamp_5])
Forecast_Timestamp_69 (Type=DateTimeItem, State=2019-01-25T10:00:00.000+0100, Label=Forecast (10:00am): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_4, gForecast_Timestamp_3, gForecast_Timestamp_5])
Forecast_Timestamp_72 (Type=DateTimeItem, State=2019-01-25T13:00:00.000+0100, Label=Forecast (1:00pm): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_4, gForecast_Timestamp_3, gForecast_Timestamp_5])
Forecast_Timestamp_75 (Type=DateTimeItem, State=2019-01-25T16:00:00.000+0100, Label=Forecast (4:00pm): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_4, gForecast_Timestamp_3, gForecast_Timestamp_5])
Forecast_Timestamp_78 (Type=DateTimeItem, State=2019-01-25T19:00:00.000+0100, Label=Forecast (7:00pm): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_4, gForecast_Timestamp_3, gForecast_Timestamp_5])
Forecast_Timestamp_81 (Type=DateTimeItem, State=2019-01-25T22:00:00.000+0100, Label=Forecast (10:00pm): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_4, gForecast_Timestamp_3, gForecast_Timestamp_5])
Forecast_Timestamp_84 (Type=DateTimeItem, State=2019-01-26T01:00:00.000+0100, Label=Forecast (1:00am): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_5, gForecast_Timestamp_4])
Forecast_Timestamp_87 (Type=DateTimeItem, State=2019-01-26T04:00:00.000+0100, Label=Forecast (4:00am): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_5, gForecast_Timestamp_4])
Forecast_Timestamp_90 (Type=DateTimeItem, State=2019-01-26T07:00:00.000+0100, Label=Forecast (7:00am): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_5, gForecast_Timestamp_4])
Forecast_Timestamp_93 (Type=DateTimeItem, State=2019-01-26T10:00:00.000+0100, Label=Forecast (10:00am): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_5, gForecast_Timestamp_4])
Forecast_Timestamp_96 (Type=DateTimeItem, State=2019-01-26T13:00:00.000+0100, Label=Forecast (1:00pm): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_5, gForecast_Timestamp_4])
Forecast_Timestamp_99 (Type=DateTimeItem, State=2019-01-26T16:00:00.000+0100, Label=Forecast (4:00pm): Timestamp [%1$tY-%1$tm-%1$td %1$tI:%1$tM%1$tp], Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_Timestamp_5, gForecast_Timestamp_4])
gForecast_Timestamp_1 (Type=GroupItem, Members=2, State=NULL, Label=Today: Timestamp, Category=null)
gForecast_Timestamp_2 (Type=GroupItem, Members=10, State=NULL, Label=Wednesday: Timestamp, Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_2])
gForecast_Timestamp_3 (Type=GroupItem, Members=8, State=NULL, Label=Thursday: Timestamp, Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_3])
gForecast_Timestamp_4 (Type=GroupItem, Members=8, State=NULL, Label=Friday: Timestamp, Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_4])
gForecast_Timestamp_5 (Type=GroupItem, Members=8, State=NULL, Label=Saturday: Timestamp, Category=Time, Tags=[OpenWeatherMap], Groups=[gForecast_5])

I'll try to have a look at it this weekend to see what's the issue there.

I'm not familiar with OWM enough to know if that is possible. I would have guessed that all areas have all of the forecasts. First thing I'd do is confirm that the Thing is configured for 120 hours and 0 days.

Confirmed:

Bridge openweathermap:weather-api:api "OpenWeatherMap Account" [apikey="xxxxxxxxxxxxxxxxxxxxx", refreshInterval=30] {
    Thing weather-and-forecast local "Local" [location="xx.xx,x.xx", forecastHours=120, forecastDays=0]
}

Another thought... the links may not be setup properly. If you were using an earlier version of the script, but didn't clear out the Items, this might explain it. You could confirm in Paper UI, and check the Channels to make sure they are linked (blue circle will have a dot in the center). To fix, uncomment the removeOWMItems() line and comment out the addOWMItems() line, and save. Then confirm in Karaf that your Items are actually removed. In early versions of the script, I recall something similar happening, but implementing the tag helped to sort it out. If you still have Items left, you can use the commented out lines in removeOWMItems, just make sure it isn't removing any of your other Items.

I didn't use an earlier version, it's the first time I used it. I'll maybe try to remove / add everything again to be sure.

5iver commented 5 years ago

@fastlorenzo, any update, or shoudl we close this?

5iver commented 5 years ago

I'm going to asume everything is OK. This can be reopened if you still have issues.