Giter VIP home page Giter VIP logo

skill-weather's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

skill-weather's Issues

Weather skill does not allow condition to be localised

When we translate the weather skill, there are strings in the output that don't seem to be localisable.

History ========================================================    
 날씨가 어때요                                                              
 >> 현재 날씨는 overcast clouds고 기온은 54도입니다. 오늘의 최고 기온은 54도, 최저 기온은  44도입니다.                                                                                                                        

We searched for the string:

juyeon@juyeonubuntu:/opt/mycroft/skills/mycroft-weather.mycroftai$ grep -nHri -e "overcast" -e "cloudy" .
./__init__.py:125:        self.CODES['02d', '02n', '03d', '03n'] = 1  # partly cloudy
./__init__.py:126:        self.CODES['04d', '04n'] = 2                # cloudy

But it seems like there is no way to localise this. Any thoughts?

Why does the weather skill have the language hardcoded in __init.py__?

Would it be possible for the weather skill to have the language in a configuration file that was not uploaded to GitHub? I am getting conflicts because I changed it to Korean so I could work on Korean, but possibly this value could be in a config file that is in the .gitignore? and default to whatever is in the Mycroft core config file ?

    def __init__(self):
        super(OWMApi, self).__init__("owm")
<<<<<<< HEAD
        self.lang = "ko"
=======
        # This is the language code for the interaction between python and the
        # OpenWeatherMap API. This value does not need to be localized as data is fetched
        # in English from the OWM API and later on translated at the WeatherSkill
        # class:
        self.lang = "en"
>>>>>>> upstream/master
        self.observation = ObservationParser()
        self.forecast = ForecastParser()

fresh Mycroft install weather spits errors

"Whats the weather like?" gives a stack trace on a fresh Mycroft install. Unfortunately I do not know Python well enough to dig into this..

How can I get you better / more information to see what the root of this problem is?
My location is: Lake Stevens Wa, USA
from the directory it is residing in, I have the following settings:

cat settings.json
{"api_key": null, "use_proxy": true, "__mycroft_skill_firstrun": false}

All other skills I have tried (so far) are error free..

The error log is showing this:
2019-11-05 17:41:52.075 | WARNING | 4899 | WeatherSkill | No temperature available (AttributeError("'NoneType' object has no attribute 'get_temperature'",)) 2019-11-05 17:41:52.076 | WARNING | 4899 | WeatherSkill | No temperature available (AttributeError("'NoneType' object has no attribute 'get_temperature'",)) 2019-11-05 17:41:52.076 | ERROR | 4899 | WeatherSkill | Error: 'NoneType' object has no attribute 'get_humidity' Traceback (most recent call last): File "/opt/mycroft/skills/mycroft-weather.mycroftai/__init__.py", line 1230, in __populate_report return self.__populate_current(report, when, unit) File "/opt/mycroft/skills/mycroft-weather.mycroftai/__init__.py", line 1309, in __populate_current 'percentage.number', {'num': forecastWeather.get_humidity()}) AttributeError: 'NoneType' object has no attribute 'get_humidity' 2019-11-05 17:41:52.076 | ERROR | 4899 | WeatherSkill | Error: 'NoneType' object is not subscriptable Traceback (most recent call last): File "/opt/mycroft/skills/mycroft-weather.mycroftai/__init__.py", line 440, in handle_current_weather separate_min_max='Location' not in message.data) File "/opt/mycroft/skills/mycroft-weather.mycroftai/__init__.py", line 1475, in __report_weather if report['location']: TypeError: 'NoneType' object is not subscriptable

Use own keys

It used to be possible to use your own keys for owm, it even says so in mycroft-core readme

this functionality was broken at some point, #123 would fix this, but in #158 this functionality was completely removed

As a privacy first voice assistant, and especially being an official skill that cant be easily uninstalled and replaced without hacky blacklists, i think this functionality should be restored

at very least update the mycroft-core readme

Error when city not found

hey mycroft, when will it rain in waterbottle plastic
An error occurred while processing a request in WeatherSkill

11:50:02.140 - mycroft.skills.core:wrapper:396 - ERROR - An error occurred while processing a request in WeatherSkill
Traceback (most recent call last):
File "/home/matthew/Documents/GitHub/mycroft-core/mycroft/skills/core.py", line 369, in wrapper
handler(self, message)
File "/opt/mycroft/skills/skill-weather/__init__.py", line 219, in handle_next_precipitation
report["full_location"]).get_forecast().get_weathers():
File "/opt/mycroft/skills/skill-weather/__init__.py", line 86, in daily_forecast
"query": query
File "/home/matthew/Documents/GitHub/mycroft-core/mycroft/api/__init__.py", line 48, in request
return self.send(params)
File "/home/matthew/Documents/GitHub/mycroft-core/mycroft/api/__init__.py", line 74, in send
return self.get_response(response)
File "/home/matthew/Documents/GitHub/mycroft-core/mycroft/api/__init__.py", line 84, in get_response
raise HTTPError(data, response=response)
HTTPError: {"cod":"404","message":"city not found"}

Mycroft-weather is failing on non American continents based locations, even on clean install

Operating System: Arch Linux
KDE Plasma Version: 5.19.3
KDE Frameworks Version: 5.72.0
Qt Version: 5.15.0
Kernel Version: 5.4.51-1-lts
OS Type: 64-bit
Processors: 4 × Intel® Core™ i5-7600K CPU @ 3.80GHz
Memory: 15.6 GiB of RAM
Graphics Processor: AMD Radeon ™ RX 480 Graphics

Mycroft-Core version: 20.2.4

Using: mycroft-plasmoid version: r136.9a784bd-1

Expected behaviour:

When mycroft is running, and I ask it "what is the weather like" after the wake word, I expect it to return a weather report of my current location.

Current behaviour

When I ask mycroft what the weather is like in my current location, it tells me the weather service is unavailable, even though all times I've asked the openweathermap service is working, and reachable to me. Mycroft does report back weather data for any location on either American continent, south or north America, including Iceland for some reason, but none of any of the other continents as far as I've tested.

Test for current location (in the netherlands, fails):

 01:52:12.204 | INFO     | 52171 | __main__:handle_record_end:45 | End Recording...
 01:52:12.230 | DEBUG    | 52171 | urllib3.connectionpool | Starting new HTTPS connection (1): api.mycroft.ai:443
 01:52:12.266 | DEBUG    | 51202 | Mark2 | Listening stopped
 01:52:12.801 | DEBUG    | 52171 | urllib3.connectionpool | Starting new HTTPS connection (1): api.mycroft.ai:443
~~~~2 | mycroft.skills.intent_service:handle_utterance:334 | Utterances: ["what's the weather", 'what is the weather']
 01:52:13.162 | DEBUG    | 52171 | mycroft.client.speech.mic:listen:632 | Waiting for wake word...
~~~~   | 52171 | urllib3.connectionpool | https://api.mycroft.ai:443 "POST /v1/stt?lang=en-US&limit=1 HTTP/1.1" 200 23
 01:52:13.167 | DEBUG    | 52171 | mycroft.client.speech.listener:transcribe:224 | STT: what's the weather
 01:52:13.167 | INFO     | 52171 | __main__:handle_utterance:72 | Utterance: ["what's the weather"]
~~~~l | https://api.mycroft.ai:443 "POST /v1/device/06f08ce8-7809-4743-b4b8-4024bc1e39fc/metric/timing HTTP/1.1" 204 0
 01:52:13.320 | DEBUG    | 51202 | urllib3.connectionpool | Starting new HTTPS connection (1): api.mycroft.ai:443
~~~~ftai:what.is.multi.day.forecast.intent', 'sent': 'what is the weather', 'matches': {}, 'conf': 0.5500672495039224}
~~~~ftaiWeather')], 'confidence': 1.0}], 'end_token': 3, 'from_context': False}]}], 'utterance': "what's the weather"}
 01:52:13.373 | DEBUG    | 51202 | WeatherSkill | Handler: handle_current_weather
 01:52:13.374 | DEBUG    | 51202 | WeatherSkill | extracted when: 2020-07-15 00:00:00+00:00
 01:52:13.374 | INFO     | 51202 | WeatherSkill | Forecast for now
~~~~:13.374 | DEBUG    | 51202 | mycroft-weather_mycroftai:request:162 | Using cached OWM Response from 52127.98766114
 01:52:13.374 | DEBUG    | 51202 | WeatherSkill | Populating report for now: 2020-07-14 23:47:10+00:00
~~~~13.375 | DEBUG    | 51202 | mycroft-weather_mycroftai:request:162 | Using cached OWM Response from 52128.485294652

Test for San Diego, California(succeeds):

01:53:34.068 | INFO     | 52171 | __main__:handle_record_end:45 | End Recording...
 01:53:34.096 | DEBUG    | 52171 | urllib3.connectionpool | Starting new HTTPS connection (1): api.mycroft.ai:443
 01:53:34.127 | DEBUG    | 51202 | Mark2 | Listening stopped
 01:53:35.057 | DEBUG    | 52171 | mycroft.client.speech.mic:listen:632 | Waiting for wake word...
~~~~   | 52171 | urllib3.connectionpool | https://api.mycroft.ai:443 "POST /v1/stt?lang=en-US&limit=1 HTTP/1.1" 200 41
~~~~397 | DEBUG    | 52171 | mycroft.client.speech.listener:transcribe:224 | STT: what's the weather like in san diego
 01:53:35.399 | INFO     | 52171 | __main__:handle_utterance:72 | Utterance: ["what's the weather like in san diego"]
~~~~ndle_utterance:334 | Utterances: ["what's the weather like in san diego", 'what is the weather like in san diego']
~~~~weather.like.intent', 'sent': 'what is the weather like in san diego', 'matches': {}, 'conf': 0.22867245258001753}
~~~~h': 'san diego', 'key': 'san diego', 'from_context': False}], 'utterance': "what's the weather like in san diego"}
 01:53:35.622 | DEBUG    | 51202 | WeatherSkill | Handler: handle_current_weather
 01:53:35.624 | DEBUG    | 51202 | WeatherSkill | extracted when: 2020-07-15 00:00:00+00:00
 01:53:35.624 | INFO     | 51202 | WeatherSkill | Forecast for now
 01:53:35.625 | DEBUG    | 51202 | urllib3.connectionpool | Starting new HTTPS connection (1): api.mycroft.ai:443
~~~~2 | urllib3.connectionpool | https://api.mycroft.ai:443 "GET /v1/owm/weather?q=san+diego&lang=en HTTP/1.1" 200 470
 01:53:36.146 | DEBUG    | 51202 | WeatherSkill | Populating report for now: 2020-07-14 23:51:58+00:00
 01:53:36.149 | DEBUG    | 51202 | urllib3.connectionpool | Starting new HTTPS connection (1): api.mycroft.ai:443
~~~~nectionpool | https://api.mycroft.ai:443 "GET /v1/owm/forecast/daily?q=san+diego&cnt=14&lang=en HTTP/1.1" 200 5294
 01:53:36.678 | DEBUG    | 51202 | WeatherSkill | Dialog: current.weather
 01:53:36.686 | INFO     | 51202 | Mark2 | Starting idle event
Removing event mycroft-mark-2.mycroftai:IdleCheck
~~~~  | 51202 | mycroft.skills.mycroft_skill.event_container:add:146 | Added event: mycroft-mark-2.mycroftai:IdleCheck
 01:53:37.190 | INFO     | 51202 | Mark2 | Showing idle screen in 30 seconds
01:53:37.724 | DEBUG    | 51202 | urllib3.connectionpool | Starting new HTTPS connection (1): api.mycroft.ai:443
~~~~l | https://api.mycroft.ai:443 "GET /v1/device/06f08ce8-7809-4743-b4b8-4024bc1e39fc/skill/settings HTTP/1.1" 304 0
~~~~3:38.139 | DEBUG    | 51202 | mycroft.skills.settings:download:365 | No skill settings changes since last download
 01:53:38.562 | DEBUG    | 51202 | urllib3.connectionpool | Starting new HTTPS connection (1): api.mycroft.ai:443
~~~~l | https://api.mycroft.ai:443 "POST /v1/device/06f08ce8-7809-4743-b4b8-4024bc1e39fc/metric/timing HTTP/1.1" 204 0
 01:53:44.781 | DEBUG    | 52171 | urllib3.connectionpool | Starting new HTTPS connection (1): api.mycroft.ai:443
~~~~45.200 | DEBUG    | 51202 | mycroft-weather_mycroftai:request:162 | Using cached OWM Response from 52514.138581624
~~~~:45.200 | DEBUG    | 51202 | mycroft-weather_mycroftai:request:162 | Using cached OWM Response from 52127.98766114
~~~~45.201 | DEBUG    | 51202 | mycroft-weather_mycroftai:request:162 | Using cached OWM Response from 52128.485294652
Removing event mycroft-weather.mycroftai:precache1
Removing event mycroft-weather.mycroftai:precache2
Removing event mycroft-weather.mycroftai:precache3

Test for London, England, United Kingdom(fails):

01:54:46.498 | INFO     | 52171 | __main__:handle_record_end:45 | End Recording...
01:54:46.555 | DEBUG    | 51202 | Mark2 | Listening stopped
01:54:46.523 | DEBUG    | 52171 | urllib3.connectionpool | Starting new HTTPS connection (1): api.mycroft.ai:443
01:54:47.474 | DEBUG    | 52171 | mycroft.client.speech.mic:listen:632 | Waiting for wake word...
~~~~ice:handle_utterance:334 | Utterances: ["what's the weather like in london", 'what is the weather like in london']
~~~~   | 52171 | urllib3.connectionpool | https://api.mycroft.ai:443 "POST /v1/stt?lang=en-US&limit=1 HTTP/1.1" 200 38
~~~~47.741 | DEBUG    | 52171 | mycroft.client.speech.listener:transcribe:224 | STT: what's the weather like in london
01:54:47.742 | INFO     | 52171 | __main__:handle_utterance:72 | Utterance: ["what's the weather like in london"]
~~~~ts.weather.like.intent', 'sent': 'what is the weather like in london', 'matches': {}, 'conf': 0.34897235274780514}
~~~~ 6, 'match': 'london', 'key': 'london', 'from_context': False}], 'utterance': "what's the weather like in london"}
01:54:47.991 | DEBUG    | 51202 | WeatherSkill | Handler: handle_current_weather
01:54:47.994 | DEBUG    | 51202 | WeatherSkill | extracted when: 2020-07-15 00:00:00+00:00
01:54:47.994 | INFO     | 51202 | WeatherSkill | Forecast for now
01:54:47.996 | DEBUG    | 51202 | urllib3.connectionpool | Starting new HTTPS connection (1): api.mycroft.ai:443
~~~~1202 | urllib3.connectionpool | https://api.mycroft.ai:443 "GET /v1/owm/weather?q=london&lang=en HTTP/1.1" 200 468
01:54:48.559 | DEBUG    | 51202 | WeatherSkill | Populating report for now: 2020-07-14 23:54:14+00:00
01:54:48.562 | DEBUG    | 51202 | urllib3.connectionpool | Starting new HTTPS connection (1): api.mycroft.ai:443
~~~~connectionpool | https://api.mycroft.ai:443 "GET /v1/owm/forecast/daily?q=london&cnt=14&lang=en HTTP/1.1" 200 5321
01:55:10.523 | DEBUG    | 51202 | urllib3.connectionpool | Starting new HTTPS connection (1): api.mycroft.ai:443
~~~~l | https://api.mycroft.ai:443 "POST /v1/device/06f08ce8-7809-4743-b4b8-4024bc1e39fc/metric/timing HTTP/1.1" 204 0
01:55:11.541 | DEBUG    | 51202 | urllib3.connectionpool | Starting new HTTPS connection (1): api.mycroft.ai:443
~~~~l | https://api.mycroft.ai:443 "POST /v1/device/06f08ce8-7809-4743-b4b8-4024bc1e39fc/metric/timing HTTP/1.1" 204 0
01:55:13.061 | DEBUG    | 51202 | urllib3.connectionpool | Starting new HTTPS connection (1): api.mycroft.ai:443
~~~~tionpool | https://api.mycroft.ai:443 "GET /v1/device/06f08ce8-7809-4743-b4b8-4024bc1e39fc/setting HTTP/1.1" 304 0
01:55:13.546 | DEBUG    | 51202 | urllib3.connectionpool | Starting new HTTPS connection (1): api.mycroft.ai:443
~~~~ionpool | https://api.mycroft.ai:443 "GET /v1/device/06f08ce8-7809-4743-b4b8-4024bc1e39fc/location HTTP/1.1" 304 0
01:55:15.836 | DEBUG    | 52171 | urllib3.connectionpool | Starting new HTTPS connection (1): api.mycroft.ai:443
~~~~l | https://api.mycroft.ai:443 "POST /v1/device/06f08ce8-7809-4743-b4b8-4024bc1e39fc/metric/timing HTTP/1.1" 204 0
01:55:38.589 | DEBUG    | 51202 | urllib3.connectionpool | Starting new HTTPS connection (1): api.mycroft.ai:443
~~~~l | https://api.mycroft.ai:443 "GET /v1/device/06f08ce8-7809-4743-b4b8-4024bc1e39fc/skill/settings HTTP/1.1" 304 0
~~~~5:39.026 | DEBUG    | 51202 | mycroft.skills.settings:download:365 | No skill settings changes since last download
Removing event mycroft-mark-2.mycroftai:IdleCheck

KeyError: 'timezone' in skill

This is what i get when i call the weather skill.

2021-08-07 01:28:40.530 | ERROR | 28447 | WeatherSkill | Unexpected error retrieving weather
Traceback (most recent call last):
File "/opt/mycroft/skills/mycroft-weather.mycroftai/init.py", line 1098, in _get_weather
self.config_core.get("system_unit"), latitude, longitude
File "/opt/mycroft/skills/mycroft-weather.mycroftai/skill/api.py", line 106, in get_weather_for_coordinates
local_weather = WeatherReport(response)
File "/opt/mycroft/skills/mycroft-weather.mycroftai/skill/weather.py", line 247, in init
timezone = report["timezone"]
KeyError: 'timezone'

skill-weather misinterprets city location Geelong/Jalang

I consistently get poor results for the Utterance:
What's the weather like in Geelong
(I live in Geelong, Australia, an hour and a half west of Melbourne, and it's a different climate)

Geelong is pronounced:

  • IPA for English: dʒɪˈlɒŋ
  • CMU Flite phoneme: JH IY L UH NG

Geelong is misinterpreted by Mycroft as:

  • Jerome
  • Jalang

If I speak What's the weather like in Gah-long - substituting the JH IY for G AH, then the weather for Geelong is returned correctly.

I suspect there are many place names that have similar issues, particularly where the place name derives from First Nations / Indigenous languages (Geelong is Waddawurrung language for 'cliffs').

Not sure the best way to approach this?

Wrong time reported for sunrise/sunset

Mycroft reported wrong times for both sunset and sunrise (for today, 27-08-2020)

Sunset

What time is sunset in Amsterdam?

the sun will set at seven forty p.m. today

Actual time for sunset: 20:38

Sunset

What time is sunrise in Amsterdam?

the sun rose at five forty four a.m. today

Actual sunrise at: 06:42

{day}:today won't be translated

While questions about future weather conditions will be translated to set language in cases {day} is a part of the dialog (#), the answer of "will the weather be fine on Wednesday" (eg today) will be translated to "today" (should be "heute"; german). I don't think it is a vocab/de-de issue since #

will it be foggy tomorrow doesn't hit the dialog file

Me: will it be foggy tomorrow?
Mycroft: forecast local foggy alternative

Looking at it, it seems the dialog file is named forecast.local.fog.alternative.dialog but the call is referring to the provided weather condition as foggy.

"Is it foggy" works fine and responds with "no fog is predicted for today". So it's either the alternative dialog name that's generated incorrectly or the forecast dialog name.

Skill-weather fails with Python error after HTTPS GET

Original linked here:
https://community.mycroft.ai/t/skill-weather-fails-with-python-error-after-https-get/2070
Hi,

After updating my Mark 1 to mycroft-core 0.8.21 (with nightly updates), the skill-weather has stopped working.

As a greybeard former Unix sysadmin and software engineer, I have two goals here:

  1. Help report and trace a bug
  2. Learn and document the debug process - perhaps something to add to a FAQ?

After a look around resource, I'm unsure what the best workflow is for skill bugs, so hope someone can point me in the right direction.

Thanks!

Issue Description

After a recent update, the weather skill has stopped working. The utterance is recognised, but Mycroft does not reply.

Environment

  1. Mycroft Mark 1
  2. mycroft-core 0.8.21
  3. Nightly cron job to 'apt-get update' active

Steps to Reproduce

  1. Say 'Hey Mycroft, What's the weather?'
  2. Say 'Hey Mycroft, What's the weather in Austin?'

Expected result

  1. A spoken weather forecast for my local area, as pre-configured some time ago.
  2. Weather symbols on the LED matrix

Actual Result

  1. Mouth changes to listening
  2. After a few seconds, the mouth goes blank (or back to the time skill clock display)
  3. No speech, no response.

Investigation

After some poking around the forums, I found how to check the Mark 1 software version, and fixed the auto-update roof cron job. I also found the main log files, and noticed errors appeared about the same time as the main skill-weather Python script timestamp.
I know a little of GitHub from FOSS tinkering, but don't know the preferred workflow to report / diagnose skill issues.

Some basic checks:

pi@mark_1:~ $ apt list --installed |grep mycroft-core

WARNING: apt does not have a stable CLI interface yet. Use with caution in scripts.

mycroft-core/unknown,now 0.8.21 armhf [installed]
pi@mark_1:~ $ ls -la /opt/mycroft/skills/skill-weather
total 96
drwxr-xr-x  7 mycroft mycroft  4096 Aug 24 16:22 .
drwxrwxrwx 30 mycroft mycroft  4096 Aug 21 16:37 ..
drwxr-xr-x  3 mycroft mycroft  4096 May 17 01:30 dialog
drwxr-xr-x  8 mycroft mycroft  4096 Aug 24 16:22 .git
-rw-r--r--  1 mycroft mycroft 21875 Aug 21 14:04 __init__.py
-rw-r--r--  1 mycroft mycroft 16685 Aug 24 16:22 __init__.pyc
-rw-r--r--  1 mycroft mycroft  9141 Aug 21 14:04 LICENSE.md
-rw-r--r--  1 mycroft mycroft   125 May 17 01:30 README.md
drwxr-xr-x  3 mycroft mycroft  4096 May 17 01:30 regex
-rw-r--r--  1 mycroft mycroft    52 May 17 01:30 requirements.txt
-rw-r--r--  1 mycroft mycroft     2 Aug 24 16:22 settings.json
drwxr-xr-x  3 mycroft mycroft  4096 May 17 01:30 test
drwxr-xr-x  3 mycroft mycroft  4096 May 17 01:30 vocab

Mycroft logs appears to live in /var/log, and I found the test console which also reproduces the issue:

python -m mycroft.client.text.main --quiet
tail -f /var/log/mycroft-*
vim /var/log/mycroft-skills.log

So, tracing the skill-weather failure gives an error mesage:

2017-08-24 16:03:58,236 - Skills - DEBUG - {"type": "recognizer_loop:utterance", "data": {"lang": "en-US", "session": "3c447d2c-1974-48a9-9625-c6c61f4ad80e", "utterances": ["what's the weather"]}, "context": null}
2017-08-24 16:03:58,280 - Skills - DEBUG - {"type": "WeatherSkill:CurrentWeatherIntent", "data": {"confidence": 0.5, "target": null, "intent_type": "WeatherSkill:CurrentWeatherIntent", "Weather": "weather", "__tags__": [{"end_token": 2, "start_token": 2, "from_context": false, "entities": [{"confidence": 1.0, "data": [["weather", "Weather"], ["Weather", "Concept"]], "key": "weather", "match": "weather"}], "key": "weather", "match": "weather"}], "utterance": "what's the weather"}, "context": {"target": null}}
2017-08-24 16:03:58,287 - requests.packages.urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai
2017-08-24 16:03:58,763 - requests.packages.urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 "GET /v1/owm/weather?q=Cramlington%2C+England%2C+United+Kingdom&lang=en HTTP/1.1" 200 451
2017-08-24 16:03:58,778 - requests.packages.urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai
2017-08-24 16:03:59,226 - requests.packages.urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 "GET /v1/owm/forecast/daily?q=Cramlington%2C+England%2C+United+Kingdom&lang=en HTTP/1.1" 200 1978
2017-08-24 16:03:59,237 - skill-weather__init__ - ERROR - Error: 'NoneType' object has no attribute 'to_JSON'
2017-08-24 16:04:05,698 - Display Manager (mycroft.client.enclosure) - DEBUG - Setting active skill to TimeSkill

This suggests to me either the HTTPS call is failing, and/or the skill isn't catching the return data.
I have seen some reports of issues with web configuration of custom locations (I've used the Mycroft.ai WWW settings to setup Cramlington, England), so I also tried an explicit US location picked from other register_vocab calls in the log - Austin:

2017-08-24 16:51:04,747 - Skills - DEBUG - {"type": "WeatherSkill:CurrentWeatherIntent", "data": {"confidence": 0.6666666666666666, "target": null, "intent_type": "WeatherSkill:CurrentWeatherIntent", "Weather": "weather", "Location": "austin", "__tags__": [{"end_token": 2, "start_token": 2, "from_context": false, "entities": [{"confidence": 1.0, "data": [["weather", "Weather"], ["Weather", "Concept"]], "key": "weather", "match": "weather"}], "key": "weather", "match": "weather"}, {"end_token": 4, "start_token": 4, "confidence": 1.0, "from_context": false, "entities": [{"confidence": 1.0, "data": [["austin", "Location"]], "key": "austin", "match": "austin"}], "key": "austin", "match": "austin"}], "utterance": "what's the weather in austin"}, "context": {"target": null}}
2017-08-24 16:51:04,753 - requests.packages.urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai
2017-08-24 16:51:05,287 - requests.packages.urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 "GET /v1/owm/weather?q=austin&lang=en HTTP/1.1" 200 444
2017-08-24 16:51:05,302 - requests.packages.urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai
2017-08-24 16:51:05,763 - requests.packages.urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 "GET /v1/owm/forecast/daily?q=austin&lang=en HTTP/1.1" 200 1989
2017-08-24 16:51:05,775 - skill-weather__init__ - ERROR - Error: 'NoneType' object has no attribute 'to_JSON'

So - pre-configured, or explicit locations give the same 'ERROR - Error: 'NoneType' object has no attribute 'to_JSON' in what is probably

I don't know if the installed skill code is the latest version in GitHub, but I think the error is thrown in '/opt/mycroft/skills/skill-weather/init.py':
https://github.com/MycroftAI/skill-weather
https://github.com/MycroftAI/skill-weather/tree/cd782186df0cb8bb51bc803f7253a3b3a9f4caaf

My thought is to backup the skill files and then start adding LOG.info() calls into the Python code to get a feel for where the error is occurring, but don't see other text in '/var/log/mycroft-skills.log' suggesting there may be a log level setting or another file.

Any ideas please?

Unit of measurement cannot be localized

It is not possible to localize unit measurement because it is hardcoded

./__init__.py:546:        # Config setting of 'metric' implies celsius for unit
./__init__.py:551:        # Config setting of 'metric' implies celsius for unit
./__init__.py:558:                return "celsius"
./__init__.py:560:        return system_unit == "metric" and "celsius" or "fahrenheit"

Asking for sunset time reads the dialog file name

Describe the bug
Mycroft reads the file name rather than using the dialog file to generate a response.

To Reproduce
Steps to reproduce the behavior:

  1. "Hey Mycroft, what time is sunset"
  2. Correct times are displayed
  3. Mycroft responds: "current sunset future-local"

Seems to be not joining the filename correctly

Changed words for rain and snow to another langauge and it still gives it to me in English

Hello! I am working on translating the weather skill to another language and I have changed the words for 'rain' to 'ruah' and 'snow' to 'vur' and MyCroft via text still gives me 'light snow' in English? I was expecting to get 'light vur'. I am including screenshots and I have changed the language in my mycroft.conf to the other language. Please let me know if there is anything else I need to do. Thank you!

screenshot from 2018-12-03 16-47-19
screenshot from 2018-12-03 16-47-45

Use celsius when metric system

End user wasn't able to change units the weather was reported in. See issue #2

  • Started using the global "system_unit" to determine appropriate unit (C or F)
  • Removed the usage of a "WeatherSkill.temperature" for units

sunset (and i would guess other timedates) wrongly adding tz

with asking the time of the sunset today i got a timestamp - directly taken from the response dict - of 1624390650 which converts to 22.6.2021, 21:37:30. (what is the appropriate time of the sunset here in germany) This would mean that what is sent is already an tz-aware timestamp.

Supposedly mycroft is adding tz to that timestamp resulting in a response of heute geht die sonne um elf Uhr siebenunddreißig unter (23:37; hopefully it doesn't mean 11:37 since this would be a whole other can of worms). The TZ is +2 so this would make sense

git usage

Hi - sorry to bother you, this might be a pure git noob issue, but I'm hoping you can help me anyway ...
This skill was not working for me in german, I read the error messages, found out that there are some intent-files missing, created them, commited them and tried to push them - but the push failed like below. I thought maybe msm/mycroft does not prepare the skill to do such things maybe using an anonymous user - so I moved the folder mycroft-weather.mycroft ai completely to a backup place ... next try:
I cloned this repo within my skills folder by git clone https://[email protected]/mycroftai/skill-weather
noticed, that the directory changed from mycroft-weather.mycroft to skill-weather, restarted mycroft, found the errors (again), copied the missing intent files from my backup, restarted mycroft, skill is working again, added and commited them and tried to push them like

pi@mycroft1:~/mycroft-core/skills/skill-weather $ git push origin master
Password for 'https://[email protected]': 
remote: Permission to mycroftai/skill-weather.git denied to s3ta.
fatal: unable to access 'https://[email protected]/mycroftai/skill-weather/': The requested URL returned error: 403

Noob thought: OK, maybe I am really not permitted to push to master - let's try branching ...

pi@mycroft1:~/mycroft-core/skills/skill-weather $ git checkout -b fix-lang-de-de
Zu neuem Branch 'fix-lang-de-de' gewechselt
pi@mycroft1:~/mycroft-core/skills/skill-weather $ git push origin fix-lang-de-de
Password for 'https://[email protected]':
remote: Permission to mycroftai/skill-weather.git denied to s3ta.
fatal: unable to access 'https://[email protected]/mycroftai/skill-weather/': The requested URL returned error: 403

same errors ... what am I missing? How can I contribute?

feature: get current weather for a OWM weather station

I am running my own weather station that reports current condition every 5 minutes to OpenWeathermap (requires a free API-key to create a Station-ID). I would like to ask Mycroft for the local weather and get the conditions of my weather station instead of the interpolated conditions for my region/city.

New intent for localweather: "Hey Mycroft, what is the local weather?"

Retrieve the current condition via OWM Station-API. API-Key and Station-ID is configured in settings (home.mycroft.ai)

Result: the latest measurement for Station-ID that is returned by OWM Station-API.

Asking for the weather this/next weekend

I'd like to ask questions like "What will the weather be this weekend?" and hear the forecasts for Saturday and Sunday spoken.

It looks like I can request each day individually. But when I'm making weekend plans, it makes more sense conversationally to request the weather in a batch, and to get back both forcasts at once, than it does to ask for each day individually.

Thanks!

Closing screen hangs on kde

Describe the bug
Mycroft tells the weather just fine but then hangs at "closing screen in 30 seconds ". This renders the screen unusable without hitting ALT+F4.

Expected behavior
A clear and concise description of what you expected to happen.

Log files
If possible, add log files from /var/log/mycroft/ to help explain your problem.
[skills.log](https://github.com/MycroftAI/skill-weather/files/7652197/skills.log) [enclosure.log](https://github.com/MycroftAI/skill-weather/files/7652198/enclosure.log) [bus.log](https://github.com/MycroftAI/skill-weather/files/7652200/bus.log) [audio.log](https://github.com/MycroftAI/skill-weather/files/7652202/audio.log) [voice.log](https://github.com/MycroftAI/skill-weather/files/7652203/voice.log)
You may also include screenshots, however screenshots of log files are often difficult to read and parse.

If you are running Mycroft, the Support Skill helps to automate gathering this information. Simply say "Create a support ticket" and the Skill will put together a support package and email it to you.

Environment (please complete the following information):

  • Device type: [ Raspberry Pi, ]
  • OS: [kde plasma bigscreen]
  • Mycroft-core version: [e.g. 20.08]
  • Other versions: [e.g. Adapt v0.3.7]

Additional context
Add any other context about the problem here.

Please think carefully about whether you have modified anything in Mycroft's code or configuration files. If so, can you reproduce this on a clean installation of Mycroft? Many "bugs" turn out to be non-standard configuration errors.

Prep for future update: don't pass 'lang=None' to LF functions

I'd fix it myself, if I didn't have so much going on. I've found one breaking change in the pending Lingua Franca refactor, which is this: explicitly passing lang=None to parsers and formatters will get angry.

I'm comfortable accounting for this in LF, by overriding None with the current default. But, if we do that, I'd still vote to slap a big ol' DeprecationWarning on it, because passing lang=None is kinda paradigm-defying. I think it was a (perfectly rational) kludge in the past.

(Note: explicitly passing lang='en_us' where the skill hasn't been localized is fine, but something's gonna need to happen (in skills or in core) to ensure that English is currently loaded. Otherwise, an exception will be raised complaining that English is not currently loaded. That's out of scope for this issue, except that those lang='en-us' calls don't need to be changed. Just the lang=None ones.

display issue kde bigscreen plasma

Describe the bug
Display is is not configured properly for kde bigscreen plasma and renders the os unusable.

I am running mycroft on bigscreen plasma and when asking the weather, mycroft displays the forecast for the week. The problem is it doesn’t display correctly at all on kde plasma bigscreen, and often requires a shutdown.

Can I disable the display and just get the voice response? That or if someone could direct me to the appropriate files to modify for proper display

`IMG_9100
To Reproduce
Steps to reproduce the behavior:
Go to kde bigscreen plasma, select mycroft console, ask fore the forecast.

Expected behavior
Verbal response alone, or a gui that works properly

Log files
If possible, add log files from /var/log/mycroft/ to help explain your problem.

You may also include screenshots, however screenshots of log files are often difficult to read and parse.

If you are running Mycroft, the Support Skill helps to automate gathering this information. Simply say "Create a support ticket" and the Skill will put together a support package and email it to you.

Environment (please complete the following information):

  • Device type: [e.g. Raspberry Pi,
  • OS: [kde bigscreen]
  • Mycroft-core version: [e.g. 20.08]
  • Other versions: [e.g. Adapt v0.3.7]

Additional context
Add any other context about the problem here.

Please think carefully about whether you have modified anything in Mycroft's code or configuration files. If so, can you reproduce this on a clean installation of Mycroft? Many "bugs" turn out to be non-standard configuration errors

.

Forecast does not account for timezone

I am in the US Central time zone. If it is Friday and I ask ‘MyCroft, what is the weather tomorrow’, I get the following

asking at 5:15 pm - The weather on Saturday is…
asking at 6:15 pm - The weather on Sunday is …

Looks like it is using UTC rather than the local date/time.

If I ask ‘What day is tomorrow’, MyCroft answers correctly at both times. seems to just be with the weather skill.

extract_date should be used

we should be able to request weather for any date inside a single intent by using the extract_date utility function

this is a better approach, covers more cases correctly, updates are made in core instead of on skill, translation is contained to a single file (but harder), requires less intents (reduces chance for intent collisions), and the code looks better in general

if the extract_date helper is part of core, shouldn't it be used in the official skills as a guide? :)

  • will it rain in the next 30 minutes?
  • what's the weather like in 5 hours?
  • how's the weather next friday?

all these and more would work out of the box

Bump pyowm to latest version

Weather skill's requirements.txt is currently fixed to pyowm==2.6.1 while pyowm is now at version 3.1. OWM introduced some interesting new features that are supported by pyowm 3.x, e.g. One Call API

In case there are specific reasons to stay with pyowm 2.x a version bump to 2.10-LTS should be considered. According to this timeline the pyowm 2.x long-term support will end 05/30/2021 (given that pyowm 3.0 was released on 05/30/2020)

extract_datetime issue

The Extract datetime will return None if no datetime is extracted. This will lead to issues with this skill in a number of locations. Lines L433, L510 and L537 among others.

these need to be replaced and made to work with the return of None instead of a tuple.

skill-weather returns incorrect max temperature if in UTC +x hours timezone

Description in object deviation format

  • using degrees C

  • located in Geelong (location as Newtown in home.mycroft.ai)

  • when I say "Hey Mycroft, what's the weather)

  • in the early hours of the morning (ie after midnight)

  • the response is consistently giving me the minimum and maximum temperatures together.

  • The minimum is correct, but the maximum is given as the minimum

Worked example

Today, Tuesday October 3rd, the Melbourne Australia forecast is 8 degrees C minimum, 22 degrees C maximum

  1. Hey Mycroft, what's the weather
  2. Display 6 C on display, "It's currently 6 degrees with a high of 6 and a low of 6"
  3. Repeat this for a city which has a UTC + xxx timezone
  4. "Hey Mycroft, what's the weather in Christchurch = correct response (also tried Wellington) <- both New Zealand, both correct
  5. "Hey Mycroft, what's the temperature in Brisbane" = bug is shown, reports min as max
  6. "Hey Mycroft, what's the temperature in Adelaide" = bug is hit, reports min as max
  7. "Hey Mycroft, what's the temperature in Sydney" = bug is hit, reports min as max
  8. "Hey Mycroft, what's the temperature in Darwin" = bug is hit, reports min as max
  9. "Hey Mycroft, what' the temperature in Perth" = bug is hit, reports min as max

Tried Jakarta, Indonesia - the next country over

  • "Hey Mycroft, what's the temperature in Jakarta" = bug is hit, reports min as max

Tried Kobe, Japan

  • Hey Mycroft, what's the temperature in Kobe" = works correctly

What other debugging should I do?

Error when asking: how windy is it

File "/opt/mycroft/skills/skill-weather/init.py", line 58, in build_query
params.get("query").update({"lang": self.lang})
AttributeError: 'NoneType' object has no attribute 'update'

Tempest Weather Station Support

Currently the weather skill function is dependent on OpenWeatherMap which I don't mind supporting and paying for. However having a fallback for this service would be helpful, also anyway its service is only as good as it meteorological data.

Weatherflow is currently working on releasing a weather station product for home, and/or business users world wide. It is called "Tempest Weather System" it utilises an advanced weather station with AI for providing an increasingly accurate forecast over time.

Mycroft AI's weather skill could do with being able to utilise this as an alternative and/or fallback weather data service. Which would also allow for as a result access to the hardware product's weather data.

This can be used for the weather forcast and/or announcements used by this skill and other skills.

API limit

Looks like we just hit the open weather maps API limit within a given time period:
https://jenkins.mycroft.team/job/19.02-skill-tester/39/console

Not sure exactly what that limit is but their site says: "We recommend making calls to the API no more than one time every 10 minutes for one location (city / coordinates / zip-code). This is due to the fact that weather data in our system is updated no more than one time every 10 minutes."

No city info in response

hey mycroft, when will it rain in the sun
light rain is expected on saturday

So, it appears it will, in fact, rain on the sun in just a few days. However, I assume this is because the location API found a match for a location who has sun in its name (such as maybe sun city or something like that). While this is ok, I'd at least expect it to say where it is going to rain on Saturday.

Dialog doesn't mirror the forecast on openweathermap

Maybe it's another case of "lost in translation", but i realized that the question "Is the weather going to be fine on Friday in {location}" is answered with "Sorry, the forecast {day} doesn't predict clear conditions for {location}" despite openweathermap predicts a "clear sky". API problem because of {location}, DE? My {location} name is destinct, to rule that out.

(running lang "de-de", tts google "de" btw)

Duplicated output of min/max temperature condition

Since release 19.02.0 I get strange output: after the weather forecast Mycroft says "min max". After figuring out that dialog-file min.max.dialog is missing for my language setting (de-de) now Mycroft gives me duplicated temperature conditions.

I found commit "Show high-low-page" where the corresponding changes have been made. Either some additional logic is missing there or not all *.weather.dialog files have been changed accordingly.

As far as I can see only current.local.weather.dialog has been changed. In total following files must be changed/created:

current.local.weather.dialog
current.weather.dialog
forecast.weather.dialog
forecast.local.weather.dialog
hour.weather.dialog
hour.local.weather.dialog
min.max.dialog

It should be considered that already eight languages are supported by this skill leading to at least 56 dialog files that must be changed and translated...

Different response when adding town in question

As discussed with @penrods on Mattermost, the questions "Hey Mycroft, what's the weather?" and "Hey what's the weather in town?" result in two different answers.

 what's the weather
 >> With a high of 84 and a low of 66, Eindhoven has clear sky and is currently 84 degrees.
 what's the weather in Eindhoven
 >> Right now, it's mist and 50 degrees, for a high of 50 and a low of 41 in eindhoven.

And also the forecast:

 what's the weather tomorrow
 >> Sunday's forecast is 84 for a high and 66 for a low
 what's the weather tomorrow in Eindhoven
 >> Sunday, eindhoven will have a high of 49 and a low of 41, with clear conditions

My setup: version 0.8.22 (Mycroft-core/dev) git-clone installed on Ubuntu 16.04LTS machine, running as debug only (I'm tackling voice later)

Location regex/adapt intent wont work

UPDATE

This is just a typo,

instead of self.location = message.data.get("location") it has to be
self.location = message.data.get("Location")

+ L 
- l

The optionally location lookup wont work with this call

No icon for "moderate rain"

Describe the bug
Just noticed the home screen only had the temperature and no icon.
Asking for the weather reported "moderate rain" and also had no weather icon.

Expected behavior
Assuming we are just missing some of the less used

Environment (please complete the following information):

  • Device type: Mark II
  • Mycroft-core version: Latest

'Day' is wrong when local time offset is more than the difference in current time and UTC time

#addatest

Given the local time offset from UTC is greater than the difference between local time and UTC time
When the users says "what is tomorrows weather"
Then "skill-weather" should reply with "tomorrow, the high will be 80 degrees"

Currently, the return text will say "today, the high will be....". It knows the current current day, but it seems to do some conversion during the data pull and the response is using the UTC day rather than the local time day.

Example - USA Central Time has a 6 hour time offset from UTC. Friday @ 8:00 pm Central Time is Saturday @ 2:00 am UTC time.

Asking for tomorrows weather (Saturday is tomorrow @ 8pm CST) the weather skill returns the correct weather, but states it as "Today's" weather (Saturday is today in UTC)

Nonetype Error: Can´t get weather on German PiCroft Installation

Log output:

 11:18:02.395 | INFO     |  2916 | __main__:handle_wakeword:67 | Wakeword Detected: hey mycroft
Playing WAVE '/home/pi/mycroft-core/mycroft/res/snd/start_listening.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
 11:18:04.890 | INFO     |  2916 | __main__:handle_record_begin:37 | Begin Recording...
 11:18:07.267 | INFO     |  2916 | __main__:handle_record_end:45 | End Recording...
 11:18:08.565 | INFO     |  2916 | __main__:handle_utterance:72 | Utterance: ['wie ist das wetter']
 11:18:08.998 | ERROR    |   698 | WeatherSkill | Error: 'NoneType' object has no attribute 'date'
Traceback (most recent call last):
  File "/opt/mycroft/skills/mycroft-weather.mycroftai/__init__.py", line 440, in handle_current_weather
    report = self.__populate_report(message)
  File "/opt/mycroft/skills/mycroft-weather.mycroftai/__init__.py", line 1274, in __populate_report
    if when.date() == today.date() and when.time() != today.time():
AttributeError: 'NoneType' object has no attribute 'date'
  ^--- NEWEST ---^

Where does bad Korean translation come from?

In my ko-kr/current.local.weather.dialog file I have:

현재 **{{condition}}**고 기온은 {{temp}}도입니다. 오늘의 최고 기온은 {{temp_max}}도, 최저 기온은 {{temp_min}}도입니다.

When I ask mycroft the weather, I get:

날씨가 어때?
현재 맑음고 기온은 6도입니다. 오늘의 최고 기온은 6도, 최저 기온은 0도입니다.

I don't find the string 맑음 anywhere in my code.

juyeon@ju:/opt/mycroft/skills/mycroft-weather.mycroftai$ grep -nHr 맑음 . | wc -l
0

It is not correct Korean in this context. It should be 맑. Is this coming from OWM ? Is there a way to override what they send ?

'what is temperature' only gives voice information

Mark II-pi4 DEV-Kit- latest 07-03 software
since the 'great weather' was merged - have not been able to get a visual on the current temperature.
[you have to ask 'what's the weather' to get a visual]

Gui screens not staying up long enough to rea

When I ask for today's weather, the first screen should be the current temp.
The second screen should show today's forecast.

Instead, both screens show, but only for less than 1 second and then continues to the weekly forecast.

I think that when just asking for the weather "today", there should only be the two screens shown, and they need to stay up long enough to read.

This happens every time today's weather is asked, in any form that I have tried.

Environment (please complete the following information):

  • Device type: RPi4
  • OS: KDE neon Unstable Edition (GNU/Linux 5.4.0-1050-raspi aarch64)
  • Mycroft-core version: 21.2.2

City location is still coming out in English

Hi!
I am working on Korean, but city location is still coming out in English as below:

오늘 날씨가 어때요?
 >> 최고 기온은 7도, 최저 기온은 0도이며, Bloomington은 clear sky고 현재 기온은 8도입니다.

Does anyone have suggestions how to fix this?

No translation of the temperature scales

Describe the bug
In weather messages, the temperature scale is not translated into the selected language.

To Reproduce
Steps to reproduce the behavior:

  1. Change language to Russian
  2. Ask for current weather few times
  3. Wait for message with scale
  4. See untraslated scale (celsius/fahrenheit):
>> Сейчас небольшой дождь и 11 градусов celsius.
>> Сейчас дождь и 51 градусов fahrenheit.

Expected behavior
Scales should be translated.

Environment:

  • Device type: Raspberry Pi
  • OS: Picroft
  • Mycroft-core version: dev

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.