no weather forecast
Hi all,
I´am new to this stuff and really impressed of the community around the smart mirror, that´s a really nice project your working on. Because I´am new to linux and coding I spend a couple of day´s to get the smart mirror up and running but now it seems that everything is working except the weather forecast (it doesn´t appear on the home screen).
As mentioned in the documentation (if problems occur with weather) my position is hardcoded in the "config.js" file. I have double checked my API key and geoposition with the link:
https://api.forecast.io/forecast/APIKEY/LATITUDE,LONGITUDE
I got data back from forecast.io so that seems to be fine.
Here is a snippet of the forcast.io part of my config.js
// forecast.io forecast : { key : "API-KEY", units : "auto",
If I start the mirror in dev mode:
npm start dev
I got the following (in my opinion relevant) console-messages:
Traffic [Object] controller.js:164 Unable to determine your location controller.js:213 Dilbert comic initialized geolocation.js:39 Cached Geolocation Promise {$$state: Object} controller.js:164 Unable to determine your location geolocation.js:39 Cached Geolocation Promise {$$state: Object} controller.js:164 Unable to determine your location controller.js:198 Traffic [Object] geolocation.js:39 Cached Geolocation
I didn´t changed anything in the CSS files, do I need to modify something that the weather will appear on the home screen?
Here are some points which could be in relation to the weather problem:
- The language is set to de-DE
- I´ve tried the "main" and the "icesnow" layout -> sa,e result (no weather)
- the position is hardcoded
- the weather API key is stated in config.js
- the calendar, traffic, youtube, greeting and rss functions are working fine
Maybe some of you have an idea what I did wrong here. I´am sure the problem sit´s in front of the computer ;)
Thanks a lot!
Not sure if this is a bug, but I'll take a look at it tonight to see if I can reproduce the issue. I have a feeling that it may be an issue with the language like #376
It may also be an issue with Electron: https://github.com/electron/electron/issues/464 which I think is causing #372
Thanks for the fast response. I just changed the language to en-US in the config.js unfortunately it doesn´t solved the issue.
So, I looked into this and there's definitely an issue with the geolocation lookup when you aren't using custom chromium keys. The lookup will fail when using custom keys unless you have enabled this API: https://console.cloud.google.com/apis/api/geolocation/
Once I added a custom geoPosition though it worked just fine, for instance:
geoPosition: {
latitude: 78.23423423,
longitude: 13.123124142
}
In your case, it looks like the API is working, but it's giving an error which maps back to errors.location.positionUnavailable. That means that you probably have something wrong with your geoPosition config object.
When entered correctly it will never try to do a geolocation lookup and will always use the specified coordinates. Double check that your geoPosition config object is in the right format: http://docs.smart-mirror.io/docs/configure_the_mirror.html#geolocation
(I also just realized that the documentation was out of date for the name of the geoPosition object, it's correct in config.example.js but the documentation is probably was threw you through a loop, my bad)
Perfect! Now the weather plugin is working correctly with hardcoded position!
As you mentioned right, the geolocation API is working, the fault was the "_" in the config.js file.
The only need was to rename the function "geo_position" to "geoPosition" in config.js file.
Thanks a lot Evan!