OpenWeatherMap - Sun and moon data both show moon data for forecastToday only

Hi everyone,
I’ve switched my OpenWeatherMap binding at the beginning of July over to API v3 and everything seemed to work just fine. I mainly used current weather, weather forecasts for today, tomorrow and in one week and especially the forecastToday sunset-vaule to turn on some decorative lights through a rule, triggering Zigbee plugs.

Problem:
Later I added forecast items for every day (forecastToday through forecastDay8) and added the moon information (moonrise, moonset, moonphase).
This works for every day except today: For today, sunrise is equal to moonrise and sunset is equal to moonset. Moon data is correct, so something is going on with the sun data for today.

Solutions I’ve tried:

  1. Double checked all variable names and channels → didn’t find any issue
  2. Searched the forum → didn’t find any related issues
  3. Change forecastToday to forecastCurrent → no change
  4. Comment out the moonrise and moonset items for forecastToday / forecastCurrent → sunset and sunrise are correct for a short while, after the next API call they turn back to moon data, eventhough moonrise and moonset items have been disabled for forecastToday.

Based on this, I guess there is something going wrong with separating sun and moon data for today, that works for the other days. Any ideas, on how to fix this or what could be causing this?

More details and code:
In the sitemap, this looks like this for today (left) (moon and sun are both “moon”) and for tomorrow (right) (everything is correct, same for other days):

Sitemap code for today:

Frame label="Sonnenaufgang und -untergang" {
    Text icon="pixel_perfect_weather_sunrise"       item=OWM_Local_Today_Sunrise                        label="Sonnenaufgang"
    Text icon="pixel_perfect_weather_sunset"        item=OWM_Local_Today_Sunset                         label="Sonnenuntergang"
}
Frame label="Mondaufgang und -untergang" {
    Text icon="pixel_perfect_weather_moonrise"      item=OWM_Local_Today_Moonrise                       label="Mondaufgang"
    Text icon="pixel_perfect_weather_moonset"       item=OWM_Local_Today_Moonset                        label="Monduntergang"
    Default icon="pixel_perfect_weather_half_moon"  item=OWM_Local_Today_Moonphase                      label="Mondphase"
}

Sitemap code for tomorrow:

Frame label="Sonnenaufgang und -untergang" {
    Text icon="pixel_perfect_weather_sunrise"       item=OWM_Local_Tomorrow_Sunrise                     label="Sonnenaufgang"
    Text icon="pixel_perfect_weather_sunset"        item=OWM_Local_Tomorrow_Sunset                      label="Sonnenuntergang"
}
Frame label="Mondaufgang und -untergang" {
    Text icon="pixel_perfect_weather_moonrise"      item=OWM_Local_Tomorrow_Moonrise                    label="Mondaufgang"
    Text icon="pixel_perfect_weather_moonset"       item=OWM_Local_Tomorrow_Moonset                     label="Monduntergang"
    Default icon="pixel_perfect_weather_half_moon"  item=OWM_Local_Tomorrow_Moonphase                   label="Mondphase"
}

My OpenWeatherMap binding looks like this:

// OpenWeatherMap Binding
Bridge openweathermap:weather-api:api "OpenWeatherMap - Account" [apikey="xxx", apiVersion=3.0, refreshInterval=10, language="de"] {
    Thing onecall local "OpenWeatherMap - Lokales Wetter und Vorhersage" [location="aa.bb,cc.dd", forecastHours=0, forecastDays=8]
}

My items for sun and moon data look like this (forecastToday):

    DateTime OWM_Local_Today_Sunrise "OWM - Vorhersage - Heute - Sonnenaufgang [%1$tH:%1$tM:%1$tS %1$td.%1$tm.%1$tY]" <time>  { channel="openweathermap:onecall:api:local:forecastToday#sunrise" }
    DateTime OWM_Local_Today_Sunset "OWM - Vorhersage - Heute - Sonnenuntergang [%1$tH:%1$tM:%1$tS %1$td.%1$tm.%1$tY]" <time>  { channel="openweathermap:onecall:api:local:forecastToday#sunset" }
    DateTime OWM_Local_Today_Moonrise "OWM - Vorhersage - Heute - Mondaufgang [%1$tH:%1$tM:%1$tS %1$td.%1$tm.%1$tY]" <time>  { channel="openweathermap:onecall:api:local:forecastToday#moonrise" }
    DateTime OWM_Local_Today_Moonset "OWM - Vorhersage - Heute - Monduntergang [%1$tH:%1$tM:%1$tS %1$td.%1$tm.%1$tY]" <time>  { channel="openweathermap:onecall:api:local:forecastToday#moonset" }
    Number:Dimensionless OWM_Local_Today_Moonphase "OWM - Vorhersage - Heute - Mondphase [%d %%]" { channel="openweathermap:onecall:api:local:forecastToday#moon-phase" }

I used the same syntax for the items of the other other days (forecastTomorrow, forecastDay2 … forecastDay8). Here an example for Tomorrow:

    DateTime OWM_Local_Tomorrow_Sunrise "OWM - Vorhersage - Morgen - Sonnenaufgang [%1$tH:%1$tM:%1$tS %1$td.%1$tm.%1$tY]" <time>  { channel="openweathermap:onecall:api:local:forecastTomorrow#sunrise" }
    DateTime OWM_Local_Tomorrow_Sunset "OWM - Vorhersage - Morgen - Sonnenuntergang [%1$tH:%1$tM:%1$tS %1$td.%1$tm.%1$tY]" <time>  { channel="openweathermap:onecall:api:local:forecastTomorrow#sunset" }
    DateTime OWM_Local_Tomorrow_Moonrise "OWM - Vorhersage - Morgen - Mondaufgang [%1$tH:%1$tM:%1$tS %1$td.%1$tm.%1$tY]" <time>  { channel="openweathermap:onecall:api:local:forecastTomorrow#moonrise" }
    DateTime OWM_Local_Tomorrow_Moonset "OWM - Vorhersage - Morgen - Monduntergang [%1$tH:%1$tM:%1$tS %1$td.%1$tm.%1$tY]" <time>  { channel="openweathermap:onecall:api:local:forecastTomorrow#moonset" }
    Number:Dimensionless OWM_Local_Tomorrow_Moonphase "OWM - Vorhersage - Morgen - Mondphase [%d %%]" { channel="openweathermap:onecall:api:local:forecastTomorrow#moon-phase" }

In case someone else is having the same issue, I’ve found a workaround with the Astro Binding:

  1. For sunrise/sunset/moonrise/moonset of today, I use Astro binding data
  2. For sunrise/sunset/moonrise/moonset of the next days, I use OWM binding data (Astro does not have forecast data)

This changes the rule to trigger the decorative lighting at the end of sunset:

// Turn on
rule "Lichtdekoration (Auto On)"
when 
    // When Astro sunset has ended
    Channel "astro:sun:local:set#event" triggered END
    or
    // When time 20:00:00 is reached
    Time cron "0 0 20 ? * * *"
then
    Zigbee_plug1_Switch.sendCommand(ON)
    Zigbee_plug2_Switch.sendCommand(ON)
end

// Turn off
rule "Lichtdekoration (Auto Off)"
when 
    // When time 22:00:00 is reached on work nights
    Time cron "0 0 22 ? * SUN,MON,TUE,WED,THU *"
    or
    // When time 23:59:59 is reached on weekend nights
    Time cron "59 59 23 ? * FRI,SAT *"
then
    Zigbee_plug1_Switch.sendCommand(OFF)
    Zigbee_plug2_Switch.sendCommand(OFF)
end

Astro.things

// Astro Binding
astro:sun:local [ geolocation="xx.xxxxxxx,y.yyyyyyy,zzz", interval=3600 ] {
    Channels:
        Type rangeEvent : set#event
}
astro:moon:local [ geolocation="xx.xxxxxxx,y.yyyyyyy", interval=3600 ]

Astro.items

// Astro Binding
 // Sun
 DateTime Astro_Local_Sunrise_Start  "Sonnenaufgang Beginn [%1$tH:%1$tM %1$td.%1$tm.%1$tY]" { channel="astro:sun:local:rise#start" }
 DateTime Astro_Local_Sunrise_End    "Sonnenaufgang Ende [%1$tH:%1$tM %1$td.%1$tm.%1$tY]" { channel="astro:sun:local:rise#end" }
 DateTime Astro_Local_Sunset_Start   "Sonnenuntergang [%1$tH:%1$tM %1$td.%1$tm.%1$tY]" { channel="astro:sun:local:set#start" }
 DateTime Astro_Local_Sunset_End     "Sonnenuntergang [%1$tH:%1$tM %1$td.%1$tm.%1$>]" { channel="astro:sun:local:set#end" }

 // Moon
 DateTime Astro_Local_Moonrise_Start "Mondaufgang Beginn [%1$tH:%1$tM %1$td.%1$tm.%1$tY]" { channel="astro:moon:local:rise#start" }
 DateTime Astro_Local_Moonrise_End   "Mondaufgang Ende [%1$tH:%1$tM %1$td.%1$tm.%1$tY]" { channel="astro:moon:local:rise#end" }
 DateTime Astro_Local_Moonset_Start  "Monduntergang Beginn [%1$tH:%1$tM %1$td.%1$tm.%1$tY]" { channel="astro:moon:local:set#start" }
 DateTime Astro_Local_Moonset_End    "Monduntergang Ende [%1$tH:%1$tM %1$td.%1$tm.%1$tY]" { channel="astro:moon:local:set#end" }
 String   Astro_Local_Moon_Phase     "Mondphase" { channel="astro:moon:local:phase#name" }

And in the sitemap, now it’s mixed OWM and Astro data

// Today
Frame label="Sonnenaufgang und -untergang" {
    Text item=Astro_Local_Sunrise_Start  label="Sonnenaufgang"
    Text item=Astro_Local_Sunset_Start   label="Sonnenuntergang"
}
Frame label="Mondaufgang und -untergang" {
    Text item=Astro_Local_Moonrise_Start  label="Mondaufgang"
    Text item=Astro_Local_Moonset_End     label="Monduntergang"
    Default item=Astro_Local_Moon_Phase   label="Mondphase"
}

// [...]

// In 2 days
Frame label="Sonnenaufgang und -untergang" {
    Text item=OWM_Local_Forecast_Day_2_Sunrise      label="Sonnenaufgang"
    Text item=OWM_Local_Forecast_Day_2_Sunset       label="Sonnenuntergang"
}
Frame label="Mondaufgang und -untergang" {
    Text  item=OWM_Local_Forecast_Day_2_Moonrise    label="Mondaufgang"
    Text  item=OWM_Local_Forecast_Day_2_Moonset     label="Monduntergang"
    Default item=OWM_Local_Forecast_Day_2_Moonphase label="Mondphase"
}