Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: PH RS-232 Newbee Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
rrockoff
Newbie
Newbie


Joined: June 02 2008
Location: United States
Online Status: Offline
Posts: 13
Posted: July 10 2008 at 17:32 | IP Logged Quote rrockoff

Can someone please point me in the right direction? I am just starting out with Power Home. My immediate goal is to connect power home to my new pool equipment. I am using a new install of Power Home version 1.03.4.12. I want to connect and control via RS-232 this device: GoldLine Controls AQ-CO-SERIAL Aqua Connect Home Automation Interface Module

I did a search on RS-232 and serial on this message board and came up with about a dozen hits. I also found the PH_com commands under help in the program. I think I'm just missing something basic. Can someone please explain how I would configure this RS-232 device?

Thanks in advance,

Rod
Back to Top View rrockoff's Profile Search for other posts by rrockoff
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: July 11 2008 at 09:42 | IP Logged Quote TonyNo

This is a tough one for a first-time project!

I assume you have the 232-to-485 adapter shown?

There are a lot of commands and responses there. It would be best for you to just pick a few to start with.

You would first need to create a macro that gets the data when it comes in. Something like this is a simple start that just reads, assembles, and send the data to the Event log.

Macro: COM
Code:
10 Set System [TEMP1] ""      
20 Label Next      
30 Set System [LOCAL1] ph_comrecvchar( 1 )      
40 Set System [LOCAL2] string( "[LOCAL1]" )      
50 Jump if( "[LOCAL2]" = "-3", 3, 1)      
60 Set System [TEMP1] "[TEMP1]" + char( integer( "[LOCAL1]" ))
70 Goto Label "Next"
80 User Message "[TEMP1]"


The user message will be cryptic since only the display update commands have ASCII data.

Now for opening the port. The docs say 1 start bit, 8 data bits, no parity and 2 stop bits and the data rate is 19.2 kbps.

Assuming COM2...

ph_comopen( 1, 2, 19200, "N", 8, 2, 1, 0, 0, 0, 0, 1, 1, "?", "COM" )

Luckily, the checksum method it uses is simple. Just add the first four bytes. Here is an example of sending a simulated Menu keypress and release...

Code:
ph_comsendstring( 1, "\010\002\001\002\010\005\010\003" )
ph_comsendstring( 1, "\010\002\002\002\010\006\010\003" )


I'm sure there will be a lot of other questions!
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
rrockoff
Newbie
Newbie


Joined: June 02 2008
Location: United States
Online Status: Offline
Posts: 13
Posted: July 11 2008 at 12:54 | IP Logged Quote rrockoff

Tony,

Thanks for the reply. I really appreciate your help.

I understand the first step of creating a macro called "COM" and I seethat "COM" is referenced in the ph_comopen command. However I'm not sure where to add the ph_comopen command or where to add ph_comsendstring. Would these also be macros?

Thanks again,

Rod
Back to Top View rrockoff's Profile Search for other posts by rrockoff
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: July 11 2008 at 13:22 | IP Logged Quote TonyNo

These are all for macros, or, you could put them directly in the Control Center, PH web pages, or even in Triggers.

The ph_comopen would, ideally, go in a Startup macro that is set up to run every time PH starts. You would then put the ph_comsendstring's in other macros.

The COM macro gets you started with receiving data sent from the unit.

If you can define one or two things that you want to do, I can help more.
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
rrockoff
Newbie
Newbie


Joined: June 02 2008
Location: United States
Online Status: Offline
Posts: 13
Posted: July 11 2008 at 13:47 | IP Logged Quote rrockoff

I guessed that they should all be macros and have already inserted thee data in PH as three different macros. I would like to eventually setup a webpage that would act and react just like one of the remotes that come with the pool. I realize that I need to crawl before I can walk or run. If I could get examples on how create a macro to turn the lights on and off I think I can apply it to the rest of the keys.

My goal, once I get a better understanding, would be to doument this procedure and add to the wiki.

Also there is mention of polling the temp on page 9 of the manual. I may need ask for help on that one after I get the rest of it working. But I will have plenty of work to do before I can start on the temp project.

Thanks,

Rod
Back to Top View rrockoff's Profile Search for other posts by rrockoff
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: July 11 2008 at 18:24 | IP Logged Quote TonyNo

OK, those docs are confusing. It looks like they may be mixing hex and decimal. My examples must be considered wrong until you can double-check this with the manufacturer, but...

Assuming it's all hex, the Menu key would be...

Code:
ph_comsendstring( 1, "\x10\x02\x01\x02\x00\x15\x10\x03")
ph_comsendstring( 1, "\x10\x02\x02\x02\x00\x16\x10\x03")


If light control is via the Lights button on the keypad, it would be this...

Code:
ph_comsendstring( 1, "\x10\x02\x01\x09\x00\x1c\x10\x03")
ph_comsendstring( 1, "\x10\x02\x02\x09\x00\x1d\x10\x03")

Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
rrockoff
Newbie
Newbie


Joined: June 02 2008
Location: United States
Online Status: Offline
Posts: 13
Posted: July 18 2008 at 13:58 | IP Logged Quote rrockoff

I am getting closer to my goal. I can open the port and this code seems to execute:

Code:

ph_comsendstring( 1, "\010\002\001\002\010\005\010\003" )
ph_comsendstring( 1, "\010\002\002\002\010\006\010\003" )


But I am still working on the code to turn the lights on and off.

Could you please help to clarify a few more items for me?

1. I defined the command type for ph_commands as "Formula". Is this the correct command type to use for ph_commands?

2. Is it correct to how two commands for one line of code?
Example:
10 Formula Immediate ph_comsendstring( 1, "\010\002\001\002\010\005\010\003" )
                                   ph_comsendstring( 1, "\010\002\002\002\010\006\010\003" )

or should each ph_command have it's own separate line?
Example:

10 Formula Immediate ph_comsendstring( 1, "\010\002\001\002\010\005\010\003" )
20 Formula Immediate ph_comsendstring( 1, "\010\002\002\002\010\006\010\003" )

Thanks,

Rod


Edited by rrockoff - July 18 2008 at 14:00
Back to Top View rrockoff's Profile Search for other posts by rrockoff
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: July 18 2008 at 23:38 | IP Logged Quote TonyNo

1. Yes.

2. To combine those, just separate them with a +.

10 Formula Immediate ph_comsendstring( 1, "\010\002\001\002\010\005\010\003" ) + ph_comsendstring( 1, "\010\002\002\002\010\006\010\003" )

You could do it the second way also.
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
jbbtex
Senior Member
Senior Member


Joined: February 15 2007
Location: United States
Online Status: Offline
Posts: 181
Posted: February 03 2009 at 20:39 | IP Logged Quote jbbtex

Rod,

Did you get this Goldline stuff working?

I'm about to install the Goldline Pro Logic and I'm very interested in your results.

__________________
Brady

"Never tell people how to do things. Tell them what to do and they will surprise you with their ingenuity." - Gen. George S. Patton
Back to Top View jbbtex's Profile Search for other posts by jbbtex
 
rrockoff
Newbie
Newbie


Joined: June 02 2008
Location: United States
Online Status: Offline
Posts: 13
Posted: February 22 2009 at 13:36 | IP Logged Quote rrockoff

Hi Brad,

Sorry for the delayed response. I have not been able to work on my home automation projects for a while. I just updated to version 2.1b and I am back to working on this project. It's going to take me some time to get back into learning how to program with power-home. I will post again when I get closer. If it helps, I can connect va serial port to the Aqua Connect and I can see data coming through.

Rod
Back to Top View rrockoff's Profile Search for other posts by rrockoff
 
jbbtex
Senior Member
Senior Member


Joined: February 15 2007
Location: United States
Online Status: Offline
Posts: 181
Posted: February 22 2009 at 14:02 | IP Logged Quote jbbtex

Thanks Rod.

I'm still in the construction phase, so I don't have mine hooked up yet.

I've also asked Dave if he might be able to write a plug-in.

__________________
Brady

"Never tell people how to do things. Tell them what to do and they will surprise you with their ingenuity." - Gen. George S. Patton
Back to Top View jbbtex's Profile Search for other posts by jbbtex
 
jbbtex
Senior Member
Senior Member


Joined: February 15 2007
Location: United States
Online Status: Offline
Posts: 181
Posted: May 30 2009 at 23:40 | IP Logged Quote jbbtex

I have my AQ-CO-SERIAL now and have been able to control my pool equip. using the command format TonyNo outlined above.

However, getting data from the Goldline controller is proving much more difficult.

Tony's example macro never stops executing because there is never a "-3".

Looking at the data in HyperTerm there is just a continuous stream.

Here's an example:


Suggestions welcomed.

__________________
Brady

"Never tell people how to do things. Tell them what to do and they will surprise you with their ingenuity." - Gen. George S. Patton
Back to Top View jbbtex's Profile Search for other posts by jbbtex
 
jbbtex
Senior Member
Senior Member


Joined: February 15 2007
Location: United States
Online Status: Offline
Posts: 181
Posted: May 31 2009 at 14:39 | IP Logged Quote jbbtex

This gets the pool temp.

Code:

10 Set System [TEMP1] ""       
20 Label Next       
30 Set System [LOCAL1] ph_comrecvstring( 1, 1 )       
40 Jump if( "[LOCAL1]" = "H", 3, 1)       
50 Set System [TEMP1] "[TEMP1]" + "[LOCAL1]"
60 Goto Label "Next"
70 Set Global POOL TEMP ph_regexdifF("pool temp", "_F", "[TEMP1]", 1, 0)



__________________
Brady

"Never tell people how to do things. Tell them what to do and they will surprise you with their ingenuity." - Gen. George S. Patton
Back to Top View jbbtex's Profile Search for other posts by jbbtex
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum