spile wrote: 
> Something strange going on. I entered ukxx0018:1:uk for my location -
> Birmingham, UK
> Temperature shows 3°C but outside temperature is actually in double
> figures and this is confirmed by Weather.Com which shows 12°C

Your weather code needs to be upper case.  I tested it and the URL with
UKXX0018:1:UK embedded returns the JSON file with values of
"lat":52.48,"long":-1.9 for Birmingham, United Kingdom.

Weather code ukxx0018:1:uk in the URL returns a HTTP 404 error.  So the
lat and long values will be left at the values for the previous valid
weather code entered.  Possibly Chicago or even 0.0 and 0.0.

You can see the lat long values being used if you turn SDT logging up to
INFO level.  Here is what it looks like when using UKXX0018:1:UK.  The
geocode at the end of the URL for getWeatherNow and getWeatherToday is
your lat and long values.


Code:
--------------------
    
  [19-03-25 20:52:23.0568] Plugins::SuperDateTime::Plugin::getLatLong (2618) 
async request: 
https://dsx.weather.com/wxd/v2/loc/en_US/UKXX0018:1:UK?apiKey=7bb1c920-7027-4289-9c96-ae5e263980bc&format=json
  [19-03-25 20:52:23.5148] Plugins::SuperDateTime::Plugin::gotLatLong (2629) 
got 
https://dsx.weather.com/wxd/v2/loc/en_US/UKXX0018:1:UK?apiKey=7bb1c920-7027-4289-9c96-ae5e263980bc&format=json
  [19-03-25 20:52:31.0597] Plugins::SuperDateTime::Plugin::refreshData (3905) 
Data refresh in process...
  [19-03-25 20:52:31.0610] Plugins::SuperDateTime::Plugin::getWeatherNow (3341) 
async request: 
https://api.weather.com/v2/turbo/vt1observation?apiKey=d522aa97197fd864d36b418f39ebb323&units=e&language=en-US&format=json&geocode=52.48,-1.9
  [19-03-25 20:52:32.2908] Plugins::SuperDateTime::Plugin::gotWeatherNow (3356) 
got 
https://api.weather.com/v2/turbo/vt1observation?apiKey=d522aa97197fd864d36b418f39ebb323&units=e&language=en-US&format=json&geocode=52.48,-1.9
  [19-03-25 20:52:32.2920] Plugins::SuperDateTime::Plugin::getWeatherToday 
(2900) async request: 
https://api.weather.com/v2/turbo/vt1dailyforecast?apiKey=d522aa97197fd864d36b418f39ebb323&format=json&language=en-US&units=e&geocode=52.48,-1.9
  [19-03-25 20:52:33.1390] Plugins::SuperDateTime::Plugin::gotWeatherToday 
(2915) got 
https://api.weather.com/v2/turbo/vt1dailyforecast?apiKey=d522aa97197fd864d36b418f39ebb323&format=json&language=en-US&units=e&geocode=52.48,-1.9
  
--------------------


Here is what you see in the log file when ukxx0018:1:uk is entered for
the weather code.


Code:
--------------------
    
  [19-03-25 20:53:41.7402] Plugins::SuperDateTime::Plugin::getLatLong (2618) 
async request: 
https://dsx.weather.com/wxd/v2/loc/en_US/ukxx0018:1:uk?apiKey=7bb1c920-7027-4289-9c96-ae5e263980bc&format=json
  [19-03-25 20:53:42.0886] Plugins::SuperDateTime::Plugin::gotErrorViaHTTP 
(6141) error getting 
https://dsx.weather.com/wxd/v2/loc/en_US/ukxx0018:1:uk?apiKey=7bb1c920-7027-4289-9c96-ae5e263980bc&format=json
  [19-03-25 20:53:42.0891] Plugins::SuperDateTime::Plugin::gotErrorViaHTTP 
(6142) 404 Not Found
  [19-03-25 20:53:42.0896] Plugins::SuperDateTime::Plugin::gotErrorViaHTTP 
(6156) Trying getLatLong again.
  [19-03-25 20:53:45.0904] Plugins::SuperDateTime::Plugin::getLatLong (2618) 
async request: 
https://dsx.weather.com/wxd/v2/loc/en_US/ukxx0018:1:uk?apiKey=7bb1c920-7027-4289-9c96-ae5e263980bc&format=json
  [19-03-25 20:53:45.2982] Plugins::SuperDateTime::Plugin::gotErrorViaHTTP 
(6141) error getting 
https://dsx.weather.com/wxd/v2/loc/en_US/ukxx0018:1:uk?apiKey=7bb1c920-7027-4289-9c96-ae5e263980bc&format=json
  [19-03-25 20:53:45.2987] Plugins::SuperDateTime::Plugin::gotErrorViaHTTP 
(6142) 404 Not Found
  [19-03-25 20:53:45.2991] Plugins::SuperDateTime::Plugin::gotErrorViaHTTP 
(6156) Trying getLatLong again.
  [19-03-25 20:53:48.3000] Plugins::SuperDateTime::Plugin::getLatLong (2618) 
async request: 
https://dsx.weather.com/wxd/v2/loc/en_US/ukxx0018:1:uk?apiKey=7bb1c920-7027-4289-9c96-ae5e263980bc&format=json
  [19-03-25 20:53:48.6635] Plugins::SuperDateTime::Plugin::gotErrorViaHTTP 
(6141) error getting 
https://dsx.weather.com/wxd/v2/loc/en_US/ukxx0018:1:uk?apiKey=7bb1c920-7027-4289-9c96-ae5e263980bc&format=json
  [19-03-25 20:53:48.6640] Plugins::SuperDateTime::Plugin::gotErrorViaHTTP 
(6142) 404 Not Found
  [19-03-25 20:53:48.6644] Plugins::SuperDateTime::Plugin::gotErrorViaHTTP 
(6156) Trying getLatLong again.
  
--------------------


------------------------------------------------------------------------
BoomX2's Profile: http://forums.slimdevices.com/member.php?userid=33529
View this thread: http://forums.slimdevices.com/showthread.php?t=14327

_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins

Reply via email to