Please login or register.

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

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

shuggins

  • Full Member
  • ***
  • Helpful Post Rating: 0
  • Posts: 51
Re: text2x10, Text messaging to operate your X10 devices.
« Reply #60 on: December 22, 2011, 02:24:05 PM »

Noam-

Maybe it would be helpful for me to take some screen shots of my GV set up and let you (or others) see what all check boxes, etc, I have checked?
Here is what I am doing...

1. I log into my GV account using browser.
2. I go to my Inbox.
3. I click the red "Text" button in upper-left.
4. I enter my GV phone # as the recipient.
5. I click Send and in my Inbox, I see only one text appear.
6. On the Text2x10 console, I see ONE text come in, and an X10 command gets sent that in turns my lamp.
7. Again, for me, it only does it once. 

If I also use my iPhone to send a text to my GV phone #, again, I only see one text come into Text2x10 and get processed (and only one will show up in the GV inbox).

Heck, maybe I'm just lucky...   :D
Logged

bkenobi

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 24
  • Posts: 2082
Re: text2x10, Text messaging to operate your X10 devices.
« Reply #61 on: December 22, 2011, 02:37:40 PM »

Ok, I figured it out.  When I send a GV SMS from GV, it uses my GV#.  When text2x10 responds, it's using the sender phone number to reply, so it will reply to the GV#.  If I send a message from my cell, it will show my cell number in the GV inbox.  So, text2x10 will respond to the sender phone number which is my cell.  I don't think this counts as forwarding, so I should be ok.

Noam

  • Community Organizer
  • Hero Member
  • ***
  • Helpful Post Rating: 51
  • Posts: 2818
Re: text2x10, Text messaging to operate your X10 devices.
« Reply #62 on: December 22, 2011, 03:51:36 PM »

Noam-

Maybe it would be helpful for me to take some screen shots of my GV set up and let you (or others) see what all check boxes, etc, I have checked?
Here is what I am doing...

1. I log into my GV account using browser.
2. I go to my Inbox.
3. I click the red "Text" button in upper-left.
4. I enter my GV phone # as the recipient.
5. I click Send and in my Inbox, I see only one text appear.
6. On the Text2x10 console, I see ONE text come in, and an X10 command gets sent that in turns my lamp.
7. Again, for me, it only does it once.  

If I also use my iPhone to send a text to my GV phone #, again, I only see one text come into Text2x10 and get processed (and only one will show up in the GV inbox).

Heck, maybe I'm just lucky...   :D


I took another look at the code. It looks like is is *supposed* to delete the message after it process it (which would leave ONLY the one you had sent. For some reason, mine isn't deleting it. Not sure why.
I'll have to look at the code again, and see if I can find a reason. (I did make a minor change to the reply text, perhaps I broke something else in the process).

EDIT: I think I might have an answer. I don't have a CM15a plugged into this laptop. So, perhaps it doesn't delete the incoming message if it can't run the command?
I'll have to test it on a machine with a CM15A to be sure.
« Last Edit: December 22, 2011, 04:01:58 PM by Noam »
Logged

bkenobi

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 24
  • Posts: 2082
Re: text2x10, Text messaging to operate your X10 devices.
« Reply #63 on: December 22, 2011, 04:06:04 PM »

I found that when I used the default attention phrase (@computer), GV received the message differently (!computer).  As a result, I would see text2x10 continually downloading and skipping the message.  It did not do this once and continue, it did this every 5 seconds.  When I used a different phrase (X10), the software works great.

Since this account is explicitly for X10 stuff, I have modified the code to process the message and delete it if it's AP is valid and just delete the message if it's not.  As a result, every 5 seconds or so I have a clean inbox.  While I was at it, I updated the code to also implement the status message that the manual indicates (which was not actually in the most up to date code).

Noam

  • Community Organizer
  • Hero Member
  • ***
  • Helpful Post Rating: 51
  • Posts: 2818
Re: text2x10, Text messaging to operate your X10 devices.
« Reply #64 on: December 22, 2011, 04:14:12 PM »

Well, when I tested on a machine with a CM15A, it DID delete the message after executing the command.
So, I'm thinking that perhaps if it can't execute the command (because there is no CM15A to send it to), it doesn't delete the message.
I tested by sending from one GV account to the other.
When I sent from my "X10" GV account to itself, it STILL deleted the message (both incoming and outgoing).

Not sure why you still see exactly one copy of the message.
Logged

bkenobi

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 24
  • Posts: 2082
Re: text2x10, Text messaging to operate your X10 devices.
« Reply #65 on: December 23, 2011, 01:33:19 PM »

I found a miniscule bug that anyone using this code should probably fix.  This does not affect function in any way, but it does cause the log to be incorrect.  The author uses the date function to get the date and time output to the log file.  He used a lower case 'h' for hours, but this provides a 12-hour time.  Since there's no AM/PM output, this provides somewhat spurious logged data.  Simply change this to an 'H' and it should be right.

Open text2x10.php and locate the logMessage function.

function logMessage($msg) {
    $file = "activity.log";
    //Create a file handler
    $fh = fopen($file, 'a');
    //Generate the message with the date
    $log = date("m/d/Y h:i:s")." - ".$msg."\r\n";
    //Write the message to the log
    fwrite($fh, $log);
    //Close the file
    fclose($fh);
} //End function logMessage

becomes

function logMessage($msg) {
    $file = "activity.log";
    //Create a file handler
    $fh = fopen($file, 'a');
    //Generate the message with the date
    $log = date("m/d/Y H:i:s")." - ".$msg."\r\n";
    //Write the message to the log
    fwrite($fh, $log);
    //Close the file
    fclose($fh);
} //End function logMessage

bkenobi

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 24
  • Posts: 2082
Re: text2x10, Text messaging to operate your X10 devices.
« Reply #66 on: December 23, 2011, 08:42:38 PM »

Now that I've changed the code so it outputs the 24-hour time, it now doesn't give the right time or date.  Any idea why that might be?  For instance, the following was recorded at 5:27 today:

Code: [Select]
12/24/2011 01:27:23 - Received text message : X10 status
Instead of saying 12/23/2011 17:27:23, it indicated tomorrow's date and the wrong time.

Noam

  • Community Organizer
  • Hero Member
  • ***
  • Helpful Post Rating: 51
  • Posts: 2818
Re: text2x10, Text messaging to operate your X10 devices.
« Reply #67 on: December 25, 2011, 08:37:12 AM »

Now that I've changed the code so it outputs the 24-hour time, it now doesn't give the right time or date.  Any idea why that might be?  For instance, the following was recorded at 5:27 today:

Code: [Select]
12/24/2011 01:27:23 - Received text message : X10 status
Instead of saying 12/23/2011 17:27:23, it indicated tomorrow's date and the wrong time.
Time zone offset, perhaps?
Logged

bkenobi

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 24
  • Posts: 2082
Re: text2x10, Text messaging to operate your X10 devices.
« Reply #68 on: December 25, 2011, 10:06:33 AM »

Yeah, I looked into that.  I wasn't familiar enough with php to make that change, but I did locate some code that would probably fix it.  I'll post when I figure it out.   ;D

bkenobi

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 24
  • Posts: 2082
Re: text2x10, Text messaging to operate your X10 devices.
« Reply #69 on: December 25, 2011, 12:14:27 PM »

The problem is that the time zone was not being set, so the code is defaulting to GMT.  It's supposed to be possible to set the time zone within the php.ini.  I had no luck setting things up that way, so I simply added a line at the top of the file to explicitly define my time zone.  I found a nice little function on one of the PHP manual pages that will automatically draw the information from your registry, but it's overkill for this since the user can simply type it in (that's designed for web server use I guess).

In the end, all you need to do is add the following to the second line of your php file:

Code: [Select]
date_default_timezone_set('America/Los_Angeles');

cheminge

  • Newbie
  • Helpful Post Rating: 1
  • Posts: 3
Re: text2x10, Text messaging to operate your X10 devices.
« Reply #70 on: February 06, 2012, 03:40:49 PM »

I think that this is Amazing! 

I have a request, can you make it so that when an email is received have it trigger and X10 macro!

I receive notification from our Dispatch system (I am a volunteer firefighter) and I want it to trigger a macro that turns on my lights so that I can get ready as quick as I can so that I can get to the station as fast as I can.

Our dispatch sends out a text message (actually an email message converted to a text)  As you may guess, Google Voice does not receive email text messages.

I am thinking that it could be simple as if an email was received from a specified address, then trigger the macro to run.
Logged

shuggins

  • Full Member
  • ***
  • Helpful Post Rating: 0
  • Posts: 51
Re: text2x10, Text messaging to operate your X10 devices.
« Reply #71 on: February 06, 2012, 04:03:52 PM »

Yep!  Look here, particularly at page two.  It worked great for me.  Sounds like it might help you out, although for me - sending texts to turn on/off x10 devices and send macros works better.

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

soxfan1966

  • Hero Member
  • *****
  • Helpful Post Rating: 3
  • Posts: 388
Re: text2x10, Text messaging to operate your X10 devices.
« Reply #72 on: March 16, 2012, 05:23:58 PM »

Hi All...

Have a relatively new X10 setup at home and now looking to get it a little more automated.  The Text2X10 concept looks like it could be very useful for me.

I have downloaded the software and set up an Google Voice account.  I went thru the steps to set up the config file and get the program running.

However, when I send a text to my Google Voice acct it just stays in the inbox an does not get picked up.  The Text2x10 program is running and just sits at "Listening" on the screen.

At first, I was using @home as the text keyword but for some reason Google Voice was changing that to !home.  So I switched my keyword to x10 after reading some info here - but that still does not work...

I should note that while I have the software running, I do not yet have an x10 USB Interface connected to my computer.  I was hoping to play around with the software a little bit before I bought one (Not sure if I am going to go from a CM19A or try and find a CM15A on ebay or the like).

Anyone have any suggestions to try and get this working?
Logged

shuggins

  • Full Member
  • ***
  • Helpful Post Rating: 0
  • Posts: 51
Re: text2x10, Text messaging to operate your X10 devices.
« Reply #73 on: March 17, 2012, 09:27:42 AM »

The reason it's not working for you is because Google changed the URL for their login authentication.   The fix is above on page #3 of this topic.  Follow the simple directions and you will be up and running.  It's working great for me....just tried to send some texts and it's good for me.

  
« Last Edit: March 17, 2012, 09:31:05 AM by shuggins »
Logged

bkenobi

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 24
  • Posts: 2082
Re: text2x10, Text messaging to operate your X10 devices.
« Reply #74 on: March 17, 2012, 10:58:25 AM »

Yes, this still works fine.  I've been using it for months and no issues!
Pages: 1 ... 3 4 [5] 6 7
 

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