[CODE] Map House + scheduler + Speech recognition + stats

Moderator: Telldus

Skogsmulle
Posts: 14
Joined: Fri Mar 17, 2023 9:45 am

Re: [CODE] Map House + scheduler + Speech recognition

Post by Skogsmulle »

Nice work with the interface.

Is it possible to get the Speech recognition on a windows computer working against eventghost or is't to much diffrent codes?

Best regards!
stezzle
Posts: 1
Joined: Fri Mar 17, 2023 9:45 am

Re: [CODE] Map House + scheduler + Speech recognition

Post by stezzle »

Hey Manticus,
Firstly, Congratulations, This is a pretty awesome project! I am fairly new to webservers & PHP so it took me a while to get your project working however I have now managed to get this running on an ubuntu server with a Telldus TS001 (after a lot of messing around with oauth) however Ihave a few questions and Im facing a few small issues that hopefuly you or another forum user may be able to help out with?

I have added some of my Telldus-Live devices in config.php in place of the devices on your map/canvas which I can control from the index.php.

However, I get a scheduler error when creating events in the scheduled tasks page.

The log shows :
Monday 28 January 2013, 20:57:53 (UTC+0000) [Error] Can't add temporary scheduler in 5 minutes to "on" device : Pebble Lamp
I think it may be permissions related. I have "chowned" the whole root directory of the site to www-data, is this correct? I have also chmod'd all files in the directory to 755 however it didnt help.

The voice recognition icon shows and works in chrome however it doesnt seem to recognize any of the voice commands I give it, I think it may possibly permissions related or it does not recognize my voice but Im not sure.

EXAMPLE:
I have a device in Telldus-Live called "Pebble Lamp" so I have tried "Turn on Pebble Lamp" and "Start Pebble Lamp" but these voice command do not seem to work.
Do I have to add or change any files in the /voice/ folder?

Any help would be very much appreciated as I would really like to get this fully working in my house!

Thanks in advance / Merci beaucoup
Manticus2
Posts: 108
Joined: Fri Mar 17, 2023 9:45 am
Location: France - Bordeaux
Contact:

Re: [CODE] Map House + scheduler + Speech recognition

Post by Manticus2 »

Hello all !

In first part :
I have updated the package so if you have already downloaded the zip file you will be happy to see new features which are added :)

In this upgrade you have :
- optimization of somes parts of code
- adding context menu on right click to execute one action now or to add a scheduler.
- adding statistics of temperatures and humidity

You can use "Meld" software to see differences betwen your version and the last version that just downloaded
don't forget to save your personal files :
- map.php
- cascade-events.php
- config.php (edit this file manually)
- scheduler.php (edit this file manually)

In second part :

Skogsmulle : This dev is only for linux. If you want to have the Speech recognition on windows I think the best should be using a kinect (of xbox but with USB adaptator) but you need knowledge in development...


stezzle : Thank you very much for congratulations :)
for your problem of scheduler task : the error log is write in /other/index-timer.php at the line 40.
it's because the function "setJobSchedulerCountDown()" has failed.
This function is in /telldus_connect/class_telldus_live.php at line 273 (in the new package)
if this function failed, it's because the return of the function setJobScheduler() is an error returned by the API

in first, check if you don't have a php error in /var/log/apache2/error.log
if you can use line command you can have error in live with this command :

Code: Select all

tail -f /var/log/apache2/error.log
after that if you don't have the solution :
you need to know what's the parameters of this function when it's failing.
So juste before the line 290 which contain :

Code: Select all

$response = $this->setJobScheduler('', $deviceId, $method[0], $hour, $minute);
add :

Code: Select all

echo  'setJobScheduler is called with parameters : '.$deviceId.' ; '.$method[0].' ; '.$hour.' ; '.$minute;


for your problem of speech recognition :
you need to start processes which listen files in cascade and and it's not easy !
I will search if one error is in the tutoriel but I don't have the time now ...

did you do correctly this steps with your personal values :
Manticus2 wrote: Create the file /etc/init.d/telldus-listener with the content :

Code: Select all

cd /var/www/xxxxxx/voice && ./3_listener YOUR_PHPSESSID
Give possibility to execute this file in starting your system :

Code: Select all

sudo chmod +x /etc/init.d/telldus-listener
Add in /etc/rc.local before the line "exit 0" :

Code: Select all

/etc/init.d/telldus-listener
Go in root folder and give a write access to files and folders :

Code: Select all

sudo chown www-data:www-data -R parameters
sudo chown www-data:www-data voice/2_dialog.log
Image Using a Tellstick Net
Web app with group of devices : here
Map House + scheduler with sensors + Speech recognition : here
Android app : Domospeak
malo
Posts: 5
Joined: Fri Mar 17, 2023 9:45 am

Re: [CODE] Map House + scheduler + Speech recognition + stat

Post by malo »

hmm, I must be missing someting here
(Running linux)

1 sudo apt-get install php5 curl php5-curl
2 sudo pecl install oauth
3 sudo nano /etc/php5/apache2/php.ini # add extension=oauth.so at the end of the file
4 sudo /etc/init.d/apache2 restart
Download the package and unzip it in /var/www/


PHP Warning: require_once(HTTP/OAuth/Consumer.php): failed to open stream: No such file or directory in /var/www/html/home/config.php on line 5
[Tue Apr 09 16:13:18 2013] [error] [client 192.168.1.149] PHP Fatal error: require_once(): Failed opening required 'HTTP/OAuth/Consumer.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/html/home/config.php on line 5
Manticus2
Posts: 108
Joined: Fri Mar 17, 2023 9:45 am
Location: France - Bordeaux
Contact:

Re: [CODE] Map House + scheduler + Speech recognition + stat

Post by Manticus2 »

your problem is with OAuth :

Code: Select all

sudo apt-get install php-pear php5-dev make
sudo pecl install oauth
if error :

Code: Select all

/usr/include/php5/ext/pcre/php_pcre.h:29: fatal error: pcre.h:
execute :

Code: Select all

sudo apt-get install libpcre3-dev


(link : http://appventus.com/blog/comment-insta ... sur-ubuntu )
Image Using a Tellstick Net
Web app with group of devices : here
Map House + scheduler with sensors + Speech recognition : here
Android app : Domospeak
ritro
Posts: 51
Joined: Fri Mar 17, 2023 9:45 am

Re: [CODE] Map House + scheduler + Speech recognition + stat

Post by ritro »

Hi Manticus,
Very good job, i've tested your solution and it works perfectly. I wanted to represent my home by this way but i've realised that it is not the best way to all control.
So I'm turned to an interface as gleam, that looks like MetroUI. I'm working on two scripts, one scheduled to control home scénario and one web to control.
Yours was very hellpfull to quick advance. Do you need any help ?
The plateform were i decided to home my php script is on my Netgear Stora, i've had some difficult to run pear oauth with php 5.1 but i did it.
ImageUsing a Tellstick Net aussi :)
kbrown
Posts: 1
Joined: Fri Mar 17, 2023 9:45 am

Re: [CODE] Map House + scheduler + Speech recognition + stat

Post by kbrown »

hi,

may i ask what steps/tasks you took to setup the voice controlled lighting system using telldus?
thank you
Manticus2
Posts: 108
Joined: Fri Mar 17, 2023 9:45 am
Location: France - Bordeaux
Contact:

Re: [CODE] Map House + scheduler + Speech recognition + stat

Post by Manticus2 »

Hi,
For the voice control, I choice to use an external solution to translate sound in text (STT) because it's the best solution (I think) to select language

For linux, I have create some listener:
- One file executes commands which listen the microphone.
It starts recording when we have a noise, stop when we have a silence (2 seconds) and register this audio record in a sound file (sound.wav).
After, we execute a second file and restart the process.

- The second file post the sound to the google api (used by google chrome and android) which return the text with a pourcent of fiability. We register this text in one text file (dialog.log).

- The third file listen modifications of the file (dialog.log), get the text and check words (exemple : "turn on" + "light" + "kitchen" = call api telldus to turn on this light).
After listen dialog.log we clear this file and wait another modification of this file (dialog.log) by the second file.

is it clear ?
Image Using a Tellstick Net
Web app with group of devices : here
Map House + scheduler with sensors + Speech recognition : here
Android app : Domospeak
Manticus2
Posts: 108
Joined: Fri Mar 17, 2023 9:45 am
Location: France - Bordeaux
Contact:

Re: [CODE] Map House + scheduler + Speech recognition + stat

Post by Manticus2 »

Hi rito, thanks for your reply,
I'm interested by all possibilities to control the tellstick net so if you can create a topic about your solution and send a link ... 8)
Image Using a Tellstick Net
Web app with group of devices : here
Map House + scheduler with sensors + Speech recognition : here
Android app : Domospeak
ritro
Posts: 51
Joined: Fri Mar 17, 2023 9:45 am

Re: [CODE] Map House + scheduler + Speech recognition + stat

Post by ritro »

Ok, but it's just an other design than yours. Everything is working fine, but due to multiple way to control my devices, the status is not always very exact. So i've decided to fire otio remote to test chacon remote, and by this way having a correct status. To control windows shutters, i want to store the position (intermediary), but the best way is to find a zone where writing and store on telldus live, but is it possible ??????
ImageUsing a Tellstick Net aussi :)
Manticus2
Posts: 108
Joined: Fri Mar 17, 2023 9:45 am
Location: France - Bordeaux
Contact:

Re: [CODE] Map House + scheduler + Speech recognition + stat

Post by Manticus2 »

you can know the chacon status ? :shock:

for the windows shutters I see only one solution :
measure the closing time of the shutter
and stop the shutter after x seconds with a timer ...

in my interface I will create a slide bar or a progress bar to control shutters
(when I have shutters in my next appartment)
Image Using a Tellstick Net
Web app with group of devices : here
Map House + scheduler with sensors + Speech recognition : here
Android app : Domospeak
Manticus2
Posts: 108
Joined: Fri Mar 17, 2023 9:45 am
Location: France - Bordeaux
Contact:

Re: [CODE] Map House + scheduler + Speech recognition + stat

Post by Manticus2 »

Edit first post to add a small video uploaded on Youtube : http://youtu.be/G2vwF3t49f0
Image Using a Tellstick Net
Web app with group of devices : here
Map House + scheduler with sensors + Speech recognition : here
Android app : Domospeak
Manticus2
Posts: 108
Joined: Fri Mar 17, 2023 9:45 am
Location: France - Bordeaux
Contact:

Re: [CODE] Map House + scheduler + Speech recognition + stat

Post by Manticus2 »

and an other complet demo in HD with annotation : http://www.youtube.com/watch?v=l6r5DSuqOUI
Image Using a Tellstick Net
Web app with group of devices : here
Map House + scheduler with sensors + Speech recognition : here
Android app : Domospeak
hkt01
Posts: 1
Joined: Fri Mar 17, 2023 9:45 am

Re: [CODE] Map House + scheduler + Speech recognition + stat

Post by hkt01 »

Hi!

Great job with the project! I was just wondering where do you use the aften package required for voice control? Because I couldn't install it by using the apt-get command, and don't really know how to do it manually.

Thanks!
Post Reply