X10 Community Forum

🖥️ActiveHome Pro => SDK => Third Party Add-Ons & Software => Topic started by: davideinmd on November 30, 2009, 10:22:26 AM

Title: Text to x10?
Post by: davideinmd on November 30, 2009, 10:22:26 AM
I saw this thing...
http://cgi.ebay.com/USB-Antenna-GSM-GPRS-Wireless-Modem-Adapter_W0QQitemZ390114737987QQcmdZViewItemQQptZLH_DefaultDomain_0?hash=item5ad4a67f43

I wonder if there would be a way to use this to send commands to x10 via SMS text.
Title: Re: Text to x10?
Post by: davideinmd on December 11, 2009, 10:22:39 AM
This shouldn't be so hard I would think for you buffs out there. I tried using Tuiceman's AlertDialer to accomplish a similar goal but I can't get that program to work. What I need:
I am on my way home and I want to use my phone to send an x10 command. How can I do it?
Title: Re: Text to x10?
Post by: Tuicemen on December 11, 2009, 05:23:24 PM
Sorry to here AlertDialer won't work for you!
It's to bad they never set a standard for modems!

SMS is basically short email messages.
I can SMS my phone via outlook (Phone#)@(Phone serviceProvider)
If you can send email  you could configure outlook to fire a x10 code and a confirmation text back. Of coarse you'd want to pull off the road (If behind the wheel) to text! rofl
I suspect you'd have hit & miss luck with the wireless modem as well! :(
 >!
Title: Re: Text to x10?
Post by: Knightrider on December 11, 2009, 05:39:22 PM
see also:

http://forums.x10.com/index.php?topic=18256.0
Title: Re: Text to x10?
Post by: davideinmd on December 12, 2009, 02:02:24 AM
Quote
SMS is basically short email messages.
I can SMS my phone via outlook (Phone#)@(Phone serviceProvider)
If you can send email  you could configure outlook to fire a x10 code and a confirmation text back. Of coarse you'd want to pull off the road (If behind the wheel) to text!
I suspect you'd have hit & miss luck with the wireless modem as well!

Except this communication is going the wrong way...

Quote
see also:

http://forums.x10.com/index.php?topic=18256.0

I read this post and sent a message to see if he was still working on it but didn't get a reply.
I did, however find a program called GCALDaemon. http://gcaldaemon.sourceforge.net/usage14.html (http://gcaldaemon.sourceforge.net/usage14.html)

However after a few hours of tweaking I was unable to get a batch file to run upon recieving the text message.
Title: Re: Text to x10?
Post by: davideinmd on December 12, 2009, 04:40:48 PM
Now I have tried two other programs. RemoteByMail www.runtime.org (http://www.runtime.org) and Tweet My PC http://tweetmypc.codeplex.com/ (http://tweetmypc.codeplex.com/) . With both these programs I get a response that says the command has been executed, but in reality it wasn't.  >*<
Title: Re: Text to x10?
Post by: davideinmd on December 13, 2009, 08:25:37 AM
Ok, here we go. I found a program here http://www.gianniamato.it/grc/ (http://www.gianniamato.it/grc/)
This program requires almost no setup and I can text an email to gmail and it will run the batchfile that will turn my driveway lights on while I am on ,y way home. There are quirks. But if anyone wants the specifics, reply here and I will tell all! Weeeeeeeeeee! It works!!!!!!!
Title: Re: Text to x10?
Post by: Knightrider on December 13, 2009, 09:06:35 AM
Not sure if SMS is my thing, but for education's sake, please share!
Title: Re: Text to x10?
Post by: davideinmd on December 13, 2009, 07:44:06 PM
The link I posted has a link for a program called GMail Remote Command 1.0. It's a simple program that checks your Gmail account once per minute. The instructions for program are there too. I've made batch files with simple (short) names and put them in the c:\ drive root directory. Quoting Bill (of wgjohns.com):
Quote
ahscript_setup.exe is a file provided in the AHP SDK that installs the basic ActiveX / COM scripting object and maybe the basic CM15A drivers (not so sure about that).

If you have installed the AHP SDK or even AHP itself already, ahscript_setup.exe won't do much for you.

ahcmd.exe is the command line interface for programs that can't handle ActiveX / COM to use to send X10 commands to the CM15A.  It is normally found in the "Program Files\Common Files\X10\Common" folder (or on 64 bit Windows, the "Program Files (x86)\Common Files\X10\Common" folder).
An example of the use of ahcmd.exe is: "ahcmd.exe sendplc a1 on"

That should help you create a simple batch file but I don't know where all the commands can be found. My purpose it that I need my driveway lights on when I get home and it's dark or I can't even see the driveway. So a few minutes before I get home I text the command to run the batch file to turn the lights on in the subject line. The text area remains blank. Downsides include that you have to delete the email when you get home. Also I think restarting the app is needed too. But once you do that you just can leave it on. It will only respond to subjects that start and end with the characters that you designate.
Title: Re: Text to x10?
Post by: Tuicemen on December 13, 2009, 08:04:53 PM
davideinmd:
I believe the commands are in the SDK\help folder, Filename: ahscript.chm
problem is the ahcmd file is a little flaky not 100% reliable (just so you know).
 >!
Title: Re: Text to x10?
Post by: davideinmd on December 14, 2009, 01:21:50 AM
Quote
problem is the ahcmd file is a little flaky not 100% reliable

Ok, that may be true. Right after reading that, I fooled with it and A1 kept sending an RF OFF command. I unplugged my signal repeater/extender thing and do you know those lights just stayed lit! For almost a half hour, unplugged! I took the thing outside but that still didn't help. I tired for a half hour to fix it because nothing else would work. Then it just quit doing it and everything was normal again. I didn't enter the script for the new .bat file I was making and I think I caused a problem like that. But other than that it seems to work great! The value is like telling the house you are on your way home so turn on the outside lights and the lights in the kitchen. I keep as much turned off as possible when I am gone because with all these computers and the fish tank and the turtle pond and the chest freezer...ya know, electric is expensive! So anyway since I couldn't get a remote to work from the road and I needed the driveway lights to come on to find the driveway enterance and a motion sensor would be useless if it could reach because other traffic passing would keep turning them on, this was the best solution I could find. It just costs me a text message and a small amount of hassle with the program. But a better written program could make this a piece of cake. Anyhow, I'll try to post a step-by-step in the next reply. All of this makes me think of the S.A.R.A. project. Not only can the house know you are home, but it can know you are on your way! >!
Title: Re: Text to x10?
Post by: HA Dave on December 14, 2009, 08:39:06 AM
... I'll try to post a step-by-step in the next reply. All of this makes me think of the S.A.R.A. project. Not only can the house know you are home, but it can know you are on your way! >!

I like that!!!
Title: Re: Text to x10?
Post by: Tuicemen on December 14, 2009, 08:48:03 AM
Quote
But a better written program could make this a piece of cake
So true!
 
If you only use one X10 HC command with your SMS (turn on\off drive way lights) there is a way around using the AHCMD and its flakiness!
Few use this option because it's not widely known, PCC can fire  a X10 signal via a batch file.
I added this when I first coded the Phone call options.
Go to Options\Event Triggers\Phone Ring triggers.
In the line send with ring choose the send option(PLC or RF), HC and UC
click OK
Now create a batch file Syntax is (path to PCC) (space) (">SendON<") (space) (number of times to send)
You can  send a Off command with ">SendOFF<"
Number of times to send you'd want 0
If you save the Batchfile to PCCs batchfile folder the bat file would look like this:
Code: [Select]
@ echo off
cd..
PcCompanion ">SendON<" 0

Not sure if this will help you!
Note: this option is available in the trial (locked) version of PCC
 >!
Title: Re: Text to x10?
Post by: davideinmd on December 14, 2009, 08:56:23 AM
Step 1: Download the GMail Remote Controller from http://www.gianniamato.it/grc/ (http://www.gianniamato.it/grc/)
Step 2: Extract the file. There is no installation. It's just a simple, stand-alone program
Step 3: Setup a GMail account. (You may want a special account just for X10 but that's optional)
Step 4: Create a batch file using notepad to execute the desired commands. Mine is called on.bat and looks like this:
d:\Users\David\Desktop\ahcmdmods\ahcmd.exe "sendplc" "b10 on"
d:\Users\David\Desktop\ahcmdmods\ahcmd.exe "sendplc" "b12 on"
d:\Users\David\Desktop\ahcmdmods\ahcmd.exe "sendplc" "b13 on"
* Be sure to save this in your c:\ root directory! (or E or F or whatever drive letter you use)
Step 5: Open the GRC.exe file
Step 6: Click 'Settings'
Step 7: Change the Subject Tag Left/Right to something easy (I use a hyphen for both)
Step 8: Click Login, fill out the blanks and click the 'Sign in' button
Step 9: Text an email to your GMail account. The command goes in your subject line. Do not put text in the body. (Ex: -c:\on-)
Step 10: Wait about 1-2 minutes and the commands will execute
Step 11: Delete the email from GMail and close GRC.exe
Step 12: Repeat steps 5-11 to reset the process.

Note: Since I am unable to make a text template insert in the subject field, I save a copy of the text message in my phone and forward it to GMail when I want it to run. This causes the subject to insert 'FW: ' so I make my Subject Tag Left 'FW: -'

Also note that d:\Users\David\Desktop\ahcmdmods\ahcmd.exe is just telling the bat file where ahcmd.exe is.

Good luck!
Title: Re: Text to x10?
Post by: davideinmd on December 14, 2009, 09:01:40 AM
Quote
So true!
 
If you only use one X10 HC command with your SMS (turn on\off drive way lights) there is a way around using the AHCMD and its flakiness!
Few use this option because it's not widely known, PCC can fire  a X10 signal via a batch file.
I added this when I first coded the Phone call options.
Go to Options\Event Triggers\Phone Ring triggers.
In the line send with ring choose the send option(PLC or RF), HC and UC
click OK
Now create a batch file Syntax is (path to PCC) (space) (">SendON<") (space) (number of times to send)
You can  send a Off command with ">SendOFF<"
Number of times to send you'd want 0
If you save the Batchfile to PCCs batchfile folder the bat file would look like this:

Code:
@ echo off
cd..
PcCompanion ">SendON<" 0

Kudos! If the ahcmd gives me (or anyone else real trouble, that will be the fix! Thanks Tuice!
Title: Re: Text to x10?
Post by: Knightrider on December 14, 2009, 06:19:44 PM
David E.
In Md.
+1 from me!
Title: Re: Text to x10?
Post by: Geewiz on December 18, 2009, 05:33:55 AM
Sorry to here AlertDialer won't work for you!
It's to bad they never set a standard for modems!

SMS is basically short email messages.
I can SMS my phone via outlook (Phone#)@(Phone serviceProvider)
If you can send email  you could configure outlook to fire a x10 code and a confirmation text back. Of coarse you'd want to pull off the road (If behind the wheel) to text! rofl
I suspect you'd have hit & miss luck with the wireless modem as well! :(
 >!

Well, now that X10Dispatcher won't do the job.... can you explain how outlook can fire an X10 command?
Title: Re: Text to x10?
Post by: Tuicemen on December 18, 2009, 08:13:07 AM
Its been years since I've done this! ::) :' I think it uses rules and subject line, perhaps PajamaGuy  can Jump in with a walk threw as I know he currently uses this in his setup! ???
I wish AccessHA was still up there was a small program written that would do it all for you. :)
Title: Re: Text to x10?
Post by: davideinmd on December 18, 2009, 08:45:03 AM
I don't really know if this helps. If not, let's delete it.

http://support.microsoft.com/kb/201095
Title: Re: Text to x10?
Post by: PajamaGuy on December 18, 2009, 09:52:46 AM
Executing X10 Commands via Email

I use Outlook (2010), but any email program that allows RULES which will execute an external application should work.
You need to download the X10 SDK, and extract the AHCMD.exe program from it.

In the DOS days, I just added the location of AHCMD.exe to my PATH, but now I explitcitly call it.

On my D: drive I have D:\ActiveHome\Scripts and I put AHCMD.exe in there along with the associated batch files (*.bat)
The HELP file within the SDK lists the commands – both PLC and RF.

Powerline Commands
Powerline commands are specified with the "sendplc" parameter, and take several different forms. Each requires that you specify an X10 address (A1-P16), plus additional command parameters structured as follows:
•   On: <X10 address> on
•   Off: <X10 address> off
•   Dim: <X10 address> dim <dim percentage (of 100%)>
•   Bright: <X10 address> bright <bright percentage (of 100%)>
•   All Lights On: <X10 address (must include Unit Code)> alllightson
•   All Units Offn: <X10 address (must include Unit Code)> allunitsoff
•   Extended Code Command: <X10 address> <command> <value> (command and value are specified in hex).
This list containts all of the powerline commands used by the Scripting Interface.
Example of complete powerline transmission command:
"sendplc", "a3 dim 75"

This would tell the interface to send address module A3, and then send a dim command of sufficient duration to dim the module 75% of full brightness.

I only use the “SendPLC” commands.
A simple batch file might be:

ArmStat.bat
D:
CD \ActiveHome\Scripts
AHCMD.exe “sendplc” “M5 ON”

So I create a RULE in Outlook that looks at the subject line of all messages.
If it “sees” the string, “X10:ArmStat” it runs the application “ArmStat.bat”

ArmStat.bat runs, sends M5 ON as a PLC which flips a Phantom AM466 M5 to the on position.  Macro M5 is triggered by the M5=ON and does it’s thing.

That’s really all there is to it.  You can make it as complex or as simple as you like.

Since I haven’t found a way to pass parameters, I have a batch file for every action I want to trigger via email.  Most of the associated macros send me a return email confirming the action happened.

Confirmation is importand because Outlook has a nasty habit  of hanging when an account doesn’t connect with the email host – just sitting there with a dialog box open waiting for you to click “OK”

This is a hurried explanation, and I apologize for it being so – if you’d like more, send me a message and I’ll work up more detail this weekend –

Dave
Title: Re: Text to x10?
Post by: Fan of Zappa on May 18, 2011, 03:22:21 PM
Is there another email program out there that will allow you to run a program as an action to a "true" email rule? I could not get the Gmail thing to work. This is exactly what I need. As of right now I put a 2 hr 30 min delay on my "Text me" alarm at the house because there are still people there when I leave. I have a few MS16a in the house and when they trip I have a scrip that emails me someone is in the house. I would like to turn it on by phone.


Thanks!
B.
Title: Re: Text to x10?
Post by: Fan of Zappa on May 20, 2011, 09:17:51 AM
PajamaGuy,

You are a GENIUS! I downloaded a FREE email client, Pegasus Mail, Google it. set up an email address just for X10 use, scripted a few batch files, and it works like a champ! the WAF is at a very high level and I am referred to as a true GEEK! thank you.
BTY guys this will work on the cm15a so no need to do the Google voice thing.   >! #:)

Bob
Title: Re: Text to x10?
Post by: Noam on May 20, 2011, 10:21:11 AM
Back in 2004, I had found a PERL script called "X10emailcomm", written by a guy names Warren Bell, which does something similar.
It checks a POP3 mail account for messages starting with "[home]", and then passes the body of the message to AHCMD, one line at a time.
You run the script as a scheduled task in Windows, at whatever interval you want.
You can then send whatever commands you want into the script, no need for custom batch files for every action you might want to run.

However, I can't find it online anymore. His domain is no longer active, and I don't know if I still have the original files.
Title: Re: Text to x10?
Post by: shuggins on May 20, 2011, 12:50:15 PM
Fan of Zappa,

I think I have this all working...man, getting Pegasus Mail to play nice with gmail was not trivial, but I got it to work.  I set up a rule to execute an external batch file to turn lights on (like described above), and it worked....sort of...

Quick question, how did you get the rules to automatically fire off when the email is received?  I had to do to Options and tell it to run the rules manually- ie: for me, Pegasus Mail won't run the rules as the emails are received- I had to tell it run the rules after they were already in the inbox.

Scott
Title: Re: Text to x10?
Post by: Fan of Zappa on May 20, 2011, 02:21:30 PM
Shuggins,

I am using pop3. click file, Network config, receiving (POP3), check for new mail every .... I put 2 seconds.
Under rules i have...
expression: c1 on
Occurs in the messages: body only (because I can not text a subject)
Action: run a program
Set: c:\batchx10\c1on.bat

c1on.bat:

c:\batchx10\ahcmd sendplc c1 on

I text my email address from my phone:
c1 on


it works within 15 seconds of "message sent" on my phone.

Bob

PS now if I can only get iHouse to work!
Title: Re: Text to x10?
Post by: shuggins on May 20, 2011, 02:27:39 PM
Bob,

Ahhh....I set mine up in Pegasus Mail as "imap" instead of "pop3".  Let me go redo it as pop3. 
RE: iHouse...you NEED to get that up and running...it's the best, imho.  PM me over on the iHouse forum and I can try to help.  Do you have another PC you could try it on?  Maybe a spare laptop?

Scott