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:
- Double checked all variable names and channels → didn’t find any issue
- Searched the forum → didn’t find any related issues
- Change forecastToday to forecastCurrent → no change
- 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" }