Author Topic: Vera Home Made Raspberry pi Speakers  (Read 1981 times)

Offline hellovn

  • Sr. Member
  • ****
  • Posts: 268
  • Karma: +19/-46
Re: Vera Home Made Raspberry pi Speakers
« Reply #15 on: August 01, 2018, 09:48:00 am »
Simplest way, as I posted early in this thread, is to pair Alexa with Bluetooth and play your tunes this way. I'm using it since one year and it's working very well.

I meant to play any custom text to speech to my Echos. It seems OpenHab already supported this. I have installed openhab2 in my raspberry PI and tried this plugin:

https://community.openhab.org/t/solved-alexa-tts-via-http/46615

Now, when a door is open, Vera will call a HTTP command and play "Front door is open" to my Echos.

Offline RV

  • Full Member
  • ***
  • Posts: 125
  • Karma: +0/-0
Re: Vera Home Made Raspberry pi Speakers
« Reply #16 on: August 01, 2018, 09:54:21 am »
did you try the steps given here:
https://projects.raspberrypi.org/en/projects/lamp-web-server-with-wordpress/4
or
https://www.raspberrypi.org/documentation/remote-access/web-server/apache.md

You seem to have the web server working but php isn't installed. If it doesn't work, do a search on the error. PHP should be straight forward to install. Put your errors here and i can have a look
Yes did the first one, skipped the mySQL part and the wordpress part. Is the workpress required?

Offline ghost

  • Newbie
  • *
  • Posts: 12
  • Karma: +4/-0
Re: Vera Home Made Raspberry pi Speakers
« Reply #17 on: August 03, 2018, 05:50:45 am »
wordpress and mysql are not required. i'm not sure what the problem is. You need php, maybe try a different php engine

Offline RV

  • Full Member
  • ***
  • Posts: 125
  • Karma: +0/-0
Re: Vera Home Made Raspberry pi Speakers
« Reply #18 on: August 03, 2018, 10:38:48 am »

Offline RV

  • Full Member
  • ***
  • Posts: 125
  • Karma: +0/-0
Re: Vera Home Made Raspberry pi Speakers
« Reply #19 on: August 03, 2018, 12:32:32 pm »
I've tested php (as described on the rpi page "hello world") and it's working

the command line
sudo mpg321 -g 100 /var/www/html/audio/lgo.mp3 plays the file.

I created a test file, soundtest.php, minus the variables but added the date test

<?php exec("sudo mpg321 -g 100 /var/www/html/audio/lgo.mp3") ;
           echo date('Y-m-d H:i:s');
?>

to execute it directly. I get the date returned but no sound.

I added ;echo date('Y-m-d H:i:s'); and "  hello world"; to the original soulnd.php file and I get the date/time and the message but no sound.

Offline RV

  • Full Member
  • ***
  • Posts: 125
  • Karma: +0/-0
Re: Vera Home Made Raspberry pi Speakers
« Reply #20 on: August 03, 2018, 03:50:18 pm »
did some more testing and I'll post this here for future users testing php
I created a test php file named soundtest.php just to test if php and mpg were working

<?php exec("sudo mpg321 /var/www/html/audio/lgo.mp3");
 echo date('Y-m-d H:i:s');
 echo "  hello world";
?>

you can test your script with
php soundtest.php in a terminal window

turns out it's a sudo rights issue
the solution was found here
https://serverfault.com/questions/160581/how-to-setup-passwordless-sudo-on-linux

Offline Greg-Mega

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
Re: Vera Home Made Raspberry pi Speakers
« Reply #21 on: August 03, 2018, 10:32:53 pm »
I actually had a play with a random idea that popped into my head during the week last night to make an old android device play audio alerts using a similar concept to the OP but a little bit simpler. I found that installing Kodi on my girlfriends old Moto X play and enabling the kodi web interface i could tell it to play media via the API.

I could make a call using the vera to the Kodi device using:

Code: [Select]
http://<PHONEIP>:8080/jsonrpc?request={"jsonrpc":"2.0","method":"Player.Open","id":1,"params": {"item" : {"file":"http://<NASIP>/media/alert.mp3"}}}
And it would start playing the alert. I had a bit of a look for a TTS plugin or TTS API but at this point i gave up on the idea, i proved my point it was possible just have no idea what i would use it for personally that would be all that useful. I guess if i had people leaving doors open lights on it would be good. My only other thought was i could plug the phone into my alarm clock / dock thing and have it do something if one of the door sensors picked something up in night mode instead of an alarm going crazy.

VERA Alarm clock maybe?

I'm already using something similar to the above to make use of the Kodi Notification/pop up's when things happen around the house on my kodi devices which are connected to my TV's.
« Last Edit: August 03, 2018, 10:37:00 pm by Greg-Mega »

Offline RV

  • Full Member
  • ***
  • Posts: 125
  • Karma: +0/-0
Re: Vera Home Made Raspberry pi Speakers
« Reply #22 on: August 10, 2018, 07:23:00 pm »
I've got to say this is really slowing down scene processing.
« Last Edit: August 12, 2018, 03:01:44 pm by RV »