Jump to content

Does anyone make an Insteon announcement speaker/device


Bill Morrow

Recommended Posts

Didn't have much time to test last night as it was really late so didn't want to blast the house with voices. But the NR when activated via a dummy program didn't activate the USB speaker. ☹️

 

I'm going to have to see what the sound output is and source is set for on the RPi. As an aside I did hear some hiss & noise using two different speakers so it's obvious that analog output isn't very high quality vs the other HDMI, I/O pins.

 

In the NR string if you have a file called: walk the dog how should that be represented in the string?

 

With spaces, without, under score? I used all three in the text string and nothing could be heard from the RPi speaker.

 

 

=========================

 

The highest calling in life is to serve ones country faithfully - Teach others what can be. Do what is right and not what is popular.

Link to comment

Didn't have much time to test last night as it was really late so didn't want to blast the house with voices. But the NR when activated via a dummy program didn't activate the USB speaker. ☹️

 

I'm going to have to see what the sound output is and source is set for on the RPi. As an aside I did hear some hiss & noise using two different speakers so it's obvious that analog output isn't very high quality vs the other HDMI, I/O pins.

 

In the NR string if you have a file called: walk the dog how should that be represented in the string?

 

With spaces, without, under score? I used all three in the text string and nothing could be heard from the RPi speaker.

 

 

=========================

 

The highest calling in life is to serve ones country faithfully - Teach others what can be. Do what is right and not what is popular.

When you switch between HDMI and analog you will have to change the setting in the system menu to reflect that change. Unfortunately it doesn't auto detect. All of my files on the Pi have underscores (ex. walk_the_dog)  Also the filenames are case sensitive. So Mail is different to mail

Link to comment

When you switch between HDMI and analog you will have to change the setting in the system menu to reflect that change. Unfortunately it doesn't auto detect. All of my files on the Pi have underscores (ex. walk_the_dog) Also the filenames are case sensitive. So Mail is different to mail

I was afraid of that - OK. Alright I'll have to wait for the family to wake up before I start blasting the house over the PA to see if it's just a output issue vs file name or both.

 

Probably both LOL!

 

I'll circle back once I make a new voice prompt for *All you lazy heads get up* using the funniest voice I can find!

Link to comment

I know lots of people are like me who simply want to see and hear the end results of something. Because some times written text simply doesn't relay the same experience or meaning.

 

Below is just a quick video how I defined some of 250 plus voice announcements in hopes of using them in my HA. I had been asked a few times in this thread and via PM to show case how I made *Julie US* stop, pause, and emphasize my TTS announcements.

 

There are a few you will notice how this worked out so perfectly: 

 

Currently I am working on the NR's which doesn't seem to be working besides the fact I'm constantly fighting with the blasted ISY Series Controller! The stupid thing constantly says java blah blah, takes what seems like days to just load the program tab. Once the bloody thing finally loads I am presented with yet a dozen error messages of blah blah!

 

I always feel I'm walking on egg shells of late with this controller and it seems to be maxed out in resources etc. Anyways enjoy the video and hope it inspires many more to do the very same. I am going to copy and paste the NR and see if anyone see's something obvious.

Edited by Teken
  • Like 1
Link to comment

OK, what I have done thus far so please check off anything I may have missed.

 

- RPi: I enabled both analog and HDMI in the program and confirmed sound is indeed heard on the HDTV and USB Speaker.

 

- Confirmed the IP address of the RPi which is 192.168.1.137

 

- The test NR looks like this simply copy and pasted from your example and for the sake of doing it I added an underscore to the test file called Entry_MS_Low_Battery.wav just in case the system wasn't liking the space between the words.

 

- When I press TEST for the NR I receive the expected 200 which I have appended in this reply.

 

- I've initiated the NR in the dummy program just in case there was a difference in behavior still no joy.

 

 /jsonrpc?request={%22jsonrpc%22:%222.0%22,%22id%22:%221%22,%22method%22:%22Player.Open%22,%22params%22:{%22item%22:{%22file%22:%22storage/music/Entry_MS_Low_Battery.wav%22}}}

post-1970-0-74500800-1481994818_thumb.png

post-1970-0-37732500-1481994878_thumb.png

post-1970-0-72052500-1481995000_thumb.png

Edited by Teken
Link to comment

OK, what I have done thus far so please check off anything I may have missed.

 

- RPi: I enabled both analog and HDMI in the program and confirmed sound is indeed heard on the HDTV and USB Speaker.

 

- Confirmed the IP address of the RPi which is 192.168.1.137

 

- The test NR looks like this simply copy and pasted from your example and for the sake of doing it I added an underscore to the test file called Entry_MS_Low_Battery.wav just in case the system wasn't liking the space between the words.

 

- When I press TEST for the NR I receive the expected 200 which I have appended in this reply.

 

- I've initiated the NR in the dummy program just in case there was a difference in behavior still no joy.

 

 /jsonrpc?request={%22jsonrpc%22:%222.0%22,%22id%22:%221%22,%22method%22:%22Player.Open%22,%22params%22:{%22item%22:{%22file%22:%22storage/music/Entry_MS_Low_Battery.wav%22}}}

Just to be sure....  Is the test file named exactly like you have in your NR? even the .wav needs to match. If you do, maybe remove the underscores from both the file on the Pi and your NR and see if that will cause it to fire.

Link to comment

Just to be sure....  Is the test file named exactly like you have in your NR? even the .wav needs to match. If you do, maybe remove the underscores from both the file on the Pi and your NR and see if that will cause it to fire.

 

Yes, I confirmed the phrase is exactly the same as the test file. I'm going to change it to one long word and see what happens. This shouldn't be that complicated but since I never know what the controller is going to cry about for all I know its a fail on the network resource side.

 

I just don't know . . .

Link to comment

Thanatar,

 

Can you provide me the link which calls out the path you cited in your first post. I want to make sure there isn't a difference in the file path in my openelec vs yours.

Sure. It's the API for all the commands for Kodi. I'll warn you, it is tough to figure out. My version of Kodi on openelec is Jarvis 16.1 which is the stable load.

 

http://kodi.wiki/view/JSON-RPC_API/v6

 

You can test your link by trying in a web browser.  So. 192.168.1.137/jsonrpc?request={%22jsonrpc%22:%222.0%22,%22id%22:%221%22,%22method%22:%22Player.Open%22,%22params%22:{%22item%22:{%22file%22:%22storage/music/Entry_MS_Low_Battery.wav%22}}}

 

That will play it without the ISY and give you a good test.

Edited by Thanatar
Link to comment

I must be missing something obvious here because using the web browser results in a OK also like the test NR did. Yet there is no sound coming out of the connected speaker attached to the RPi?

Do you still have the Pi hooked up to a monitor? Could you verify if it is showing the file playing on the screen when you call the resource.

 

EDIT: I think I know what it is. Stupid mistake on my part. :oops:

System>Settings>Remote Control> Turn on both options.

System>Settings>Web Server>Allow remote control>On

I usually turn those on when I set them up but forgot to mention it. I bet that's what it is.

Edited by Thanatar
  • Like 1
Link to comment

Do you still have the Pi hooked up to a monitor? Could you verify if it is showing the file playing on the screen when you call the resource.

 

EDIT: I think I know what it is. Stupid mistake on my part. :oops:

System>Settings>Remote Control> Turn on both options.

System>Settings>Web Server>Allow remote control>On

I usually turn those on when I set them up but forgot to mention it. I bet that's what it is.

I'm at the gym right now killing some calories. I'll check those settings and report back what happens upon my return.

 

Thank you again for the continued support and guidance and will document all of these steps for the next guy.

Link to comment

LOL That is awesome! I'm guessing you are now able to have it work via a NR?

As I'm waiting in line at Costco the whole time I'm thinking what if one simple option isn't selected is actually stopping me from succeeding?!?

 

I don't even unload the groceries and just jump out of the car as the GF is wondering WTF is he racing to do?!?

 

I fire up that RPi and see exactly one single toggle option not selected!

 

I press and go - bam bobs your uncle!!

 

GF is wondering who the hell is talking while I'm screening and running around like a chicken without a head.

 

YES - Houston we have a successful lift off !!!

 

Thank You . . .

 

GF says she doesn't feel her XMAS present holds up next to this new feature enhancement to the home!

 

Moving forward I will complete an entire setup guide on how this was all done so it's on one concise location.

 

Daddies got a new toy!!!

  • Like 1
Link to comment

As I'm waiting in line at Costco the whole time I'm thinking what if one simple option isn't selected is actually stopping me from succeeding?!?

 

I don't even unload the groceries and just jump out of the car as the GF is wondering WTF is he racing to do?!?

 

I fire up that RPi and see exactly one single toggle option not selected!

 

I press and go - bam bobs your uncle!!

 

GF is wondering who the hell is talking while I'm screening and running around like a chicken without a head.

 

YES - Houston we have a successful lift off !!!

 

Thank You . . .

 

GF says she doesn't feel her XMAS present holds up next to this new feature enhancement to the home!

 

Moving forward I will complete an entire setup guide on how this was all done so it's on one concise location.

 

Daddies got a new toy!!!

Glad to hear you have it all working. I have been editing my initial setup guide as we have been troubleshooting. Hopefully I've captured most of the steps.

  • Like 1
Link to comment

I feel like an 8-year-old on Christmas Eve as I wait for USPS to deliver my Pi and HiFiBerry AMP+ today...   :mrgreen:

 

LMAO . . .

 

I kid you not besides getting Insteon, ISY Series Controller, Brultech GEM & Dash Box. This incredibly powerful, accurate, and flexible TTS voice has truly brought my home to a whole different level!

 

Right now I'm juggling back and forth appending my *Install Thread* with the details of this massive achievement in voice announcement and creating the 200 plus NR's to reflect the 250 plus voice announcements.

 

Merry XMAS and do share some of the vocal phrases you created. 

 

I would love to see what others are using for scripted phrases as I believe I covered most of the basic, medium, to some advanced voice phrases. The one problem I ran into is some words just sound wrong when Julie US says them so I had to use the magic of abbreviations and the reverb feature to tame her to sound more human. 

Link to comment

In the spirit of things to do once you get your system talking, the program I wrote to do the announcements has a couple of neat features:

 

1.  It checks for "seasonal" replacement words / sounds and makes the appropriate replacements.  I do this by placing "duplicate" sounds in numbered (1-12) directory folders.  If the word / phrase exists in the current month's folder, a replacement is automatically made.

 

2.  It allows for randomization by including multiple variances of the same word / phrase appended by -#.  For example "Hello-1.mp3" says "Hello."  "Hello-2.mp3" says "Hi".  "Hello-3.mp3" says "Greetings".  If numbered versions of a word or phrase exist in the audio folder (or month folder), one will be selected at random from those available.

 

Here are some example voice announcement functions that I have set up:

 

Announce exterior lighting turn on / off at sunrise and sunset (with time)

 

Announce arrival of mail and mailbox accesses

 

Announce visitor approaching

 

Announce me / wife arriving if the other is home

 

Welcome me / wife home when system disarmed

 

Wish me / wife a happy birthday (with a song included).

 

Announce count and times of doorbell rings when we were away

 

Announce count, times, and callers of missed calls when we were away

 

Announce completion of the dryer cycle

 

Announce time and / or temperature when requested

 

Announce all door / window opens and closings (ELK integration)

 

Announce ELK ARM / DISARM / mode (ELK integration)

 

Announce any ELK troubles (low battery, etc.)

 

Announce reminder every 40 days to change the furnace filters (manually reset when I change them)

 

Announce reminder to take out the trash on Tuesday nights

 

Announce notification of any exterior motion lights triggering

 

Announce reminders about Washington Capitals game and start times as leaving

 

Announce score updates for Washington Capitals games

 

Announce garage door openings and closings

  • Like 1
Link to comment

In the spirit of things to do once you get your system talking, the program I wrote to do the announcements has a couple of neat features:

 

1.  It checks for "seasonal" replacement words / sounds and makes the appropriate replacements.  I do this by placing "duplicate" sounds in numbered (1-12) directory folders.  If the word / phrase exists in the current month's folder, a replacement is automatically made.

 

2.  It allows for randomization by including multiple variances of the same word / phrase appended by -#.  For example "Hello-1.mp3" says "Hello."  "Hello-2.mp3" says "Hi".  "Hello-3.mp3" says "Greetings".  If numbered versions of a word or phrase exist in the audio folder (or month folder), one will be selected at random from those available.

 

Here are some example voice announcement functions that I have set up:

 

Announce exterior lighting turn on / off at sunrise and sunset (with time)

 

Announce arrival of mail and mailbox accesses

 

Announce visitor approaching

 

Announce me / wife arriving if the other is home

 

Welcome me / wife home when system disarmed

 

Wish me / wife a happy birthday (with a song included).

 

Announce count and times of doorbell rings when we were away

 

Announce count, times, and callers of missed calls when we were away

 

Announce completion of the dryer cycle

 

Announce time and / or temperature when requested

 

Announce all door / window opens and closings (ELK integration)

 

Announce ELK ARM / DISARM / mode (ELK integration)

 

Announce any ELK troubles (low battery, etc.)

 

Announce reminder every 40 days to change the furnace filters (manually reset when I change them)

 

Announce reminder to take out the trash on Tuesday nights

 

Announce notification of any exterior motion lights triggering

 

Announce reminders about Washington Capitals game and start times as leaving

 

Announce score updates for Washington Capitals games

 

Announce garage door openings and closings

 

Hello Kevkmartin,

 

Could you provide a little more insight how this is done showing some image captures of the program(s)? Is this done using Thanatars voice solution or something completely different? Also is this being done using 4.XX vs 5.XX firmware - Any insight would be greatly appreciated.

Link to comment

Sure thing! 

 

I set up my voice announcements on a laptop, that runs an apache web server, and some other perl code for various automation functions and logging.  There is no reason the apache server couldn't run on a RPi.

 

This is all custom programming, and I've been working on it (refining) over the last few years.  It's written in perl, but I'm sure an enterprising youngster could convert to python.  I've included the code for the speak routine below.

 

In essence, the speak routine is in a library file that I include in any code that I want to be able to speak through the audio system.

 

To speak a phrase, I simply call a web page from the apache server (invoking the relevant perl code in the process).

 

For example, to speak the word "hello", I would have a piece of perl code that would send the command:

 

speak ("hello");

 

My solution is dependent on having all of the mp3 files pre-generated and stored in the directory "audio" on the web server.  Within the audio folder are the numbered month folders (1-12) used to check for seasonal announcements.

 

The ISY uses network resources to make calls to the apache server and thereby "speak".

 

The format_string_for_speak routine is a bit of bulletproofing, ensuring that the default (or provided) audio path and .mp3 extensions are properly applied for each word.

 

Here's the speak and format_string_for_speak routine s that I developed in perl:

#-------------------------------------------------------------------------------


sub speak
{

# This routine accepts an input string to be spoken.  
# The input string consists of individual,fully-qualified words / phrases (mp3s),
# separated by spaces.
#
# The routine will check each word / phrase to see if there is a month-specific
# version available.  If so, the month-specific phrase(s) will be spoken.
#
# Additionally, the routine will determine if multiple, equivalent phrases exist in the
# specified or month directory, and will randomize among available instances of
# the phrases.  
#
# "Equivalent" phrases are specified by the presence of an _## extension prior to
# the .mp3 extension.
#
# The EXACT input phrase must exist in the directory / month specific directory in
# order for the routine to perform substitution and randomization functions.


# Initialize variables

#  Input string to be spoken
my $announce_string         = $_[0];
my $audio_path              = $_[1];


my $announcement_log = "/var/www/cgi-bin/dat/Crystal_announcement_log.dat";

my $announcement_lock_file  = "/var/www/cgi-bin/dat/Crystal_announcement_lock.dat";

my $result = "";

my @announce_elements = "";

my $element_count = 0;

my $file_count = 0;

my $random = 0;

my $speak_path = "";
my $speak_string = "";

#  Populate hash of current date / time values
my $current_time_ref = get_current_time_hash();
my %current_time = %$current_time_ref;

my $DEBUG = 0;


print "In routine speak.\n\n";

if ($audio_path eq "")
    {
    $audio_path = "/var/www/audio/";
    print "Default audio path used: $audio_path\n\n";    
    }

my ($home_status, $pending_announcements, $num_doorbell, $num_cid, $num_reminders) = get_home_away_status();

$announce_string = format_string_for_speak($announce_string, $audio_path);

# Split input string into individual words / phrases for processing
@announce_elements = split " ",$announce_string;

$element_count = scalar @announce_elements;

#    Debug
      print "\$announce string: $announce_string\n\n"                            if ($DEBUG == 1);
      print "\$element_count: $element_count\n\n"                                if ($DEBUG == 1);


# Loop over elements for replacement / randomization

for my $temp_element (0...$element_count-1)
    {
    
    $file_count = 0;

    # Break element into a fully qualified path and word / phrase    
    my     $temp_path = $announce_elements[$temp_element];
        $temp_path =~ s/[_-\w]+.mp3//;
    
    my     $temp_word = $announce_elements[$temp_element];
        $temp_word =~ s/$temp_path//;

#      Debug    
    print "\t\$announce_elements[$temp_element]: $announce_elements[$temp_element]\t\t$temp_path\t\t$temp_word\n\n"    if ($DEBUG == 1);
    
    
    if ($temp_word ne "")
        {
    
        # Check to see if input word / phrase is present in the current month directory
    
        my    $test_path = $temp_path . "$current_time{month}/";
        my    $test_file = $test_path.$temp_word;
    
        #    Debug
        print "\t\t\$test_path: *$test_path*\n\n"                                    if ($DEBUG == 1);
        print "\t\t\$test_file: *$test_file*\n\n"                                    if ($DEBUG == 1);

        my     $test_word = $temp_word;
            $test_word =~ s/.mp3//;    
    
        #    Debug        
        print "\t\t\$test_word: *$test_word*\n\n"                                    if ($DEBUG == 1);


        #    Input word / phrase IS in the month directory - update path for this word / phrase
        if (-e $test_file)
            {
            print "\t\tFound $temp_word in $test_path\n\n"                            if ($DEBUG == 1);
        
            $speak_path = $test_path;
            }

        #    Input word / phrase is NOT in the month directory.  Use input path.        
        else
            {
            $speak_path = $temp_path;
            }    
        
        
        #    Identify all "equivalent" files in the directory for randomization (i.e. file_xx.mp3)    

        opendir (DIR, $speak_path) or die "Cannot open directory: $!";

        my @files = grep m/^$test_word(_\d)?\.mp3/ && ! m/^\./ && ! /config_file/, readdir DIR; # skip hidden files and config files    

        closedir(DIR);

        #    How many equivalent files were found    
        $file_count = @files;
    
    
        #    Debug    
        print "\t\t\$file_count: $file_count\n\n"                                    if ($DEBUG == 1);
        
        for my $temp_file (0...$file_count-1)
            {
            print "\t\t\$files[$temp_file]: $files[$temp_file]\n\n"                    if ($DEBUG == 1);                
            }

        #    Select a file at random from the equivalent file list        
        $random = int(rand($file_count));
    
        #     Debug
        print "\t\t\$random: $random\n\n"                                            if ($DEBUG == 1);
        
        #    Final fully qualified file to speak        
        $speak_string .= $speak_path.$files[$random]." ";
        
        }

    }

#    Debug
print "\$speak_string: $speak_string\n\n"                                            if ($DEBUG == 1);

my $repeat_string = $speak_string;
$repeat_string =~ s/ /*/g;

print "<a href=http://192.168.66.77/cgi-bin/Crystal.pl?request_source=repeat&parm_1=$repeat_string>REPEAT</a>\n\n";


# If house is occupied, log and make announcement
if ($home_status =~ /home/)
    {

    print "HOME\n\n"                                                                if ($DEBUG == 1);

    output_announcement("ANNOUNCED: $speak_string", $announcement_log);

    # Lock file prevents overlapping phrases being spoken


    print "\tOpening LOCKFILE...\n"                                                    if ($DEBUG == 1);
    open LOCKFILE, ">>$announcement_lock_file" or die $!;

    print "\tflocking LOCKFILE...\n"                                                if ($DEBUG == 1);
    flock(LOCKFILE, 2);

    # Speak the modified input phrase
    
    print "\tmplayer call...\n"                                                        if ($DEBUG == 1);
    $result = `/usr/bin/mplayer -noconfig all $speak_string`;

    # Unlock for next phrase
    print "\tclosing LOCKFILE...\n"                                                    if ($DEBUG == 1);
    close LOCKFILE;

    print "\tDone HOME.\n\n"                                                        if ($DEBUG == 1);

    }

# If house is not occupied, just log announcement
if ($home_status =~ /away/)
    {
    
    print "AWAY\n\n"                                                                if ($DEBUG == 1);
    
    output_announcement("-ANNOUNCED: $speak_string", $announcement_log);
    }

print "RETURNING result.\n\n"                                                        if ($DEBUG == 1);
return ($result)

}


#---------------------------------------------------------------------------------



sub format_string_for_speak

{

################################################################################
#
#
#      Routine accepts inputs:
#
#        in_string    -    A string of mp3 words available on the speak
#                    server
#
#        in_audio_path    -    The path to audio files on the speak server
#
#
#    Routine outputs:
#
#        speak_string    -    Modified in_string with audio path and .mp3
#                    suffix appended to each word.  
#                    Ready for speaking with speak routine.
#
################################################################################


my $in_string         = $_[0];
my $in_audio_path    = $_[1];


print "\nEntering routine format_string_for_speak...\n\n";

# Default audio_path if not specified.
if ($in_audio_path eq "")
    {
    $in_audio_path = "/var/www/audio/";
    print "\tDefault audio path used: $in_audio_path\n\n";
    }

my $speak_string = $in_string;

chomp $speak_string;

$speak_string =~ s/ $//;

$speak_string =~ s/$in_audio_path//g;

$speak_string =~ s/.mp3//g;

$speak_string = $in_audio_path . $speak_string;

$speak_string =~ s/ /.mp3 $in_audio_path/g;

$speak_string .= ".mp3";


return ($speak_string);

}


#---------------------------------------------------------------------------------
Edited by kevkmartin
Link to comment
Guest
This topic is now closed to further replies.

×
×
  • Create New...