Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weather Module not loading since MM update #3574

Open
Denn2705 opened this issue Oct 2, 2024 · 32 comments
Open

Weather Module not loading since MM update #3574

Denn2705 opened this issue Oct 2, 2024 · 32 comments

Comments

@Denn2705
Copy link

Denn2705 commented Oct 2, 2024

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?

image
@Denn2705
Copy link
Author

Denn2705 commented Oct 2, 2024

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,
image

@JHenzi
Copy link

JHenzi commented Oct 2, 2024

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.

@sdetweil
Copy link
Collaborator

sdetweil commented Oct 2, 2024

@JHenzi can you post the module info for weather from config.js xxx out your apikey

@SirStepheno
Copy link

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.

@JHenzi
Copy link

JHenzi commented Oct 2, 2024

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"
			}
		}

@Denn2705
Copy link
Author

Denn2705 commented Oct 2, 2024

Closed the Issue as fixed with adding the apiVersion: „2.5“

@Denn2705 Denn2705 closed this as completed Oct 2, 2024
@JHenzi
Copy link

JHenzi commented Oct 2, 2024

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.

@sdetweil
Copy link
Collaborator

sdetweil commented Oct 2, 2024

@JHenzi we changed because of their notice. 3.0 is the only official api

@Denn2705 Denn2705 reopened this Oct 2, 2024
@Denn2705
Copy link
Author

Denn2705 commented Oct 2, 2024

ReOpened due to request for an update to api 3.0

@MarcLandis
Copy link
Contributor

Nothing needs to be fixed with the code. You need to get a new V3 API key at openweathermap.com

@Denn2705
Copy link
Author

Denn2705 commented Oct 2, 2024

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?

image

@gregimagines
Copy link

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.

@sdetweil
Copy link
Collaborator

sdetweil commented Oct 3, 2024

before 2.29 (yesterday) the default weather module used 2.5 in the url

@chrismaverick
Copy link

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.

@sdetweil
Copy link
Collaborator

sdetweil commented Oct 3, 2024

@chrismaverick we provide different providers

@chrismaverick
Copy link

@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.

@sdetweil
Copy link
Collaborator

sdetweil commented Oct 4, 2024

we did that because it gave the best results now so long ago, and was free. still is under most circumstances

@DJPAUL90
Copy link

DJPAUL90 commented Oct 8, 2024

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

@sdetweil
Copy link
Collaborator

sdetweil commented Oct 8, 2024

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

@KristjanESPERANTO
Copy link
Contributor

KristjanESPERANTO commented Oct 8, 2024

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."

@sdetweil
Copy link
Collaborator

sdetweil commented Oct 8, 2024

thanks, i did not receive that notice

@DJPAUL90
Copy link

DJPAUL90 commented Oct 8, 2024

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

Screenshot_20241008_220856_Gmail

@sdetweil
Copy link
Collaborator

sdetweil commented Oct 8, 2024

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",

@Killator
Copy link

Killator commented Oct 8, 2024

@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" 😇

rejas pushed a commit that referenced this issue Oct 11, 2024
since API 3.0 is default, weatherEndpoint should be set to "/onecall"
Fixes #3574

ATTENTION: since lat / lon defaults to 0 / 0, the weather plugins works
after this patch, but shows the weather from
https://de.wikipedia.org/wiki/Null_Island if lat / lon is not manually
set.

---------

Co-authored-by: Karsten Hassel <hassel@gmx.de>
Co-authored-by: Pedro Lamas <pedrolamas@gmail.com>
@AWSW-de
Copy link

AWSW-de commented Oct 15, 2024

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 =)

@sdetweil
Copy link
Collaborator

@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.

@AWSW-de
Copy link

AWSW-de commented Oct 15, 2024

Thanks. Should have read the complete post before.
So switching to Pirateweather might be a better option ?!?

@sdetweil
Copy link
Collaborator

possible

@JHWelch
Copy link
Contributor

JHWelch commented Oct 19, 2024

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.

  1. Go to OpenWeatherMap's Billing Plan page in the account section.
  2. Under "One Call API 3.0" click "Subscribe"
  3. Enter your payment details
  4. (Optional) Update your "Calls per day" to 1000 to avoid being charged
  5. 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

@z-master42
Copy link

@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.

@sdetweil
Copy link
Collaborator

sdetweil commented Nov 9, 2024

@z-master42 you need to change the config

set whatever you want in the module header, above the config:{
and set appendLocationNameToHeader:false,
in the config section

@z-master42
Copy link

Damn. I must have gone through the documentary five times. Either I always missed it, or I just didn't realise the function of appendLocationNameToHeader.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests