We have moved at community.getvera.com

Author Topic: 2nd Genaration H@L - Android Only Voice Recognition for Vera  (Read 61210 times)

Offline RichardTSchaefer

  • Moderator
  • Master Member
  • *****
  • Posts: 10091
  • Karma: +764/-143
Re: 2nd Genaration H@L - Android Only Voice Recognition for Vera
« Reply #105 on: May 31, 2015, 09:41:30 am »
I will look into it ...

I am planning to add the option to activate HAL with a user defined phrase like:

OK Vera  or   OK HAL

It will stay active for a user specified amount of time after the last request.
After that you can say OK HAL again to get its attention.

So it will quit trying to interpret things when you are not actively talking to it.

I think I will also add a user specified phase to stop it from listening ... until requested again ...
Something like OK Vera stop listening After that you will have to get its attention again with OK Vera.

So you will have 3 operating modes:
1) Open Mike Off .... 
    OK Vera will listen for one request
2) Open Mike On ... no time out
    Hal will be listening ... can stop it with OK Vera Stop Listening and restart it with OK Vera
3) Open Mike with a timeout
    You will need to say OK Vera to get it's attention.  It will continuously listen for the specified time after the last command.
     Then will require you to get's its attention again.





Offline bucko

  • Hero Member
  • *****
  • Posts: 659
  • Karma: +27/-9
Re: 2nd Genaration H@L - Android Only Voice Recognition for Vera
« Reply #106 on: June 01, 2015, 02:39:33 am »
Hi Richard,

I wanted to give Hal a go but I cannot find it on Google Play Store. I searcherd, Vera, H@L, Hal. Your app does not show up???

Any ideas?

Vera 3, 40+ Fibaro relays & dimmers, IPUX cams, Elk M1 Gold, M1XEP, M1SP, XVOR, M1RB, Elk124, Monoprice HDMI matrix & 6 zone amp, Denon AVR, Panasonic A8000, BI DV,On Controls

Offline bucko

  • Hero Member
  • *****
  • Posts: 659
  • Karma: +27/-9
Re: 2nd Genaration H@L - Android Only Voice Recognition for Vera
« Reply #107 on: June 01, 2015, 03:08:29 am »
Hi Richard,

I wanted to give Hal a go but I cannot find it on Google Play Store. I searcherd, Vera, H@L, Hal. Your app does not show up???

Any ideas?

I found it. Needed to search "HAL and VERA"


Vera 3, 40+ Fibaro relays & dimmers, IPUX cams, Elk M1 Gold, M1XEP, M1SP, XVOR, M1RB, Elk124, Monoprice HDMI matrix & 6 zone amp, Denon AVR, Panasonic A8000, BI DV,On Controls

Offline tyfoon

  • Full Member
  • ***
  • Posts: 167
  • Karma: +0/-0
Re: 2nd Genaration H@L - Android Only Voice Recognition for Vera
« Reply #108 on: June 14, 2015, 05:04:28 am »
I'm running this on a Nexus 7 (1e gen) and after adding some phrases to the dictionary it keeps on crashing (directly after startup). I also changed idle timeout (leaving it empty) so maybe that's what makes it crash. (I have send the bug report).

Some other Q's

As I'm Dutch, my device names have Dutch names. If I leave Androids voice recognition in English it does not understand the devices (which makes sense) when I switch Android to Dutch all the other logic is not understood and I need to build a complete new dictionary basically for every variation that is possible as it will not understand all the wildcards and parameters (for example three dictionary items for light on, light off, light status). Is that correct?

When I'm in always on listening mode it picks up only the first command and will execute it. It will then switch to the status page where it stays. Any other command is not being picked up. Any ideas?

Offline RichardTSchaefer

  • Moderator
  • Master Member
  • *****
  • Posts: 10091
  • Karma: +764/-143
Re: 2nd Genaration H@L - Android Only Voice Recognition for Vera
« Reply #109 on: June 14, 2015, 08:17:49 am »
Please send logs for problems ... I will check.

The dictionary was meant for words ...  Not phrases ...
Please send me your dictionary file.    I will see what I can do.

You may want to try changing the grammar rules for Dutch. Find the H@l directory on your nexus. You will find your dictionary their. There is also a Reference directory.

Take a look at the Semantics.config file.
If you place a modified version of this file in the parent directory ... It will use it. You can replace some of the command name with dutch names. Let me know if you need some help understanding the file.
You can replace lines or just add new lines.
I would suggest modifying one line at a time to start with.

H@l need to restart to see the new file. Keep the background time real short like 1 minute. Then it will quit quickly after closing the app.

Offline tyfoon

  • Full Member
  • ***
  • Posts: 167
  • Karma: +0/-0
Re: 2nd Genaration H@L - Android Only Voice Recognition for Vera
« Reply #110 on: June 14, 2015, 09:32:16 am »
Thanks for the fast response! What about the last point (only can issue one command)?

Offline RichardTSchaefer

  • Moderator
  • Master Member
  • *****
  • Posts: 10091
  • Karma: +764/-143
Re: 2nd Genaration H@L - Android Only Voice Recognition for Vera
« Reply #111 on: June 14, 2015, 10:44:04 am »
Send the log

Offline tyfoon

  • Full Member
  • ***
  • Posts: 167
  • Karma: +0/-0
Re: 2nd Genaration H@L - Android Only Voice Recognition for Vera
« Reply #112 on: June 14, 2015, 01:39:04 pm »
Richard, not sure how you want the Android log. It's not something I regularly do. Do you have a preferred way?

I have attached the dictionary (renamed to txt)

On the localisation; It seems that are several ways to approach this;

- If I set the voice reco in Android to Dutch I will need to create a dictionary 'translating' my dutch into english commands. Then H@L will execute the command and the response is a dutch voice trying to speak english[/li][/list]
- Alternatively I leave all in english (in android) and see how english voice picks up my dutch words and use these in the dictionary
- Lastly I could change my device names and rooms to english names (looking like the simplest solution) assuming these changes don't create issues in other scenes/plegs/imperihome

Anny suggestions or am I missing an alternative?
« Last Edit: June 14, 2015, 01:59:13 pm by tyfoon »

Offline RichardTSchaefer

  • Moderator
  • Master Member
  • *****
  • Posts: 10091
  • Karma: +764/-143
Re: 2nd Genaration H@L - Android Only Voice Recognition for Vera
« Reply #113 on: June 14, 2015, 06:42:29 pm »
From the debug settings there is an option to mail the log file.

The log file is in the H@l directory the same as the dictionary. So you can easily mail it to me directly as well as delete it when you want to start with a new log.

There is another option I described above. H@l was designed to be multi-lingual.
Editing the files as I described above will allow you to define the semantic rules in your native language.

To process the semantics I need to identify each word. When you put a phrase in the dictionary it treats the entire phrase as a single word ... I need to split the words when I extract from the dictionary.

This is a little complicated because the dictionary substitution and the fuzzy logic is in recursive/backtracking algorithm. There are some design issues to allow the number of words to change during the semantic matching logic.

But if I did this you could have your own word macros ...where a single word could be a dictionary defined command ... Kind of what you where trying to do.

Offline tyfoon

  • Full Member
  • ***
  • Posts: 167
  • Karma: +0/-0
Re: 2nd Genaration H@L - Android Only Voice Recognition for Vera
« Reply #114 on: June 15, 2015, 05:10:30 pm »
Hi, pls find attached debug log. Issue: with open mike I can issue one command only or if I'm lucky two or three. It stays in the results page but just stops listening.


Offline vosmont

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 687
  • Karma: +60/-8
Re: 2nd Genaration H@L - Android Only Voice Recognition for Vera
« Reply #115 on: July 03, 2015, 05:26:36 am »
Hello RichardTSchaefer,

I already have a remote system with voice recognition installed (S.A.R.A.H : http://blog.encausse.net/s-a-r-a-h/), but I wanted to test another approach, which seems to work without too much configuration concerning the devices of the Vera.

The app installation is OK (from the Google Play Store) and the voice recognition engine is working well in French.
But as H@L seems to be not localized, I can't really use it.

I'm on a Nexus 7 and I tried to find the dictionary files, but without success.

Besides, I've got some questions :
- Is it possible to restrain the devices usable by the tablet ? (for example, just the devices in the kitchen for the tablet in the kitchen)
- Is it possible to do an action on several devices at the same time ? (for example, switch on all the lights of the lounge)

Offline RichardTSchaefer

  • Moderator
  • Master Member
  • *****
  • Posts: 10091
  • Karma: +764/-143
Re: 2nd Genaration H@L - Android Only Voice Recognition for Vera
« Reply #116 on: July 03, 2015, 09:23:09 am »
Quote
But as H@L seems to be not localized, I can't really use it.
It is setup to be localized ... a few hard coded strings remain. But I have not actually localized the config files.
If you are interested in doing the localization I can talk you through the how to make the changes.

Find the files (on your Android) in the directory:
               H@l/Reference

You might try to customize the "SwitchCmd" in the file Semantics.config to see how well it will work.
Any modified file needs to be placed in the  H@l directory.

To Localize the Help file you would need to change:
               H@l/OrigHelp.html


Quote
- Is it possible to restrain the devices usable by the tablet ? (for example, just the devices in the kitchen for the tablet in the kitchen)
I do not support this at this time. It does support the constraint:
             Turn on SomeLight in the kitchen

Quote
- Is it possible to do an action on several devices at the same time ? (for example, switch on all the lights of the lounge)
Yes,
            Turn on all Lights in the lounge

Offline vosmont

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 687
  • Karma: +60/-8
Re: 2nd Genaration H@L - Android Only Voice Recognition for Vera
« Reply #117 on: July 09, 2015, 03:41:26 am »
Thanks RichardTSchaefer,

The directory "H@L" was not available under Windows 7 via USB connection (Nexus 7).
With an Android app, I've found it.

I've begun to modify the Reference file, but without success for the moment.
I will report here when I will have more informations.

Offline RichardTSchaefer

  • Moderator
  • Master Member
  • *****
  • Posts: 10091
  • Karma: +764/-143
Re: 2nd Genaration H@L - Android Only Voice Recognition for Vera
« Reply #118 on: July 09, 2015, 09:56:00 am »
When you modify the file ... you need to move the modified file to it's parent directory.

Then restart the app ... Quickest way (since it has background processes that can stick around awhile) is to use the Android App manager and do a force stop.

You will start with the Semantics.config file.

I would try something simple like the SwitchCmd
For french you might change:
Code: [Select]
SwitchCmd:<1;on:1|off:0> <0;Switch*|Dimmer*|PLTS*|VirtualSwitch*|MultiSwitch*>
to:
Code: [Select]
SwitchCmd:<1;allumer:1|?teindre:0> <0;Switch*|Dimmer*|PLTS*|VirtualSwitch*|MultiSwitch*>

If people customize the files ... they can send them back to me ... and I will integrate in future releases.

Then you would be able to say:
Code: [Select]
S'il vous pla?t allumez la lumi?re de bureau
allumer would match allumez via fuzzy logic ... the switch name would be   lumi?re de bureau

Sorry about the spelling ... the forum does not like me entering various accented characters.
« Last Edit: July 09, 2015, 10:01:40 am by RichardTSchaefer »

Offline vosmont

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 687
  • Karma: +60/-8
Re: 2nd Genaration H@L - Android Only Voice Recognition for Vera
« Reply #119 on: July 09, 2015, 11:42:04 am »
Thanks, I will try this evening (in France  ;D)