MycroftAI / skill-homeassistant

Mycroft Skill/Integration for Homeassistant
GNU Lesser General Public License v3.0
114 stars 62 forks source link

Language issue #25

Closed iditude closed 4 years ago

iditude commented 4 years ago

Hello,

I'm trying to use the skill and it works perfectly in English. However in french (configured by "lang": "fr-fr", in mycroft.conf), no keywords work. For instance I use "allume XXX" which is the equivalent to "turn on XXX" (according to this https://translate.mycroft.ai/fr/mycroft-skills/translate/homeassistant-fr.po#search=allume&sfields=source,target&unit=134631&offset=0) but faced with a blank response "Sorry I don't understand".

Logs are below.

Anything I'm doing wrong to change language?

Thanks

 10:52:23.476 | DEBUG    |   675 | mycroft.skills.intent_service:handle_utterance:329 | Utterances: ['allume entree']
~~~~lls.intent_service:handle_utterance:349 | Padatious intent: {'name': 'mycroft-stop.mycroftai:reboot.intent', 'sent': 'allume entree', 'matches': {}, 'conf': 0.17207702686938922}
 10:52:23.584 | DEBUG    |   675 | mycroft.skills.intent_service:handle_utterance:350 |     Adapt intent: None
 10:52:23.592 | DEBUG    |   675 | mycroft.skills.padatious_service:handle_fallback:157 | Padatious fallback attempt: allume entree
 10:52:23.593 | INFO     |   675 | QuestionsAnswersSkill | Searching for allume entree
 10:52:23.597 | DEBUG    |   675 | mycroft.skills.mycroft_skill.event_container:add:146 | Added event: fallback-query.mycroftai:QuestionQueryTimeout
 10:52:23.648 | DEBUG    |   675 | WolframAlphaSkill | WolframAlpha query: allume entree
Removing event fallback-query.mycroftai:QuestionQueryTimeout
 10:52:23.658 | DEBUG    |   675 | mycroft.skills.mycroft_skill.event_container:add:146 | Added event: fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
 10:52:23.663 | DEBUG    |   675 | mycroft.skills.mycroft_skill.event_container:add:146 | Added event: fallback-query.mycroftai:QuestionQueryTimeout
 10:52:23.703 | DEBUG    |   675 | WolframAlphaSkill | translation: light entry
 10:52:23.704 | DEBUG    |   675 | WolframAlphaSkill | Non-question, ignoring: light entry
Removing event fallback-query.mycroftai:QuestionQueryTimeout
 10:52:23.749 | DEBUG    |   675 | mycroft.skills.mycroft_skill.event_container:add:146 | Added event: fallback-query.mycroftai:QuestionQueryTimeout
Removing event fallback-query.mycroftai:QuestionQueryTimeout
10:52:24.191 | INFO     |   675 | QuestionsAnswersSkill | Timeout occured check responses
 10:52:24.600 | DEBUG    |   675 | mycroft.skills.padatious_service:handle_fallback:157 | Padatious fallback attempt: allume entree
 10:52:30.103 | DEBUG    |   675 | urllib3.connectionpool | Starting new HTTPS connection (1): api.mycroft.ai:443
 10:52:30.468 | DEBUG    |   675 | urllib3.connectionpool | https://api.mycroft.ai:443 "GET /v1/device/aa930e2b-a455-40d8-840e-b25d3be1e668/skill/settings HTTP/1.1" 304 0
 10:52:30.475 | DEBUG    |   675 | mycroft.skills.settings:download:365 | No skill settings changes since last download
 10:53:07.251 | DEBUG    |   675 | urllib3.connectionpool | Starting new HTTPS connection (1): api.mycroft.ai:443
 10:53:07.622 | DEBUG    |   675 | urllib3.connectionpool | https://api.mycroft.ai:443 "GET /v1/device/aa930e2b-a455-40d8-840e-b25d3be1e668/setting HTTP/1.1" 304 0
 10:53:07.630 | DEBUG    |   675 | urllib3.connectionpool | Starting new HTTPS connection (1): api.mycroft.ai:443
 10:53:07.984 | DEBUG    |   675 | urllib3.connectionpool | https://api.mycroft.ai:443 "GET /v1/device/aa930e2b-a455-40d8-840e-b25d3be1e668/location HTTP/1.1" 304 0
  ^--- NEWEST ---^ 
iditude commented 4 years ago

Thanks a lot for that. I actually found the log level setting in the log which does the job nicely.

Update log here https://pastebin.com/ij2i08CD

The most interesting piece is that the command is recognised as such and sent to Home assistant skill but it does nothing...

2020-07-26 12:08:52.966 | DEBUG    |  3786 | mycroft.skills.intent_service:handle_utterance:334 | Utterances: ['allume cuisine']
2020-07-26 12:08:53.000 | DEBUG    |  3786 | mycroft.skills.intent_service:handle_utterance:354 | Padatious intent: {'name': 'homeassistant.tony763:turn.on.intent', 'sent': 'allume cuisine', 'matches': {}, 'conf': 0.11600905584696648}
2020-07-26 12:08:53.002 | DEBUG    |  3786 | mycroft.skills.intent_service:handle_utterance:355 |     Adapt intent: None
2020-07-26 12:08:53.012 | DEBUG    |  3786 | mycroft.skills.padatious_service:handle_fallback:168 | Padatious fallback attempt: allume cuisine

Any ideas?

THanks

gador commented 4 years ago

You are right, in the line:

2020-07-26 12:08:53.000 | DEBUG    |  3786 | mycroft.skills.intent_service:handle_utterance:354 | Padatious intent: {'name': 'homeassistant.tony763:turn.on.intent', 'sent': 'allume cuisine', 'matches': {}, 'conf': 0.11600905584696648}

padatious can't find any matches for your message (as seen by matches: {}). Probably caused by the language intent file.

(Theoretically it could also mean it can't find the entity "cuisine". Are you sure, your homeassistant installation has an entity named "cuisine" and that your token has access rights to "cuisine"?)

A thing you could try is, enter

allumes la cuisine

into the CLI. I found that padatious is pretty strict. If this works, it should be enough to update your language files (vocav/fr-fr/turn.on.intent) and alter the line:

allumes (le|la|l) {Entity}

to

(allumes|allume) (le|la|l|) {Entity}

Notice the last '|' in the second parentheses. This will allow an utterance like:

allume cuisine

as well as

allume la cuisine

as well as

allumes cuisine

This seemed to be a problem with my installation and let me to update a lot of language files..

Tony763 commented 4 years ago

@iditude @gador Ok, I switched my mycroft fo FR.

Padatious not foud your utterance as it is not in intent file. I updated files so check it now.

@gador: If you have any updated intent files for your language, send them as pr to my repo, please.

image

gador commented 4 years ago

Hi @Tony763 ,

I created a new PR in your repo. It also includes other work on the repo. If you feel that doesn't belong, feel free to delete those changes.

iditude commented 4 years ago

@iditude @gador Ok, I switched my mycroft fo FR.

Padatious not foud your utterance as it is not in intent file. I updated files so check it now.

@gador: If you have any updated intent files for your language, send them as pr to my repo, please.

image

Wooohooo !!! Rock and roll. This is working

Tony763 commented 4 years ago

@iditude Glad to hear!

Then there is last round for translation, if you have time. https://pastebin.com/TSmvzDwa

Tony763 commented 4 years ago

@gador Seems OK, merged.

iditude commented 4 years ago

@iditude Glad to hear!

Then there is last round for translation, if you have time. https://pastebin.com/TSmvzDwa

Here you go

Cheers

Ou est (le|la|l') {Entity}.
(Donne moi|Trouve) (la localisation|la position) de (le|la|l') {Entity}.

(Quelle est|Donne moi|dis moi) (le|la|l') (valeur|état|statut) du (thermostat|thermomètre) {Entity} (s'il te plait|).
(Quelle est|Donne moi|dis moi) (le|la|l') (valeur|état|statut) de {Entity} (s'il te plait|).

(Augmente|Monte) (le|la|l') (luminosité|intensité) de {{entity}}
(Augmente|Monte) (le|la|l') {{entity}}
(Change|Monte) (le|la|l') {{entity}} plus (lumineux|lumineuse|forte|fort)

(Baisse|Affaiblit) (le|la|l') (luminosité|intensité) de {{entity}}
(Baisse|Affaiblit) (le|la|l') {{entity}}
(Change|Baisse) (le|la|l') {{entity}} moins (lumineux|lumineuse|forte|fort)
Tony763 commented 4 years ago

@iditude sorry I forget one from automation.

(Activate|Fire|Call up|Trigger|Set) (the|) (automation|scene|script) {Entity}.

add (|the) {{entity}} to the (|shopping) list put (|the) {{entity}} in the (|shopping) list remind me to buy (|the) {{entity}}

ok, I have added the item to the list. ok, added the item. ok done.

Tony763 commented 4 years ago

@gador @Gotanius Hi, could one of You translate intent and dialog files for #35 and send them to me? Thank you

iditude commented 4 years ago

@iditude sorry I forget one from automation.

(Activate|Fire|Call up|Trigger|Set) (the|) (automation|scene|script) {Entity}.

add (|the) {{entity}} to the (|shopping) list put (|the) {{entity}} in the (|shopping) list remind me to buy (|the) {{entity}}

ok, I have added the item to the list. ok, added the item. ok done.

Here you are. Never knew we had shopping list in Home assistant!

(Active|Allume|Appelle|Déclenche|Règle) (le|la|l') (automatisation|scène|script) {Entity}

Ajoute (le|la|l') {{entity}} (à|dans) la liste (|de courses|d'achats)
met (le|la|l') {{entity}} (à|dans) la liste (|de courses|d'achats)
rappelle moi d’acheter (le|la|l') {{entity}}

D'accord, j'ai ajouté l'article à la liste.
D'accord, article ajouté
D'accord, c'est fait
gador commented 4 years ago

Hi @Tony763 , please see my PR for the translation and some fixes for the German language.

iditude commented 4 years ago

Hello,

Anything you need from us in terms of translation or testing?

Cheers

Tony763 commented 4 years ago

Hello, only if You know one of these languages: DA,ES,IT,NL,PT,SV :D

Currently I am waiting for approval from Mycroft devs. ;)

iditude commented 4 years ago

Unfortunately not!

Thanks for the update!