RichTJ99 Posted June 21, 2013 Posted June 21, 2013 Hi, I have a driveway alarm that is hard wired to a pico speaker in my house, the speaker makes a buzzing noise when it has power, which it only gets when the driveway alarm goes off. I have a speaker that beeps when a car drives over the alarm. I also have an Insteon door sensor that is set to send an email through the ISY when someone drives into the driveway. I want to take the two wires from the speaker & daisy chain them 'somehow' to a computer so when the speaker for the driveway alarm goes off, the PC could detect the 12v dc signal then I could have it play a MP3 recording of the driveway alarm sound through the home audio system. Is there some sort of USB device (or serial) I could use to detect the voltage change (from none to something), then make it play a mp3 when it 'senses' the voltage? Thanks, Rich
Xathros Posted June 21, 2013 Posted June 21, 2013 I think it would be easier to use the network module in the ISY to tell the PC to play a sound. I think there are a few threads on here where something very similar has been done. -Xathros
iostream212 Posted June 21, 2013 Posted June 21, 2013 If the insteon door sensor already triggers isy during the event, then why not use a network resource to trigger the sound when the email is sent? There are plenty of options in this arena. One I use a lot is xbmc, which has a well documented json api, but there are plenty others. Sent from my Galaxy S4 using Tapatalk 2
RichTJ99 Posted June 21, 2013 Author Posted June 21, 2013 The main problem I see is that I have the buzzer which is in sync with the person driving up the driveway, if the ISY gets a signal that the driveway alarm is active, then it sends an email to a PC, which processes the email in Outlook, then a rule goes, etc. It could be a minute delay which isnt the end of the world, but having a loud buzz in the house, then a minute later a loud buzz outside might not be ideal.
iostream212 Posted June 21, 2013 Posted June 21, 2013 I use network resources in programs and the turn around is near instantaneous. In fact I have a motion detector at the front door send me an email on motion, and motion trigger to email receipt is fairly consistent at 7 seconds (gmail). Of course you can always re-order you statements so the sound triggers first and then do the email.
RichTJ99 Posted June 21, 2013 Author Posted June 21, 2013 I have the network resources installed, I am a little confused on how to proceed. What is your suggestion on the best way to make a PC play the sound (wav or Mp3) through the PC speakers when the driveway alarm goes off with the triggerlinc?
iostream212 Posted June 21, 2013 Posted June 21, 2013 Like I said earlier I use xbmc to play media on my htpc. So if I were to do this I would: 1.) Create a network resource in ISY to play the mp3. If you use xbmc the format for a http request is: http://:/jsonrpc?request= Your request would contain the play command and the path or id of the file to play. 2.) Create a program in ISY that runs when the TriggerLinc triggers. Something to the effect of: If Control 'TriggerLinc' is switched on Then Resource XBMC_Driveway_Alert Notify Send email If you need more help on the xbmc request let me know and I can figure it out exactly when i get home later.
RichTJ99 Posted June 22, 2013 Author Posted June 22, 2013 So on the PC that has the music, I am using software which mimicks airplay since my wife is all Iphone/Ipad'ed (of course I prefer android to add to the confusion). The PC that is handling the audio is also running a xlite application for an IP Softphone. The idea is that if your in the house, then dial X202, it will do an intercom, that PC also handles the music. So if I install XBMC, then put the mp3 of the driveway alert into the XBMC 'directory', your saying I can have the ISY send a play request to play the alert when the triggerlinc is triggered? I really appreciate your help, if I could take you up on your offer for more help, that would be great. I think I understand a general idea on how to do it! Thanks, Rich
apostolakisl Posted June 22, 2013 Posted June 22, 2013 It could be a minute delay which isnt the end of the world, but having a loud buzz in the house, then a minute later a loud buzz outside might not be ideal. This is because outlook doesn't get emails pushed to it. Outlook runs a send/receive at whatever interval you set it to in the options. So outlook doesn't know there is an email waiting for it to receive until it runs its next check.
iostream212 Posted June 23, 2013 Posted June 23, 2013 Sure. Here is a quick guide to get ISY talking to XBMC. Go to the XBMC website and download the appropriate flavor: http://xbmc.org/download/ Install and launch. From the home screen go to ’System’, then ‘Settings’, then ‘Services’, then ‘Webserver’. Click the option to ‘Allow control of XBMC via HTTP’ and also set a password. The easiest way to play a song through XBMC is to add it to the XBMC library. It doesn't add it locally, just adds the song info to its database and, most importantly, gives the song a unique id that we can reference. From XBMC home screen click on 'Music'. From the 'Music-Files' dialog select 'Add source'. Browse to the folder location of your music library, or simply type in the path, and click 'Ok' to add. *IMPORTANT* After the source is added, right-click on the source name and select 'Scan item to library'. Once complete we are ready to add our network resource in ISY. Login to the admin console and go to 'Configuration', then 'Networking', and finally 'Network Resources'. Click 'Add'. Set to the following: 1.) http 2.)GET 3.) Host (IP address of pc running XBMC) 4.) Port (From XBMC webserver settings. Defaults to 80) 5.) Path. Enter the following. Replace the number after 'songid' with the id of your audio file: /jsonrpc?request={ "jsonrpc": "2.0","method": "Player.Open", "params": { "item" : { "songid": 1} }, "id": 1 } 6.) Tick 'Encode URL'. 7.) Under 'Headers' click 'Add' and 'Authorization'. Enter your XBMC webserver username and password setup earlier. 8.) Click 'Update', then 'Save'. 9.) Click 'Save' again once back in the 'Network Resources' page. Highlight the name of your new resource and click 'Test', and if everything went right your song will start playing on the computer running XBMC. Note that XBMC application needs to be running for it to receive theses requests. Some other good resources: http://wiki.xbmc.org/index.php?title=JSON-RPC_API http://wiki.xbmc.org/index.php?title=JSON-RPC_API/v6 There are lots more you can do with this robust protocol and awesome app.
iostream212 Posted June 26, 2013 Posted June 26, 2013 A quick edit to my last post to clarify some confusion. The 'unique id' referenced in my last post is something generated automatically. Do not change your file names. After the media directory has been scanned into XBMC, run the following to verify what id was assigned to each song: { "jsonrpc": "2.0", "method": "AudioLibrary.GetSongs" , "id": 1 }. You can also use a web browser to run the above command using: http://IP Address of PC running XBMC:Port/jsonrpc?request= { "jsonrpc": "2.0", "method": "AudioLibrary.GetSongs" , "id": 1 }. Depending on the browser you are using you may have to remove the white space for the above to work.
RichTJ99 Posted June 26, 2013 Author Posted June 26, 2013 Thanks for helping myself & Bryan (who was helping me). We have it working if we choose a regular music MP3. Now we are trying to take a 2 second portion of this file: http://www.mallory-sonalert.com/sounds/database_sounds/2900CONT.wav http://www.mallory-sonalert.com/PMBMSea ... inuous.asp We made one here: https://dl.dropboxusercontent.com/u/477 ... iveway.mp3 It is 2 seconds, but for some reason, no matter how many times we scan for new files, it wont add it. It wont even add the wav file from above. It will add other music MP3's. I am really confused why it doesnt work. Any ideas how to get it going? The rest of it all works fine, the network resource works perfectly (with another MP3). If i can get this silly 2 second MP3 working, we are golden! Thanks for all the help. Rich
iostream212 Posted June 26, 2013 Posted June 26, 2013 Hello. I got it working fine. I think the issue was that there was no tag info on the file. I added misc tag info and attached it. Try it again with the attached file. Driveway.zip
RichTJ99 Posted June 27, 2013 Author Posted June 27, 2013 Nice! That now works like a charm! I put one of the files into Itunes to tag it & it didnt work. What did you do that was different? That is really loud ! The only issue I now have is that my driveway alarm programming has 5 separate programs & I cant quite figure out how to give priority to the beep.
iostream212 Posted June 27, 2013 Posted June 27, 2013 I use a program called mp3tag. Great to hear that this part is solved. I'm sure someone can help you out on the other issue if you post your programs. Sent from my Galaxy S4 using Tapatalk 2
jmac Posted November 20, 2013 Posted November 20, 2013 Sure. Here is a quick guide to get ISY talking to XBMC. Go to the XBMC website and download the appropriate flavor: http://xbmc.org/download/ Install and launch. From the home screen go to ’System’, then ‘Settings’, then ‘Services’, then ‘Webserver’. Click the option to ‘Allow control of XBMC via HTTP’ and also set a password. The easiest way to play a song through XBMC is to add it to the XBMC library. It doesn't add it locally, just adds the song info to its database and, most importantly, gives the song a unique id that we can reference. From XBMC home screen click on 'Music'. From the 'Music-Files' dialog select 'Add source'. Browse to the folder location of your music library, or simply type in the path, and click 'Ok' to add. *IMPORTANT* After the source is added, right-click on the source name and select 'Scan item to library'. Once complete we are ready to add our network resource in ISY. Login to the admin console and go to 'Configuration', then 'Networking', and finally 'Network Resources'. Click 'Add'. Set to the following: 1.) http 2.)GET 3.) Host (IP address of pc running XBMC) 4.) Port (From XBMC webserver settings. Defaults to 80) 5.) Path. Enter the following. Replace the number after 'songid' with the id of your audio file: /jsonrpc?request={ "jsonrpc": "2.0","method": "Player.Open", "params": { "item" : { "songid": 1} }, "id": 1 } 6.) Tick 'Encode URL'. 7.) Under 'Headers' click 'Add' and 'Authorization'. Enter your XBMC webserver username and password setup earlier. 8.) Click 'Update', then 'Save'. 9.) Click 'Save' again once back in the 'Network Resources' page. Highlight the name of your new resource and click 'Test', and if everything went right your song will start playing on the computer running XBMC. Note that XBMC application needs to be running for it to receive theses requests. Some other good resources: http://wiki.xbmc.org/index.php?title=JSON-RPC_API http://wiki.xbmc.org/index.php?title=JSON-RPC_API/v6 There are lots more you can do with this robust protocol and awesome app. Does this procedure still work? I get a request failure every time I try it.....or maybe I'm inputting the wrong information.
iostream212 Posted November 20, 2013 Posted November 20, 2013 Should be fine. Is xbmc running? It has to be open to work as it does not run as a service. Sent from my SCH-I545 using Tapatalk
RichTJ99 Posted November 20, 2013 Author Posted November 20, 2013 Yes, that still works for me. Its really fantastic!
jmac Posted November 20, 2013 Posted November 20, 2013 Great! Didn't have the Display Mode "Windowed" and the program wasn't running. My bad! Now I can't play the wav file that I have in the XBMC Music Folder. I don't understand the "songid": 1}}, "id":1} (code), I guess. Could some one enlighten me? Thanks...
iostream212 Posted November 21, 2013 Posted November 21, 2013 The "songid" is the id of the file assigned by xbmc when the media folder is scanned by xbmc. The other "id" is the id of the xbmc player. The player ids are either 1, 2, or 3 and reference the xbmc music player, video player, and photo 'player' (viewer). You might check the protocol example page for some additional samples: http://wiki.xbmc.org/index.php?title=JSON-RPC_API/Examples.
Recommended Posts