Read the statement by Michael Teeuw here.
MMM-OpenmapWeather sunrise and sunset times are GMT
-
MMM-OpenmapWeather sunrise and sunset times are GMT, not my PI timezone.
I have looked and can’t find where anyone else has logged this problem. The sunset and sunrise times displayed by MMM-OpenmapWeather are off by 5 hours. Since I’m in EST zone it appears to me to be displaying the GMT time. The sunrise and sunset times are correct when adjusted by 5 hours. I have two MagicMirror systems with the same problem. I have checked the time and timezone settings for the Pi and they are correct.I tried swapping out MMM-OpenmapWeather with the standard Weather module but the problem persists.
-
@rsiggins what time one is your system time set to?
-
@rsiggins
In my test, the module itself returns the right time of the target place converted to my local timezone. Anyway, there may be some special reason for your case.Of course, the developer should look inside to know what really happened. But as a emergency cure, you can use some monkey-patching before real fixation from the developer.
{ module: "MMM-ModuleMonkeyPatch", config: { patches: [ { module: "MMM-OpenmapWeather", method: "processWeather", patch: function (original, args) { const [ data ] = args const yourDesiredOffset = 5 * 60 * 60 // 5 hours data.sys.sunrise = new Date((data.sys.sunrise + yourDesiredOffset) * 1000).valueOf() data.sys.sunset = new Date((data.sys.sunset + yourDesiredOffset) * 1000).valueOf() original(data) } }, ] } }
-
@sdetweil The timezone is set to America/New York, which is the same as my local timezone. These settings appear to be correct.
-
@MMRIZE said in MMM-OpenmapWeather sunrise and sunset times are GMT:
patches: [
{
module: “MMM-OpenmapWeather”,
method: “processWeather”,
patch: function (original, args) {
const [ data ] = args
const yourDesiredOffset = 5 * 60 * 60 // 5 hours
data.sys.sunrise = new Date((data.sys.sunrise + yourDesiredOffset) * 1000).valueOf()
data.sys.sunset = new Date((data.sys.sunset + yourDesiredOffset) * 1000).valueOf()
original(data)
}
},
]
}
}Rather than trying the “Monkey Patch” I disabled the display of the sunrise/sunset times. There is an undocumented config varable called showSun. Set it to false and they don’t display. I never looked at these times. Easier to turn it off than fix.