Weather Module not loading since MM update
Hi all,
i did the MM Update few days ago (Notifikation in the bottom bar) via git pull. Until the Update everything worked fine, but since the Update was done, the Weather Module is not loading any more. All other modules are fine after the update. I dont see anything in the logs. Would be great if someone could help me figuring out whats going on.
System: Raspi Zero 2W with PoE LAN Hat Node: v22.9.0 OS: Debian 12 Bookworm latest update/upgrade Electron: v32.1.2 MagicMirror Version: 2.29.0
Weather Module API is OpenWeather Map API Key is valid and checked.
Config-Part of Weather:
{
module: "weather",
position: "bottom_right",
header: "Wetter Vorhersage",
config: {
weatherProvider: "openweathermap",
type: "forecast",
maxNumberOfDays: 5,
locationID: "2831948", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
apiKey: "*****CENSORED*******",
weatherEndpoint: "/forecast",
tableClass: 'medium',
colored: 'true',
fade: true,
fadePoint: 0.5,
}
Log output if restarting MM:
0|mm | [2024-10-02 12:37:42.326] [LOG] Starting MagicMirror: v2.29.0 0|mm | [2024-10-02 12:37:42.427] [LOG] Loading config ... 0|mm | [2024-10-02 12:37:42.436] [LOG] config template file not exists, no envsubst 0|mm | [2024-10-02 12:37:43.863] [INFO] Checking config file /home/pi/MagicMirror/config/config.js ... 0|mm | [2024-10-02 12:37:44.087] [INFO] Your configuration file doesn't contain syntax errors :) 0|mm | [2024-10-02 12:37:44.090] [INFO] Checking modules structure configuration ... 0|mm | [2024-10-02 12:37:44.205] [INFO] Your modules structure configuration doesn't contain errors :) 0|mm | [2024-10-02 12:37:44.212] [LOG] Loading module helpers ... 0|mm | [2024-10-02 12:37:44.218] [LOG] No helper found for module: alert. 0|mm | [2024-10-02 12:37:44.240] [LOG] Initializing new module helper ... 0|mm | [2024-10-02 12:37:44.242] [LOG] Module helper loaded: updatenotification 0|mm | [2024-10-02 12:37:44.245] [LOG] No helper found for module: clock. 0|mm | [2024-10-02 12:37:44.701] [LOG] Initializing new module helper ... 0|mm | [2024-10-02 12:37:44.706] [LOG] Module helper loaded: calendar 0|mm | [2024-10-02 12:37:44.717] [LOG] No helper found for module: MMM-AutoDimmer. 0|mm | [2024-10-02 12:37:44.723] [LOG] No helper found for module: weather. 0|mm | [2024-10-02 12:37:44.741] [LOG] Initializing new module helper ... 0|mm | [2024-10-02 12:37:44.742] [LOG] Module helper loaded: netatmo 0|mm | [2024-10-02 12:37:44.743] [LOG] All module helpers loaded. 0|mm | [2024-10-02 12:37:44.764] [LOG] Starting server on port 8080 ... 0|mm | [2024-10-02 12:37:56.138] [LOG] Server started ... 0|mm | [2024-10-02 12:37:56.163] [LOG] Connecting socket for: updatenotification 0|mm | [2024-10-02 12:37:56.165] [LOG] Starting module helper: updatenotification 0|mm | [2024-10-02 12:37:56.166] [LOG] Connecting socket for: calendar 0|mm | [2024-10-02 12:37:56.168] [LOG] Starting node helper for: calendar 0|mm | [2024-10-02 12:37:56.169] [LOG] Connecting socket for: netatmo 0|mm | [2024-10-02 12:37:56.170] [LOG] Netatmo helper started ... 0|mm | [2024-10-02 12:37:56.172] [LOG] Sockets connected & modules started ... 0|mm | [2024-10-02 12:37:58.210] [LOG] Launching application. 0|mm | [2024-10-02 12:38:09.296] [INFO] System information: 0|mm | ### SYSTEM: manufacturer: Raspberry Pi Foundation; model: Raspberry Pi Zero 2 W Rev 1.0; virtual: false 0|mm | ### OS: platform: linux; distro: Raspbian GNU/Linux; release: 12; arch: arm; kernel: 6.6.51+rpt-rpi-v7 0|mm | ### VERSIONS: electron: 29.1.6; used node: 20.9.0; installed node: 22.9.0; npm: 10.8.3; pm2: 5.3.1 0|mm | ### OTHER: timeZone: Europe/Berlin; ELECTRON_ENABLE_GPU: undefined 0|mm | [2024-10-02 12:38:18.041] [ERROR] Netatmo: clientId not set in config. 0|mm | [2024-10-02 12:38:18.116] [LOG] Create new calendarfetcher for url: http://p71-caldav.icloud.com/published/2/MjA0MDUwMTIxMjA.....CENSORED - Interval: 604800000 0|mm | [2024-10-02 12:38:18.786] [LOG] Netatmo: using token.json file 0|mm | [2024-10-02 12:38:18.794] [LOG] Netatmo: Initialized 0|mm | [2024-10-02 12:38:18.847] [INFO] updatenotification: Updater Class Loaded! 0|mm | [2024-10-02 12:38:18.848] [INFO] updatenotification: Checking PM2 using... 0|mm | [2024-10-02 12:38:21.265] [INFO] Checking git for module: MMM-AutoDimmer 0|mm | [2024-10-02 12:38:21.642] [INFO] Checking git for module: netatmo 0|mm | [2024-10-02 12:38:21.819] [INFO] Checking git for module: MagicMirror 0|mm | [2024-10-02 12:38:21.972] [INFO] updatenotification: [PM2] You are not using pm2 0|mm | [2024-10-02 12:38:22.050] [LOG] Netatmo: Authenticated 0|mm | [2024-10-02 12:38:22.053] [LOG] Netatmo: token.json was written successfully 0|mm | [2024-10-02 12:38:22.109] [LOG] Netatmo: New Token Expire Wednesday, October 2, 2024 3:38 PM 0|mm | [2024-10-02 12:38:32.845] [ERROR] Moment Timezone has no data for GMT+0200. See http://momentjs.com/timezone/docs/#/data-loading/. 0|mm | [2024-10-02 12:38:32.846] [ERROR] Moment Timezone has no data for GMT+0200. See http://momentjs.com/timezone/docs/#/data-loading/. 0|mm | [2024-10-02 12:38:32.847] [ERROR] Moment Timezone has no data for GMT+0200. See http://momentjs.com/timezone/docs/#/data-loading/. 0|mm | [2024-10-02 12:38:33.062] [INFO] Calendar-Fetcher: Broadcasting 40 events from http://p71-caldav.icloud.com/published/2/MjA0MDUwMTIxMjA0MD........CENSORED.
I dont even see the weather module loading in the log-File? But to be honest, i didnt compeared if it was listed before the update in the log... Unfortunatly i didnt stored any older log files. The Display shows endless "loading". Can someone have a look on this or maybe guide me into deeper analysis?
Small Update: I switched now from OpenWeatherMap Config to Pirateweather, and the module is working fine again.
Seems there is an Issue with the OpenWeatherMap config.
module: "weather",
position: "bottom_right",
header: "Wetter Vorhersage",
config: {
weatherProvider: "pirateweather",
type: "forecast",
apibase: "https://api.pirateweather.net",
weatherEndpoint: "/forecast",
apiKey: "***CENSORED***",
lat: "***CENSORED***",
lon: "***CENSORED***",
tableClass: 'medium',
colored: 'true',
fade: true,
fadePoint: 0.5,
I'm getting the same with OpenWeatherMap:
Could not load data ... TypeError: Cannot read properties of undefined (reading 'humidity')
at Class.generateWeatherObjectFromCurrentWeather (openweathermap.js:132:53)
at openweathermap.js:37:28
and
Could not load data ... TypeError: forecasts is not iterable
at Class.generateForecastHourly (openweathermap.js:184:26)
at Class.generateWeatherObjectsFromForecast (openweathermap.js:149:16)
at openweathermap.js:57:22
Doesn't seem right to switch providers to fix this.
@JHenzi can you post the module info for weather from config.js xxx out your apikey
They switched the default API version to 3.0, don't know why I doens't work anymore.
But when you add apiVersion: "2.5" to the config, it works again.
The addition of apiVersion tagging works. Here's my config:
{
module: "weather",
position: "top_right",
config: {
weatherProvider: "openweathermap",
type: "current",
location: "XXXX",
locationID: "XXXX", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
apiKey: "XXXX",
apiVersion: "2.5"
}
},
{
module: "weather",
position: "top_left",
header: "Weather Forecast",
config: {
weatherProvider: "openweathermap",
type: "forecast",
location: "XXXX",
locationID: "XXXX", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
apiKey: "XXXX",
apiVersion: "2.5"
}
}
Closed the Issue as fixed with adding the apiVersion: „2.5“
This isn't fixed! API Version 2.5 is deprecated. It was supposed to be retired in June of 2024. This needs a real fix, everyone has to migrate to version 3.0.
Your default weather service is going to stop working and does NOT work without a code change already.
@JHenzi we changed because of their notice. 3.0 is the only official api
ReOpened due to request for an update to api 3.0
Nothing needs to be fixed with the code. You need to get a new V3 API key at openweathermap.com
Nothing needs to be fixed with the code. You need to get a new V3 API key at openweathermap.com
I can’t choose an api key version on my free profile. And generating a new key does not fix the issue. So you think only solution is to upgrade to API V3.0 billing Methode?
I have an API 3.0 account and the weather is not loading. The same API is working with other modules for weather (/scottcl88/MMM-DynamicWeather) but the default weather module is not working after the update.
If you setup a payment method you can limit it to 1000 per day so you never have to pay. I've had it setup for months and have yet to get a bill from them or see anything. It's just like the free account but API 3.0.
before 2.29 (yesterday) the default weather module used 2.5 in the url
Oh thank you, @JHenzi this was driving me crazy before I thought to look here.
I have three magic mirrors running. 1000 is probably still enough, but still. I kinda think the default option for a standard model probably shouldn't be to an API service that even just MIGHT require a fee. To much danger for an unsuspecting user who just accidentally does something wrong.
@chrismaverick we provide different providers
@sdetweil yes, I know. But the module defaults to openweathermap, so I am presuming that's the most likely to be used by those who are least able to understand what is happening.
we did that because it gave the best results now so long ago, and was free. still is under most circumstances
MM doesnt start when i was adding apiVersion: "2.5" to the config.js
But when i change apiVersion: "3.0" here
~/MagicMirror/modules/default/weather/providers/openweathermap.js-
to "2.5" it solved the problem and weather was working again
so you missed a comma after and maybe before
2.5 WILL end sometime. was supposed to be june
don't edit our files. all config changes go in config.js
2.5 WILL end sometime. was supposed to be june
I recieved this yesterday via email: "We would like to inform you that we started One Call 2.5 deprecation, and your access to the product will be stopped on October 14, 2024."
thanks, i did not receive that notice
so you missed a comma after and maybe before
2.5 WILL end sometime. was supposed to be june
don't edit our files. all config changes go in config.js
I think i did it right. It looked like the post above. But it didnt worked. Sorry i am a beginner dont know so much about MM. I also subscribbed to API 3.0 on openweather but i dont know what to do now. I dont get any special "3.0" API. They only send me this
UPDATE: Ok i think it was the comma. Will try it when i am home
many posters don't post the 'exact' text, so you have to know. sometimes they don't post it correctly and the forum software changes the quote marks too. you need to know how to discover and fix it
the 3.0 api also requires an additional config parm
weatherEndpoint:"/onecall",
@chrismaverick we provide different providers
Hello TeaMM,
I just discover the OpenWeather API issue... 👎
Just a quick question: I have a Netatmo weather station, could you please make it an official data provider for the module ?
I am not a developer, but if necessary, I can provide API keys to help you... And make an official request for change...
It would be so "magic" 😇
Hello, I have the same problem after the MM done today. I have checked my API key as well and it is reported as active still. The same key is working on one of my weather stations too without a problem https://github.com/G6EJD/ESP32-e-Paper-Weather-Display so I don’t see the point here for the API key as the issue.
Thanks for a fix in advance =)
@AWSW-de not what we want, but what we get.
OW has changed their business model and api to match .
you MUST supply a credit card to get access to the new api, ( w an uncharged count so far of 1000 requests per day) and you must change the parameters to our weather module,
as location and locationID no longer work. the api requires latitude and longitude now.
you must also supply a new parm weatherEndoint:"/onecall"
as they only provide one now
as they told us in emails, this transition has been going on for 2 years , and they are making it final. some have had emails saying this week is it.
Thanks. Should have read the complete post before. So switching to Pirateweather might be a better option ?!?
possible
If someone comes here and is just looking for it, here is
How to Update to a OpenWeatherMap 3.0 Key
You will need a credit card to do this, but you can limit your calls to the free limit and theoretically you will never be charged.
- Go to OpenWeatherMap's Billing Plan page in the account section.
- Under "One Call API 3.0" click "Subscribe"
- Enter your payment details
- (Optional) Update your "Calls per day" to
1000to avoid being charged - Update your existing config
I use two modules, and my new config looks like this
[
{
module: "weather",
position: "top_left",
config: {
weatherProvider: "openweathermap",
weatherEndpoint:"/onecall",
type: "current",
lat: 40.748440,
lon: -73.985664,
apiKey: "$WEATHER_API_KEY"
}
},
{
module: "weather",
position: "top_left",
header: "Weather Forecast",
config: {
weatherProvider: "openweathermap",
weatherEndpoint:"/onecall",
type: "forecast",
lat: 40.748440,
lon: -73.985664,
apiKey: "$WEATHER_API_KEY"
}
},
]
Sub out your Key and your lat/lon (these are not mine)
The api key at first was getting 401 errors, but after a bit it started working, the same key I was using before. Their FAQ mentions it can take a few hours
I am not worried about usage. The default updateInterval is 600000 or 10 minutes, meaning with two modules like this I will be hitting less than 300 calls a day if I'm doing math right.
If I'm wrong or missed something let me know and I can edit this.
edited: the old 2.5 api returned the location name from the location/locationID parms.. the new api uses lat/lon and does NOT return the location name so you also need to add a module header (before the config:{ section)
header: "somestring to show above the module output", // as you wish for this module
AND set
appendLocationNameToHeader: false,
in the config section
@JHWelch works so far. But how do I get the name of the city back into the header? I now have the name of the city from the corresponding time zone or the capital, i.e. Berlin/Europe.