Page 1 of 1

Dark Sky - my location

Posted: Monday 16 January 2017 2:32
by liderbug
When I bring up Weather->Forecast it puts me 30+ miles south and 1000' lower in elevation. I can enter my address and life is good. Then I go away, eat, store, sleep and when I come back and open Domoticz and -> Forecast I'm back 30+ miles away - again. Is there any way to cache my location?
Thanks
cal

Re: Dark Sky - my location

Posted: Friday 07 April 2017 0:24
by Newbie
Well, in my tests (i live in Italy) i found this:

when i press the forecast button dark sky redirects the url to the default "Country barycenter" (sorry for my bad english, I hope to explain the meaning of the term). Here in Italy is "strada provinciale di Passo Spina, Campiello sul Clitunno, far far far away from my location. My ubuntuphone just lit has the same behavior.

This is due because in ForecastController.js the URL is like this:
//darksky.net/#/ft/' + $scope.config.Latitude + ',' + $scope.config.Longitude
If i put this URL with the true coordinates in firefox, the site redirects me to the default.

e.g
becomes
with the part next to the # simply ignored.

Changing the URL string to
//darksky.net/forecastt/' + $scope.config.Latitude + ',' + $scope.config.Longitude
solves the problem (at least for me). it would be interesting if someone on the team explain the reason of the # /f/ part of the URL, i'm not a programmer and googling here and there i found only references to "fragment identifier" (that in some way explains the reason that the next part is ignored) or AJAX constructs, i don't know anything about angular js.

Re: Dark Sky - my location

Posted: Friday 07 April 2017 0:26
by Newbie
E oh!
Then I go away, eat, store, sleep and when I come back and open Domoticz and -> Forecast I'm back 30+ miles away - again
This is due because coordinates are stored in cookies in the browser... When them expire... :roll: