Read the statement by Michael Teeuw here.
Struggling with Weather... module
-
in addition… looking at “ukmetofficedatahub.js”
API Base URL looks like this…
apiBase: “https://api-metoffice.apiconnect.ibmcloud.com/v0/forecasts/point/<hourly/3hourly/daily>”,where as the next section down API URL is stated to be
“https://metoffice.apiconnect.ibmcloud.com/metoffice/production/api”seems to be a mismatch although im still looking at where to test that theory…
i would have hoped which ever way the URL is structured its the JS info thats the important bit, not the structure of the URL -
I’m stumped!
As outlined here
ukmetofficedatahub.js is set to
// Set the default config properties that is specific to this provider defaults: { apiBase: "https://api-metoffice.apiconnect.ibmcloud.com/v0/forecasts/point/daily/", apiKey: "<myID>", apiSecret: " <my secret>", lat: <my lat>, lon: <mylong>, windUnits: "mph"
(lines 50-55)
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
config.js set to
weatherProvider: "ukmetofficedatahub", apiBase: "https://api-metoffice.apiconnect.ibmcloud.com/v0/forecasts/point/daily/", apiKey: "<myID>", apiSecret: " <my secret>", lat: <my lat>, lon: <my long>, windUnits: "mph", tempUnits: "metric",
(lines 20-27)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////logs are clear… many server restarts…
i can curl required info and get something vaguely intelligent from the Met office Servers
curl --request GET \ --url 'https://api-metoffice.apiconnect.ibmcloud.com/v0/forecasts/point/hourly?excludeParameterMetadata=false&includeLocationName=true&latitude=<my lat>&longitude=<my long>' \ --header 'X-IBM-Client-Id: <myID>' \ --header 'X-IBM-Client-Secret: <my secret>' \ --header 'accept: application/json'
-
any ideas?? @sdetweil
Is this portion of the module broke for me, do i need to use a different service?
-
@D3dl3g I don’t KNOW for sure… the provider has its own apiBase set…
* apiBase: "https://api-metoffice.apiconnect.ibmcloud.com/metoffice/production/v0/forecasts/point/",
so comment that out in your config
add // to the start of the line with apiBase:also, as this doesn’t have a node helper, we should be looking in the browser logs
ctrl-shift-i, select the console tab and put
weath
in the filter field
-
@kayakbabe
For some reason i glossed over your reply, apologies.Trying with a different provider will be my plan of attack today. After running some diag, as sam has suggested.
I find the met office to be insanely accurate for my area when compared to other online weather services. Hence my desire to use it.
One of the reasons my posts are peppered with pictures and code is to help ensure i am setting it up correctly. I didnt realise about the .js in the weather folder for 2 days i thought it was all set up from config.js…
As it stands im convinced i have it set right, now, but its totally possible i have a comma in the wrong place. As im a total n00b with JS. i know sometimes it is difficult to see the forest through the trees and a fresh set of eyes can help.
Thank-you for your reply, looks like im experiencing option 4 😄
-
apiBase commented out in config.
server restart, and browser log request, showing loaded weather modules
i still have “loading” in module locationlooking at source gives me the impression that i need to go and look at 2 more .js files. Previously i have been working with /default/weather/ukmetofficedatahub.js and /MagicMirror/config/config.js
ill see if thes hold any info:
/root/MagicMirror/modules/default/weather/weatherproviders.js
(Edit: //weather provider properties: null, modified to:
)/root/MagicMirror/modules/default/weather/weather.js
(Edit: this file is set to “openweathermap”, changing to “ukmetofficedatahub”)
server restart, no effect noted :(
-
-
@D3dl3g you ONLY setup from config.js
please try with NO apibase set
-
weather.js and weatherprovider.js i have set back to defaults.
i have set config.js as requested
weatherProvider: 'ukmetofficedatahub', lat: "52.###############", long: "-1.###############", //apiBase: 'https://api-metoffice.apiconnect.ibmcloud.com/v0/forecasts/point/daily/', apiKey: 'e52#############################', apiSecret: 'd3a#############################',
the result:-
-
@D3dl3g send me your API key… config from config.js via email or direct message so I can debug
did u look in the browser messages?
my email is my same userid at gmail