Domoticz voice recognition with Jasper

Client tools or tools that can connect with Domoticz. Tools for Windows, iOS, Android, Linux etc.

Moderator: leecollings

nlooije
Posts: 18
Joined: Wednesday 10 February 2016 14:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz voice recognition with Jasper

Post by nlooije »

Derik wrote:
What do you mean 'where do i go wrong'? what problem are you experiencing?
Jasper is not talking back...

You can also specify a duration: arecord -d 10 temp.wav
And how can i play this simple ..
I just read your PM, I cant reply for some reason....
Thomasdc
Posts: 133
Joined: Wednesday 11 March 2015 19:13
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Domoticz voice recognition with Jasper

Post by Thomasdc »

hi!

I am trying to install jasper on a RPI 2 but ive ran in to some problems..

i followed this explanation:
Grabbed a copy of "Raspbian Jessie Lite" from:

https://www.raspberrypi.org/downloads/raspbian/

Installed it on a Micro-SD card as per the instructions:

https://www.raspberrypi.org/documentati ... /README.md

Booted the image on a Raspberry Pi 2 model B, logged in, did

sudo su
raspi-config

in "raspi-config" I expanded the file system to take up the entire card, configured time zone, keyboard, etc.. Then I rebooted the Raspberry Pi 2 model B, did

sudo su
apt-get update
apt-get upgrade

Next I grabbed and ran the "jasper-installer.sh" script referred to here :


https://github.com/unixabg/raspi-helpers

This script does take several hours to run, but handles the downloading / installing of Jasper + all dependencies. Once the above is done you will need to create/tweak the ~/.jasper/profile.yml the details of which are described here:

http://jasperproject.github.io/document ... iguration/

Then you can just run Jasper.

Hope the above helps.


when i start following this:
wget https://raw.githubusercontent.com/unixa ... staller.sh

chmod +x jasper-installer.sh

Run the script and this can take several hours

~/jasper-installer.sh
after a moment i get the error:

Could not open requirements file: [Errno 2] No such file or directory: '/root/jasper/client/requirements.txt'
Storing debug log for failure in /root/.pip/pip.log

when i look i see the file
"root/jasper/client/requirements.txt" is there...


is there someone who can help me? or explain how ik can jasper get installed on a RPI 2 (that isnt to complicated)?

thanks!
sanderinozie
Posts: 3
Joined: Wednesday 25 November 2015 1:33
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz voice recognition with Jasper

Post by sanderinozie »

Maybe a stupid question, but I am kinda new to Domoticz and Raspberry.
Is it possible to run Jasper on the same Raspberry Pi as I run Domoticz on?
My CPU load and RAM load are low, so I would think that won't be the problem, only I cannot find any installation guide which wont format my SD card...
nlooije
Posts: 18
Joined: Wednesday 10 February 2016 14:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz voice recognition with Jasper

Post by nlooije »

when i start following this:
wget https://raw.githubusercontent.com/unixa ... staller.sh

chmod +x jasper-installer.sh

Run the script and this can take several hours

~/jasper-installer.sh
after a moment i get the error:

Could not open requirements file: [Errno 2] No such file or directory: '/root/jasper/client/requirements.txt'
Storing debug log for failure in /root/.pip/pip.log

when i look i see the file
"root/jasper/client/requirements.txt" is there...
Perhaps you need to run the command as root? I believe it says to run: 'sudo su' before the 'chmod +x' part. You can try: 'sudo ~/jasper-installer.sh'

I haven't installed it on a rpi2 (just running on rpi1 which works fine) and I don't want to get into troubleshooting Jasper installation and/or configuration problems here. I suggest you post your issue at the Jasper support forums. There is already a rpi2 poststhere which may be useful.
nlooije
Posts: 18
Joined: Wednesday 10 February 2016 14:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz voice recognition with Jasper

Post by nlooije »

sanderinozie wrote:Maybe a stupid question, but I am kinda new to Domoticz and Raspberry.
Is it possible to run Jasper on the same Raspberry Pi as I run Domoticz on?
My CPU load and RAM load are low, so I would think that won't be the problem, only I cannot find any installation guide which wont format my SD card...
Yes, it is exactly what i do on my rpi1; It increases the load somewhat but it works well for me.
You can compile Jasper from source, this takes some time but it allows you to use a Domoticz image on the SD card and install Jasper along side it. You can follow the manual installation here. If you have the Domoticz image on the SD card you don't need to the 'burn Raspbian image onto SD card' part and you can continue with 'configure Raspbian'.
Thomasdc
Posts: 133
Joined: Wednesday 11 March 2015 19:13
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Domoticz voice recognition with Jasper

Post by Thomasdc »

Hi,

I installed jasper on a RPI B and now its working.. but the domoticz integration isnt working
in the 'profile.yml' file i entered this:

domoticz:
server: http://ip_domoticz:port/
username:
password:

(no username/password is set)


when i try 'jasper, turn on the bed light'

i see:
INFO:client.stt:Transcribed: (u'TURN ON THE BACKLIGHT', u'TURN ON THE BED LIGHT', u'TURN ON THE BACK LIGHT', u'TURN ON THE RED LIGHT', u'TURN ON THE BAT LIGHT')

so i presume it recognized what i said..

but nothing is happening

in domoticz the switch is named 'bed light'

am i missing something?

Thanks!
nlooije
Posts: 18
Joined: Wednesday 10 February 2016 14:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz voice recognition with Jasper

Post by nlooije »

Jasper will always transcribe what you say but that doesn't mean that the Domoticz module recognized the transcription or that the module is working at all.

Several things which you can try:
1. Remove the trailing '/' in the server_ip, i see that it is incorrect in the documentation, i will fix that (thx)
2. Do you see anything in the terminal about skipping the Domoticz module? If not then in the transcribtion as above if the module didn't understand what you meant you should get something along the lines of 'That specific light is not defined'.
3. 'Bed light' as a name for a light switch may not work well yet because of the way the module checks for the devices; try for now either to define:
a. a light switch just called 'Bed' (so no 'light' included)
b. (to make it easier for the module) a Roomplan such as 'Bed' with a light switch 'Bed'.

I understand point 3 is a bit convoluted and it would be nice to just say 'turn on bed light'. I am working on it getting fixed. You could really help, if you could make a list of phrases which currently don't work as you expect them to and what their result should be. Any help will ofcourse be credited on the GH page.
Thomasdc
Posts: 133
Joined: Wednesday 11 March 2015 19:13
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Domoticz voice recognition with Jasper

Post by Thomasdc »

Hi!

Thanks for the reply,

I don't see anything in the terminal about the domoticz module.

Can i test if its working?
i changed the device name from 'Bed light' into 'Bed'

But it made no difference,
i also added a roomplan 'bed' and added the switch to it, but that didnt help neither,

this is the feedback i get from the terminal:
INFO:client.stt:Transcribed: (u'TURN ON BED LIGHT', u'TURN ON BACKLIGHT', u'TURN ON RED LIGHT', u'TURN ON THAT LIGHT', u'TURN ON THE LIGHT')
/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:120: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/late ... ormwarning.
InsecurePlatformWarning


When i watch in the modules:


pi@raspberrypi ~/jasper/client/modules $ ls
Birthday.py HN.pyc Joke.pyc News.py Time.pyc
Birthday.pyc __init__.py Life.py News.pyc Unclear.py
Gmail.py __init__.pyc Life.pyc Notifications.py Unclear.pyc
Gmail.pyc Jasper-Domoticz MPDControl.py Notifications.pyc Weather.py
HN.py Joke.py MPDControl.pyc Time.py Weather.pyc


i see that "Jasper-Domoticz" is there..

I am probably still missing something or did something wrong
nlooije
Posts: 18
Joined: Wednesday 10 February 2016 14:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz voice recognition with Jasper

Post by nlooije »

In the steps in the documentation where:
cd <path to jasper/client/modules>
git clone https://github.com/nlooije/Jasper-Domoticz.git .
you probably forgot to include the '.' This downloads the contents of Jasper-Domoticz folder into <path to jasper/client/modules>. If you omit the '.' then it downloads it into its own folder 'Jasper-Domoticz' but since there is no '__init__.py' file included Jasper fails to recognize the folder as a module. Solution; copy 'Domoticz.py' from the Jasper-Domoticz folder into where all the other modules are (<path to jasper/client/modules>) or make a file '__init__.py' in the Jasper-Domoticz folder. (perhaps i will add this to the repo anyway to forestall these situations in the future.
Thomasdc
Posts: 133
Joined: Wednesday 11 March 2015 19:13
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Domoticz voice recognition with Jasper

Post by Thomasdc »

nlooije wrote:In the steps in the documentation where:
cd <path to jasper/client/modules>
git clone https://github.com/nlooije/Jasper-Domoticz.git .
you probably forgot to include the '.' This downloads the contents of Jasper-Domoticz folder into <path to jasper/client/modules>. If you omit the '.' then it downloads it into its own folder 'Jasper-Domoticz' but since there is no '__init__.py' file included Jasper fails to recognize the folder as a module. Solution; copy 'Domoticz.py' from the Jasper-Domoticz folder into where all the other modules are (<path to jasper/client/modules>) or make a file '__init__.py' in the Jasper-Domoticz folder. (perhaps i will add this to the repo anyway to forestall these situations in the future.

That was the problem indeed!
Thanks!!

But i copied the "Domoticz.py" into the modules folder, because when there is another "'__init__.py'" file in the Jasper-Domoticz folder, Jasper was answering 2 times.. i dont know if that was the reason or if it was running 2 times..
But for now its working, i will gently experiment with it.

one thing that would be nice to integrat is to be able to set dimmer values by voice :)
if you dont have dimmers in your domoticz (you can maybe add an dummy dimmer to experiment, or if i can i want to give it a try to test it out for you.

Big thanks!
nlooije
Posts: 18
Joined: Wednesday 10 February 2016 14:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz voice recognition with Jasper

Post by nlooije »

Thats weird :) I will need to check that out...
You did not by any chance have both Domoticz.py in the modules folder and in its own Jasper-Domoticz folder with an __init__.py?
Because then Jasper would load the module twice, which would explain why you hear Jasper answer twice.

i will have a look tonight if i can integrate dimming values. Do you want specific percentages like "set bed light to 10%" (for some romantic lighting :)) or do you mean values like "reduce bed light by half" or something?
Thomasdc
Posts: 133
Joined: Wednesday 11 March 2015 19:13
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Domoticz voice recognition with Jasper

Post by Thomasdc »

By Percentages its easier to use (and to implement) i think.
nlooije
Posts: 18
Joined: Wednesday 10 February 2016 14:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz voice recognition with Jasper

Post by nlooije »

Thomasdc wrote:By Percentages its easier to use (and to implement) i think.
I have a dev version ready for the dimming feature.
Using this version you should be able to dim a light switch using a phrase like: 'Set bedroom light to fifty percent'
For some reason the dummy switches in Domoticz don't work well and i wasn't able to get them working, but the JSON calls succeed so i am relatively confident it works if you have working dimmers. Could you give it a field test? that would be great.

Note from the dev-tree documentation that there is a python requirement you need to install before you can use the module with dimming.
User avatar
heggink
Posts: 972
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: Domoticz voice recognition with Jasper

Post by heggink »

Any updates recently? Testing it (really like the idea) but temperature response says "trouble with this operation, pls try again later". How does the thermometer command work> Would be nice to voice control my NEST :-)
Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
toreandre
Posts: 91
Joined: Tuesday 19 January 2016 12:51
Target OS: -
Domoticz version:
Contact:

Re: Domoticz voice recognition with Jasper

Post by toreandre »

Just installed Jasper and i am trying to get it to work with Domoticz but i get this error:

Code: Select all

WARNING:client.brain:Skipped module 'Jasper-Domoticz' because it misses the WORDS constant.
EDIT: I got past this error after a reboot, but now i get "That spesific scene/group is not defined" on every command
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests