Please login or register.

Login with username, password and session length
Pages: [1] 2 3 ... 7

Author Topic: text2x10, Text messaging to operate your X10 devices.  (Read 82138 times)

dbemowsk

  • Hero Member
  • *****
  • Helpful Post Rating: 21
  • Posts: 428
    • PHP Web Scripting
text2x10, Text messaging to operate your X10 devices.
« on: July 06, 2011, 12:45:14 AM »

I don't want to take the thunder away from jimpster who started a program similar to this called StarBotControl, but I got to fooling around in PHP with some of the ideas that he had and came up with a similar command line script that works for me.  The program is called text2x10 and uses the AHSDK with the CM15A and a Google Voice account.  The program can not only control your X10 equipment, but it can respond back with status messages.  I hope jimpster can look at this and get ideas to greatly improve on his program, because there is so much that could be done with this idea.  The PHP files have lots of comments.  feel free to modify the program to suit your needs.

Download text2x10 here
« Last Edit: July 13, 2011, 01:43:21 AM by dbemowsk »
Logged
Dan Bemowski
Owner of PHP Web Scripting LLC
Programmer of RemoteWatch X10
User of any X10 products I can get my hands on.

shuggins

  • Full Member
  • ***
  • Helpful Post Rating: 0
  • Posts: 51
Re: text2x10
« Reply #1 on: July 06, 2011, 01:36:32 PM »

Hi dbemowsk,

I gave this a whirl on lunch break.  At first it was complaining about not finding items in ./include/ and ./ext/ sub folders.  I noticed that the zip did not include the folder paths, so when I unzipped, it put everything in the root folder - no subdirectories were made.  So I guessed at it and put things in /include/ and /ext/ sub directories that I created.  Then when I typed in text2x10.php with my gv user/pw, it asked me to select a program to open it up on my machine.  So, I navigated to the php.exe, and then it executed your program (it just needed to be associated to php.exe the first time - fyi for everyone else out there that might see this).

Finally, it tried to run, and I get this (and yea, I did supply my gv user and pw). I honestly wonder if me trying to create all those required subfolders manually has anything to do with this?

Google Voice text message to X10 translator

PHP Notice:  Undefined offset:  0 in C:\text2x10\text2x10.php on line 205

Notice: Undefined offset:  0 in C:\text2x10\text2x10.php on line 205
There is no stored username and password for the system to use.
If using the script for the firs time, you must include your
Google Voice login information:

text2x10 <GV username> <GV password>



















« Last Edit: July 06, 2011, 02:14:38 PM by shuggins »
Logged

dbemowsk

  • Hero Member
  • *****
  • Helpful Post Rating: 21
  • Posts: 428
    • PHP Web Scripting
Re: text2x10
« Reply #2 on: July 06, 2011, 02:10:57 PM »

I'll look into these things when I get home.
Logged
Dan Bemowski
Owner of PHP Web Scripting LLC
Programmer of RemoteWatch X10
User of any X10 products I can get my hands on.

dbemowsk

  • Hero Member
  • *****
  • Helpful Post Rating: 21
  • Posts: 428
    • PHP Web Scripting
Re: text2x10
« Reply #3 on: July 07, 2011, 12:20:46 AM »

Hi dbemowsk,

I gave this a whirl on lunch break.  At first it was complaining about not finding items in ./include/ and ./ext/ sub folders.  I noticed that the zip did not include the folder paths, so when I unzipped, it put everything in the root folder - no subdirectories were made.  So I guessed at it and put things in /include/ and /ext/ sub directories that I created.  Then when I typed in text2x10.php with my gv user/pw, it asked me to select a program to open it up on my machine.  So, I navigated to the php.exe, and then it executed your program (it just needed to be associated to php.exe the first time - fyi for everyone else out there that might see this).

Finally, it tried to run, and I get this (and yea, I did supply my gv user and pw). I honestly wonder if me trying to create all those required subfolders manually has anything to do with this?

Google Voice text message to X10 translator

PHP Notice:  Undefined offset:  0 in C:\text2x10\text2x10.php on line 205

Notice: Undefined offset:  0 in C:\text2x10\text2x10.php on line 205
There is no stored username and password for the system to use.
If using the script for the firs time, you must include your
Google Voice login information:

text2x10 <GV username> <GV password>

OK, I tried installing this on 2 different machines and did not have a problem with either install.  The folder structure on both installs was fully created.  First, I am curious about the first steps you took to unzip the file, like what program you used (e.g. 7zip, pkzip, windows explorer ? ? ?)?  There had to be a reason why it didn't keep the folder structure in tact when you unzipped it.  Also, you mentioned that you typed text2x10.php with your GV username and password.  This is NOT correct.  There is a batch file named text2x10.bat, so you only need to type "text2x10 with your GV username and password".

The two times I installed it, I simply opened the text2x10.zip file in windows explorer and dragged it to the root of c:\.  I then had a c:\text2x10_dist\ folder.  I navigated to the c:\text2x10_dist\ folder in a DOS command prompt (cmd) window and typed :

Code: [Select]
text2x10 user@host.com password
Where "user@host.com" was my GV username and "password" was my GV password, and got the message:
Code: [Select]
The Google Voice username and password have been saved.
The next time you run the script, you only need to run:
text2x10
If you need to change the stored Google Voice username and
password simply run:
text2x10 <GV username> <GV password>
and the system will update the user information.

Listening

When typing your GV username and password, do not use the <>.  By default, the text2x10.cfg file has BEVERBOSE set to 1, so you should see messages displayed on the screen as the program does things.

I have made one minor code change to something that was ECHOing to the screen that shouldn't have been and I updated the zip file and got rid of the _dist, so future downloads will have c:\text2x10\ (if extracted to the c:\ root folder).  

My only suggestion I have for the moment is to try removing the folder and structure you created and try unzipping it again.  I used windows explorer to create the zip initially, and also to extract it when doing the two tests.   I am speculating that a support file didn't get extracted correctly, especially since you had to create some of the sub-folders.
« Last Edit: July 07, 2011, 12:28:52 AM by dbemowsk »
Logged
Dan Bemowski
Owner of PHP Web Scripting LLC
Programmer of RemoteWatch X10
User of any X10 products I can get my hands on.

dbemowsk

  • Hero Member
  • *****
  • Helpful Post Rating: 21
  • Posts: 428
    • PHP Web Scripting
Re: text2x10
« Reply #4 on: July 07, 2011, 12:45:50 AM »

Shuggins, I now see why you typed text2x10.php to start the program.  Because that is what I had in the documentation.  I have corrected this in the readme and am uploading the new one now.
Logged
Dan Bemowski
Owner of PHP Web Scripting LLC
Programmer of RemoteWatch X10
User of any X10 products I can get my hands on.

shuggins

  • Full Member
  • ***
  • Helpful Post Rating: 0
  • Posts: 51
Re: text2x10
« Reply #5 on: July 07, 2011, 10:14:32 AM »

dbemowsk,

I used power archiver to unzip it.  It's a free program that is very inconsistent.  I tried again and used good ole Windows to uncompress and that did it!  I now use text2x10 name@host.com pass and up it came!  It responded with "listening".  I texted a couple commands I added to the commands.cfg file which were:
table master off:C3 off
table master on:C3 on

It recognized that it received the texts, but nothing happened.  Is the program supposed to echo out that it also sent the X10 commands?  Just for grins I stopped your program and fired up starbotcontrol and did the same thing and the lights came on....so at least my X10 system is working.

PS: using CM19a X10 device on a windows 7 machine, if that helps.  Maybe I should try an XP machine?  But the main HA pc is my win 7 machine.

One more thing....
I opened text2x10.cf and noticed this:
;Attention phrase
AP | @computer
I need to text my command shown above again with "master on@computer", right?  I tried that too and wasn't successful.

« Last Edit: July 07, 2011, 10:27:47 AM by shuggins »
Logged

dbemowsk

  • Hero Member
  • *****
  • Helpful Post Rating: 21
  • Posts: 428
    • PHP Web Scripting
Re: text2x10
« Reply #6 on: July 07, 2011, 10:59:57 AM »

The way the attention phrase is used is as follows:

@computer table master on

I chose "@computer" because you are in a sense talking at (or to) the computer.  The attention phrase can be changed to anything you like though, you just have to type that as the first part of the text message.  I did that so that people couldn't just send you random texts that turn your stuff on and off without knowing the attention phrase.

I am not sure if this will work with the CM19A or not.  I may need to set it so the device type (CM15A, CM19A, etc...) can be configured.  It may just be a matter of changing the sendplc command in the text2x10.php file to a sendrf command.  I use it with my CM15A and it works good.
Logged
Dan Bemowski
Owner of PHP Web Scripting LLC
Programmer of RemoteWatch X10
User of any X10 products I can get my hands on.

shuggins

  • Full Member
  • ***
  • Helpful Post Rating: 0
  • Posts: 51
Re: text2x10
« Reply #7 on: July 07, 2011, 11:46:12 AM »

Yea, ok I now understand the passphrase.  Very nice idea! Yea - cm
19a needs rf not plc commands sent out. If you add something like that to config, I'd be glad to test. 

Keep up nice work!!   Love the potential of this thing!!!

Logged

Noam

  • Community Organizer
  • Hero Member
  • ***
  • Helpful Post Rating: 51
  • Posts: 2818
Re: text2x10
« Reply #8 on: July 07, 2011, 12:26:48 PM »

I've been playing with this for a few minutes on my "test" setup, and I have to say that it is really neat!
One thing that might be helpful, though, would be a way to send a direct command (like "C4 On"), without having to put it into the config file, and restart the app.

I might have missed it, but I didn't see anything in the documentation about how to do that.
Logged

dbemowsk

  • Hero Member
  • *****
  • Helpful Post Rating: 21
  • Posts: 428
    • PHP Web Scripting
Re: text2x10
« Reply #9 on: July 07, 2011, 12:59:21 PM »

Noam, sounds like an easy add that I could do in less than an hour.  I can look at that tonight.  I'll also look at adding the selection of an interface (CM15A, CM19A).  I do not use a CM19A, can anyone tell me if it works with the SDK just sending "sendrf" commands?
« Last Edit: July 07, 2011, 01:02:19 PM by dbemowsk »
Logged
Dan Bemowski
Owner of PHP Web Scripting LLC
Programmer of RemoteWatch X10
User of any X10 products I can get my hands on.

Noam

  • Community Organizer
  • Hero Member
  • ***
  • Helpful Post Rating: 51
  • Posts: 2818
Re: text2x10
« Reply #10 on: July 07, 2011, 01:03:06 PM »

Cool!
Also, I have noticed that AHCMD crashes randomly every so often. It is has been going on for a while, and I know that the developers have it on their list to look into.
Is there any way for the app to look for this, and kill the process if it has crashed?
Logged

dbemowsk

  • Hero Member
  • *****
  • Helpful Post Rating: 21
  • Posts: 428
    • PHP Web Scripting
Re: text2x10
« Reply #11 on: July 07, 2011, 01:29:45 PM »

I'll look into that.  I have not had it crash on me yet, but that's not to say it doesn't for others.
Logged
Dan Bemowski
Owner of PHP Web Scripting LLC
Programmer of RemoteWatch X10
User of any X10 products I can get my hands on.

dbemowsk

  • Hero Member
  • *****
  • Helpful Post Rating: 21
  • Posts: 428
    • PHP Web Scripting
Re: text2x10
« Reply #12 on: July 07, 2011, 07:19:07 PM »

OK, I have updated the script.  The updated version has the following changes:

1 - The ability to send raw x10 commands such as "e3 on" or "e3 bright 75" (e.g. @computer e3 dim 50)
2 - The ability to choose an interface in the text2x10.cfg file.  The CM15A and the CM19A are the only options.  I have not been able to test the CM19A, so if someone could confirm that one for me, that would be cool.
3 - The ability to choose between using the standard ahcmd.exe for executing commands or using the x10cmd.exe that I created last year.  I tried the x10cmd with X10 bright/dim commands and the x10cmd.exe crashed, not sure why as of yet, but the x10cmd seemed to work with all other commands from what I could tell.  Using the ahcmd, I was able to run the bright/dim commands just fine.  I have NOT found a way yet to check if the ahcmd file is hung, thus being able to timeout the script and re-run it.

Download now and give me some feedback.
Logged
Dan Bemowski
Owner of PHP Web Scripting LLC
Programmer of RemoteWatch X10
User of any X10 products I can get my hands on.

Noam

  • Community Organizer
  • Hero Member
  • ***
  • Helpful Post Rating: 51
  • Posts: 2818
Re: text2x10
« Reply #13 on: July 07, 2011, 10:22:24 PM »

Can your x10cmd.exe handle Extended Dim commands?
Logged

dbemowsk

  • Hero Member
  • *****
  • Helpful Post Rating: 21
  • Posts: 428
    • PHP Web Scripting
Re: text2x10
« Reply #14 on: July 07, 2011, 11:34:00 PM »

I am going to fix that and re-upload it.  I only had the program working with 3 parameters (e.g. sendplc a1 off).  for a dim command you need to use 4 parameters (e.g. sendplc a1 dim 50).  As for extended commands I have never used extended commands yet.  If you give me an example of an extended command I can probably write it into the program.  Basically I need to see how many parameters I need to parse for.

The x10cmd.exe program was just something simple I did in VB that was based off of the ahscript.dll which from posts in the forum was said to be much more stable than the ahcmd.exe.  The problem was that you couldn't use the DLL from the command line.  The plan when I did it was to just be a replacement for the ahcmd.exe for command line use.
Logged
Dan Bemowski
Owner of PHP Web Scripting LLC
Programmer of RemoteWatch X10
User of any X10 products I can get my hands on.
Pages: [1] 2 3 ... 7
 

X10.com | About X10 | X10 Security Systems | Cameras| Package Deals
© Copyright 2014-2016 X10.com All rights reserved.