Read the statement by Michael Teeuw here.
"Invalid Date" appears in Weather module. MM v2.29.0
-
Had to rebuild my mirror from scratch after my SSD croaked five months after purchase and my backup USB was corrupted, argh. Most everything works now except for my Weather modules, which are using OpenWeatherMap with API 3.0.
When current weather loads, I see "Invalid Date where the time should be above the temperature. To add insult to injury, the temp displays as “NaN”. What the heck? Here’s my config:
{ module: 'weather', position: 'top_center', header: 'Current Weather - Canton', config: { weatherProvider: 'openweathermap', appendLocationNameToHeader: false, type: 'current', weatherEndpoint: '/onecall', lat: '34.17188', lon: '-84.57056', apiVersion: '3.0', apiKey: "XXXX" } }, { module: 'weather', position: 'top_center', header: 'Forecast - Canton', config: { weatherProvider: 'openweathermap', appendLocationNameToHeader: false, type: 'forecast', weatherEndpoint: '/onecall', lat: '34.17188', lon: '-84.57056', apiVersion: '3.0', apiKey: "XXXX" } },
Units are set to imperial in the config.js file and my Raspberry PI time seems correct.
Thoughts?
-
I figured it out. I use the free plan, so I cannot use API version 3.0. I have to use API version 2.5. Furthermore I have to use the /weather endpoint.
I got it working again by adding these 2 settings:
apiVersion: '2.5' weatherEndpoint: "/weather"
-
@reilley I copied your config and used my apikey
no other changes (well I wrapped your config in code block to keep the quotes correct for copy/paste) -
@reilley this was with the config.js.sample copied as another
units to imperial
copy/paste your config over the two weather module entries
add my apikeythen
# use env var to point to other config file export MMM_CONFIG_FILE=config/name_of_file.js npm start
-
@reilley technically you don’t need apiVersion or weatherEndpoint, as those are the defaults.
-
@reilley that time is the sunrise or sunset time, sunrise is next, time is correct(in my display)
-
@sdetweil said in "Invalid Date" appears in Weather module. MM v2.29.0:
@reilley I copied your config and used my apikey
no other changes (well I wrapped your config in code block to keep the quotes correct for copy/paste)So my code worked for you and the only change was the API key? This key worked two days ago, so not sure what’s happening here.
-
@reilley said in "Invalid Date" appears in Weather module. MM v2.29.0:
So my code worked for you and the only change was the API key?
correct
-
@sdetweil said in "Invalid Date" appears in Weather module. MM v2.29.0:
@reilley said in "Invalid Date" appears in Weather module. MM v2.29.0:
So my code worked for you and the only change was the API key?
correct
That’s nuts. Why would an API key work two days ago and not today? Seems like maybe there’s a configuration problem elsewhere but I not sure where it would be since I made no changes to weather.js or other .js files associated with the Weather module.
-
@reilley I don’t know… try my approach
docd ~/MagicMirror/config cp config.js.sample testcfg.js cd ..
then edit the testcfg.js and paste your weather info from config.js here
then change the units to imperial
save
then on the terminal windowexport MM_CONFIG_FILE=config/testcfg.js npm start
-
@sdetweil - nope, same result