Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[actiontemplatehli] Initial contribution #12260

Merged
merged 23 commits into from
Jun 19, 2022
Merged

Conversation

GiviMAD
Copy link
Member

@GiviMAD GiviMAD commented Feb 11, 2022

NOTE: This interpreter was renamed from 'opennlphli' to 'actiontemplatehli' to avoid confusion.
This add-on adds an human language interpreter powered by openNLP that allows the user to define their own actions to read from items or send commands to them. Also supports to configure a fallback interpreter, so you can use this one just to complement another.
Aims to be compatible with all languages and assumes the action templates are written in the configured openHAB language.
Supported feature list and samples are provided on the readme.
I hope that the community find it useful, for me is a solution for the custom commands I wanted to add to the standard interpreter.

@GiviMAD GiviMAD requested a review from a team as a code owner February 11, 2022 00:10
@lolodomo lolodomo added new voice work in progress A PR that is not yet ready to be merged labels Feb 11, 2022
@GiviMAD GiviMAD force-pushed the nlpinterpreter branch 12 times, most recently from ae9b4fa to 6065ed7 Compare February 18, 2022 14:30
@GiviMAD
Copy link
Member Author

GiviMAD commented Feb 18, 2022

@lolodomo I think the initial version is ready in case you want to give it a try, for me it work pretty well using Spanish.
I will add a post on the forum tomorrow to see if someone is interested on going testing it.
I just need to add some rule actions to allow to take advance of the interpreter features from there.
Also I will try to add some tests before removing the WIP.
Also I think this should be changed for the non response mode to work correctly openhab/openhab-core#2780

@GiviMAD
Copy link
Member Author

GiviMAD commented Feb 18, 2022

I think is not possible to expose actions from this kind of add-on, I will let that for the future.

Signed-off-by: Miguel Álvarez Díez <miguelwork92@gmail.com>
@GiviMAD GiviMAD changed the title [WIP][opennlphli] initial contribution [actiontemplatehli] initial contribution Feb 22, 2022
@GiviMAD
Copy link
Member Author

GiviMAD commented Feb 22, 2022

when you have time, it's ready for review!

@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/some-new-voice-add-ons-porcupineks-googlestt-watsonstt-voskstt/133500/1

Signed-off-by: Miguel Álvarez Díez <miguelwork92@gmail.com>
@GiviMAD
Copy link
Member Author

GiviMAD commented Feb 24, 2022

@lolodomo, can you remove the work in progress label? Thank you in advance.

@lolodomo lolodomo removed the work in progress A PR that is not yet ready to be merged label Feb 25, 2022
@GiviMAD
Copy link
Member Author

GiviMAD commented Mar 4, 2022

I have updated how getSupportedLocale works, and renamed the 'ruleMode' option to 'silence'.

Let me know whenever you have time to start reviewing this one, and thanks for the effort.

@GiviMAD
Copy link
Member Author

GiviMAD commented Jun 17, 2022

Another difficulty is that for requesting the temperature in the bedroom, in French we have at least 2 natural ways to request it, either "quelle est la température dans la chambre ? " and "quelle température fait-il dans la chambre ? ". If my item label is "température dans la chambre", I don't think there is a way to make the current interpreter matching my second request.

For this kind of situation I think you can use an action that matches groups with tag 'location' and filter the member targets by another tag that is only on the temperature items. This way the itemLabel will be the group name (room name).

@GiviMAD
Copy link
Member Author

GiviMAD commented Jun 17, 2022

I will try playing with this interpreter next weekend.
IMHO, something important is missing. Everything is mainly based on items label. The problem is that, due to UI constraints on mobile phones, the item label you define is generally a short label and not the one you will use when speaking. As an example, for temperature in the bedroom, my item label could be in French "Température chambre" but when speaking I will use "température dans la chambre". This was solved with other voice assistants (google and Amazon) with the ability to define for each item the label to consider by the assistant (replacing the OH label). I believe we should have this feature also for this interpreter.

Right now you can add synonyms to the items and those will be also considered as valid values for the itemLabel placeholder.

Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
@lolodomo
Copy link
Contributor

Right now you can add synonyms to the items and those will be also considered as valid values for the itemLabel placeholder.

Ok, will try that.

@lolodomo
Copy link
Contributor

lolodomo commented Jun 18, 2022

There are still few cases where you use a method parameter to set it to a new value inside the method.
Could you fix these few cases ?

Except that, I will have to check again my old review comments (mainly relative to documentation and settings) and make if possible few tests.
I think we are in time for a possible merge tomorrow.

GiviMAD added 2 commits June 18, 2022 14:09
Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
@GiviMAD
Copy link
Member Author

GiviMAD commented Jun 18, 2022

There are still few cases where you use a method parameter to set it to a new value inside the method. Could you fix these few cases ?

I didn't have that warning enabled on the IDE.
Must be corrected now.
Let me know for anything else.

@GiviMAD GiviMAD requested a review from lolodomo June 18, 2022 12:36
@GiviMAD
Copy link
Member Author

GiviMAD commented Jun 19, 2022

@lolodomo, is there something pending in this one?

@lolodomo
Copy link
Contributor

lolodomo commented Jun 19, 2022

@lolodomo, is there something pending in this one?

Just one improvement to do in the documentation and a question to answer.

I will not have time to test it today. I will merge today as soon as you will give a feedback to these 2 last comments.
I will probably then test it during the next week.

Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
GiviMAD added 2 commits June 19, 2022 12:44
Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
@GiviMAD GiviMAD requested a review from lolodomo June 19, 2022 11:23
Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
@lolodomo
Copy link
Contributor

Thank you for the tests.

@GiviMAD
Copy link
Member Author

GiviMAD commented Jun 19, 2022

Thank you for the tests.

Never added tests in a binding before, but they were really useful for me while implementing the latest features.

@GiviMAD GiviMAD requested a review from lolodomo June 19, 2022 11:30
Copy link
Contributor

@lolodomo lolodomo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you

@lolodomo lolodomo merged commit daea9ae into openhab:main Jun 19, 2022
@lolodomo lolodomo added this to the 3.3 milestone Jun 19, 2022
leifbladt pushed a commit to leifbladt/openhab-addons that referenced this pull request Oct 15, 2022
* [actiontemplatehli] initial contribution

Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
andan67 pushed a commit to andan67/openhab-addons that referenced this pull request Nov 6, 2022
* [actiontemplatehli] initial contribution

Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
andrasU pushed a commit to andrasU/openhab-addons that referenced this pull request Nov 12, 2022
* [actiontemplatehli] initial contribution

Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
Signed-off-by: Andras Uhrin <andras.uhrin@gmail.com>
psmedley pushed a commit to psmedley/openhab-addons that referenced this pull request Feb 23, 2023
* [actiontemplatehli] initial contribution

Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
nemerdaud pushed a commit to nemerdaud/openhab-addons that referenced this pull request Feb 28, 2023
* [actiontemplatehli] initial contribution

Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants