Thanks for reporting this, @a_user and @pcwii. I did a bit more digging on this one, and am CC’ing my colleague @matheus-mycroft as we’ve had some internal discussions about this one - thanks for your advice and help Matheus!
What I think is happening is that the location is being saved incorrectly to home.mycroft.ai.
My reasoning for this is:
Check that my location is correct in /var/temp/mycroft_web_config_cache.json
This is the contents of my /var/temp/mycroft_web_config_cache.json
. It shows that the location I entered for the Device on home.mycroft.ai as ‘Geelong, VIC’ has defaulted to ‘Saint Albans Park’, which is a suburb about 1.5km / 1 mile away - which is pretty close.
However, the latitude and longitude information is incorrect.
The approximate lat and long for St Albans Park is:
-38.190113, 144.390420
The reported lat and long for my Device is;
49.398752, 8.672434
so it’s quite different - and I can’t explain the anomaly - it’s not a straightforward transverse, or flipping the lat and long.
{
"location": {
"city": {
"created_at": 1513245856347,
"name": "Saint Albans Park",
"updated_at": 1513245856347,
"code": "St Albans Park",
"state": {
"created_at": 1489950675941,
"name": "Victoria",
"updated_at": 1489950675941,
"code": "VIC",
"country": {
"created_at": 1486125571309,
"name": "Australia",
"updated_at": 1486125571309,
"code": "AU"
}
}
},
"coordinate": {
"created_at": 1506792427668,
"latitude": 49.398752,
"updated_at": 1506792427668,
"longitude": 8.672434
},
"created_at": 1513245856346,
"updated_at": 1513245856346,
"timezone": {
"updated_at": 1489950676105,
"dst_offset": 3600000,
"code": "Australia/Melbourne",
"offset": 36000000,
"name": "Australian Eastern Standard
Time(Victoria)
", "
created_at ": 1489950676105}}, "
time_format ": "
full ",
"updated_at": 1527173316815,
"stt": {
"wit": {
"created_at": 1504481866981,
"updated_at": 1527173316836
},
"openstt": {
"created_at": 1504481866976,
"updated_at": 1527173316833
},
"ibm": {
"created_at": 1504481866958,
"updated_at": 1527173316818
},
"google": {
"created_at": 1504481866970,
"updated_at": 1527173316829
},
"mycroft": {
"created_at": 1504481866965,
"updated_at": 1527173316823
},
"module": "mycroft"
},
"created_at": 1504481866955,
"enclosure": {
"timeout": 5.0,
"port": "/dev/ttyAMA0",
"updated_at": 1527173317076,
"rate": 9600,
"created_at": 1504481866997
},
"tts": {
"fatts": {
"created_at": 1504481866991,
"updated_at": 1527173316844
},
"google": {
"created_at": 1504481866992,
"updated_at": 1527173316846
},
"module": "mimic",
"marytts": {
"created_at": 1504481866986,
"updated_at": 1527173316839
},
"mimic": {
"created_at": 1504481866989,
"voice": "ap",
"updated_at": 1527173316843
},
"espeak": {
"created_at": 1504481866987,
"updated_at": 1527173316841
}
},
"skills": {
"created_at": 1504481866994,
"stop_threshold": 2.0,
"updated_at": 1527173317072,
"directory": "~/.mycroft/skills"
},
"date_format": "DMY",
"system_unit": "metric",
"listener": {
"sample_rate": 16000,
"updated_at": 1527173317074,
"phonemes": "HH EY . M AY K R AO F T",
"threshold": 1e-90,
"multiplier": 1.0,
"wake_word": "hey mycroft",
"channels": 1,
"created_at": 1504481866996,
"energy_ratio": 1.5
},
"opt_in": true
}}
Weather Skill output
However, if we look at the Weather Skill output;
pi@mark_1:/var/log $ tail -f mycroft-skills.log | grep -i weather
12:10:28.260 - mycroft.skills.settings:_request_my_settings:440 - DEBUG - getting skill settings from server for WeatherSkill
12:10:29.260 - SKILLS - DEBUG - {"type": "recognizer_loop:utterance", "context": {"client_name": "mycroft_listener", "ident": "1529496626.0428698-511190078"}, "data": {"session": "6c138788-d053-4dc7-a759-85494625c48d", "utterances": ["what's the weather like"], "lang": "en-US"}}
12:10:29.288 - SKILLS - DEBUG - {"context": {"client_name": "mycroft_listener", "ident": "1529496626.0428698-511190078", "target": null}, "type": "skill-weather:CurrentWeatherIntent", "data": {"confidence": 0.5, "utterance": "what's the weather like", "skill_weatherWeather": "weather", "__tags__": [{"from_context": false, "start_token": 2, "end_token": 2, "entities": [{"confidence": 1.0, "key": "weather", "data": [["weather", "skill_weatherWeather"]], "match": "weather"}], "key": "weather", "match": "weather"}], "intent_type": "skill-weather:CurrentWeatherIntent", "target": null}}
12:10:29.305 - SKILLS - DEBUG - {"context": {"client_name": "mycroft_listener", "ident": "1529496626.0428698-511190078", "target": null}, "type": "mycroft.skill.handler.start", "data": {"name": "WeatherSkill.handle_current_weather"}}
12:10:31.070 - requests.packages.urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 "GET /v1/owm/weather?lon=8.672434&lat=49.398752&lang=en HTTP/1.1" 200 435
12:10:33.019 - SKILLS - DEBUG - {"context": null, "type": "enclosure.weather.display", "data": {"temp": "28", "img_code": 0}}
12:10:33.133 - SKILLS - DEBUG - {"type": "Command: weather.display=28,x=2,IICEIBMDNLMDIBCEAA", "context": null, "data": {}}
12:10:43.044 - SKILLS - DEBUG - {"context": {"client_name": "mycroft_listener", "ident": "1529496626.0428698-511190078", "target": null}, "type": "mycroft.skill.handler.complete", "data": {"name": "WeatherSkill.handle_current_weather"}}
we can see that the long and lat co-ordinates passed to the Weather Skill are correct;
GET /v1/owm/weather?lon=8.672434&lat=49.398752&lang=en HTTP/1.1" 200 435
The lat and long above correlate to, guess what, somewhere in coastal Somalia, which explains the temperature anomalies that I’ve been getting (ie 30 C when it was 12 C in Geelong today).
The question is why the anomaly?
My guess is that there is that we have a bug when the latitude and longitude are calculated from the location when the user changes the Device’s location in home.mycroft.ai.
Location output
Just to check this, I got the location
GET response from home.mycroft.ai;
{
"uuid": "25f4bcc9-5bb6-4d00-a845-7a356b1b7f6b",
"createdAt": 1513245856346,
"updatedAt": 1513245856346,
"coordinate": {
"uuid": "923dcda3-59bc-4672-9071-26cdd89a5788",
"createdAt": 1506792427668,
"updatedAt": 1506792427668,
"latitude": 49.398752,
"longitude": 8.672434
},
"timezone": {
"uuid": "4f0c4aac-8cc6-45f9-b08c-e5cf5730408a",
"createdAt": 1489950676105,
"updatedAt": 1489950676105,
"code": "Australia/Melbourne",
"name": "Australian Eastern Standard Time (Victoria)",
"offset": 36000000,
"dstOffset": 3600000
},
"city": {
"uuid": "36ad2141-4aa0-4905-b533-1484a107b9e4",
"createdAt": 1513245856347,
"updatedAt": 1513245856347,
"code": "St Albans Park",
"name": "Saint Albans Park",
"state": {
"uuid": "09739301-d6aa-45c5-bccc-dd69b3fc5e0f",
"createdAt": 1489950675941,
"updatedAt": 1489950675941,
"code": "VIC",
"name": "Victoria",
"country": {
"uuid": "407d0752-da4f-4994-a31b-21c16a3c407c",
"createdAt": 1486125571309,
"updatedAt": 1486125571309,
"code": "AU",
"name": "Australia"
}
}
}
}
TL;DR the lat and long are stored incorrectly on home.mycroft.ai, and are passed correctly to Weather Skill. Weather Skill is doing it’s job correctly. It’s getting incorrect lat/long from home.mycroft.ai.