Jandy Aqualink Pool / Spa Control - AppleScripts updated

Posted on
Sat May 31, 2008 6:04 am
yergeyj offline
Posts: 260
Joined: Dec 29, 2004

Jandy Aqualink Pool / Spa Control - AppleScripts updated

All,

I've updated the Jandy Pool/Spa scripts to use Lion-compatible SerialX:

Overview
This set of scripts provide Indigo support for controlling a Jandy Aqualink RS through SerialX and a Jandy Aqualink RS Serial Adaptor. [The script has been revised to use SerialX rather than Serial Bridge, as Serial Bridge will not operate in Mac OSX Lion.]

Installation
The scripts communicate with the Jandy system through a USB Serial Adaptor (e.g. the Keyspan USA-19HS USB Serial Adapter) connected to the Jandy Aqualink RS Serial Adaptor.

In order to use these scripts with SerialX, you will need to separately download and install SerialX as a Scripting Addition. As currently written, you will also need to determine the exact name of your serial connection and edit the following statement in both scripts:

property SerialConnectionName : "/dev/cu.USA19H47P1.1" -- Replace "dev/cu.USA19H47P1.1" with the name of your USB Serial Adaptor.

After editing, drag the Jandy Aqualink attachment script into the folder: /Library/Application Support/Perceptive Automation/Indigo 4/Scripts/Attachments
and the Jandy Aqualink background sync script into the folder: /Library/Application Support/Perceptive Automation/Indigo 4/Scripts/Background Tasks

Initiating use of the background script is typically accomplished by establishing a Trigger Action that activates on Indigo Server restart.

Usage
Assumes a Jandy Aqualink RS-4 or RS-8 Pool/Spa combination with auxiliary 1 set for pool light and auxiliary 2 set for spa light.

Unlike the previous version, the background script will now automatically execute periodically after being initiated (typically with a Trigger Action that activates on Indigo startup), will create variables as needed, and will update the status of those variables. By default the updates occur every 30 sec for most items using a single "#LEDS?" command, and every 30 min for the temperatures, with error detection if something does not update correctly. If the Spa is heating, temperature updates default to every 2 min. Variables created include AirTemp, ErrorFree, NextTempUpdate, PoolHeatEna, PoolHeatOn, PoolLightOn, PoolPumpOn, PoolSetPoint, PoolStateOn, PoolTemp, SpaHeatEna, SpaHeatOn, SpaLightOn, SpaSetPoint, SpaStateOn, SpaTemp.

The following is a list of the commands that can be called in the Jandy Aqualink attachment script from Indigo: JandyGetCompleteStatus(), JandyTurnOnSpaHeat(), JandyTurnOffSpaHeat(), JandyTurnOnPoolHeat(), JandyTurnOffPoolHeat(), JandyTurnOnLights(), JandyTurnOffLights(), JandyNewSpaSetPoint(NewSpaSetPoint), JandyNewPoolSetPoint(NewPoolSetPoint), JandyTurnOnSpa(), JandyTurnOffSpa(), JandyTurnOnSpaAndHeat(), JandyTurnOnSpaAndHeatAndLights(), JandyTurnOffSpaAndHeatAndLights()

Developed by Jim Yergey May 2008, modified by Jim and P. Gershon aug-2011
Last edited by yergeyj on Mon Sep 12, 2011 1:04 pm, edited 2 times in total.

Posted on
Tue Aug 12, 2008 8:44 pm
billshafer offline
Posts: 4
Joined: Jun 22, 2008
Location: Dallas, TX

Variation on a theme!

Hi, Jim!

I'm about to do a conversion to salt system with my pool/spa & also want to integrate the pool/spa automation control with the salt system controller. I've been looking at the Jandy automation/salt combo system, and I like the automation part...but not super-crazy about the salt system part.

The automation/salt system that I'm leaning more towards is the Pentair IntelliTouch system. Like Jandy, it has a serial adapter to interface with existing home automation systems. Here's a quote from the user guide for the serial adapter:

"The IntelliTouch i-Link Protocol Interface adapter enables homeowner’s using Home Automation systems such as Crestron, AMX, Vantage, Lutron and others to control most IntelliTouch pool and spa functions via their Home Automation control interface, including switching pumps on, activating valves, switching heaters or auxiliaries on, and adjusting thermostat settings."

The guide also provides a whole section on software commands. Now, I'm no programmer by any means, but there appear to be some similarities between what I see in your post for the Jandy commands & the Pentair IntelliTouch system.

Here's a link to a PDF of the i-Link adapter which I mention:

http://www.pentairpool.com/pdfs/i-LinkUG.pdf

Any assistance in modifying your Jandy script so that it's compatible with the Pentair system would be GREATLY appreciated!

Cheers!
--Bill

Posted on
Tue Aug 26, 2008 6:27 pm
yergeyj offline
Posts: 260
Joined: Dec 29, 2004

(No subject)

Bill,

Sorry, I hadn't checked in for a while! What about the Jandy system doesn't work with regard to your salt system? I don't have a salt system, as it's too cold here in PA much of the season (April through October) to use the salt system anyway.

I agree having looked at the IntelliTouch guide that many of the commands are very similar. Unfortunately without having the Pentair system available to test commands it would be really hard for me to make adjustments to the Jandy scripts.

Hopefully there is thorough enough comments in my scripts that you should be able to work your way through to make the necessary changes. If you have any specific questions about them I'd be happy to help.

I might suggest that you adopt something like the following as a test script to test each of the commands; just enter each command in place of the #PUMP? and use the Event Log in Script Editor to see how the IntelliTouch responds.


Code: Select all
property SerialConnectionName : "Jandy Aqualink RS Serial Adaptor"

tell application "Serial Bridge"
   send to source SerialConnectionName string "#PUMP1?"
   send to source SerialConnectionName byte 13
   delay 1 -- Wait for command and response
   set ResponseString to read string from source SerialConnectionName
end tell



Good luck,
Jim

Posted on
Wed Oct 15, 2008 2:45 pm
asw24b offline
Posts: 222
Joined: Dec 30, 2007
Location: Los Altos Hills, CA

Re: Jandy Aqualink Pool / Spa Control

yergeyj wrote:
All,

I've updated the Jandy Pool/Spa scripts to be an attachment script:

Overview
This set of scripts provide Indigo support for controlling a Jandy Aqualink RS through Serial Bridge and a Jandy Aqualink RS Serial Adaptor.

Installation
After downloading, drag the Jandy Aqualink attachment script into the folder:
/Library/Application Support/Perceptive Automation/Indigo 2/Scripts/Attachments, then Reload Attachments within Indigo.

Usage
Assumes a Jandy Aqualink RS-4 or RS-8 Pool/Spa combination with auxiliary 1 set for pool light and auxiliary 2 set for spa light.

Your Serial Bridge connection will need to be titled Jandy Aqualink RS Serial Adaptor. Note: the Keyspan USB Serial Adapter works well to interface between the Mac and Jandy Serial Adaptor.

Create a Time/Date Action to update the status of the pool/spa variables on an ongoing basis (for example, execute JandyGetStatus() every 5 minutes), so that changes from other Jandy devices are kept up-to-date in Indigo. The following text variables will be created when this Time/Date Action first executes: AirTemp, PoolHeat, PoolLight, PoolPump, PoolSetPoint, PoolState, PoolTemp, SpaHeat, SpaLight, SpaSetPoint, SpaState, SpaTemp. Variables will also be updated after changes are made by script commands.

The following is a list of the commands that can be called in the Jandy Aqualink attachment script from Indigo: JandyGetStatus(), JandyTurnOnSpaHeat(), JandyTurnOffSpaHeat(), JandyTurnOnPoolHeat(), JandyTurnOffPoolHeat(), JandyTurnOnLights(), JandyTurnOffLights(), JandyNewSpaSetPoint(NewSpaSetPoint), JandyNewPoolSetPoint(NewPoolSetPoint), JandyTurnOnSpa(), JandyTurnOffSpa(), JandyTurnOnSpaAndHeat(), JandyTurnOnSpaAndHeatAndLights(), JandyTurnOffSpaAndHeatAndLights()

Developed by Jim Yergey May 2008


Cool script !

You seem to have discovered a few things that aren't covered in the Jandy programming guide, like:

ResponseString is equal to ("!00 SPAHT = 2" & return & linefeed) then -- Spa heat is on or heating.


SPAHT is not documented as ever returning 2.

Do you have an errata for the serial doc ?

Thanks !

Mike

Posted on
Mon Nov 10, 2008 7:47 pm
yergeyj offline
Posts: 260
Joined: Dec 29, 2004

(No subject)

Sorry Mike, I've been offline for while.

Not sure what you mean by an "errata for the serial doc?"

The possible error codes returned are listed in the Jandy RS Serial manual (pg. 38).

If your question is "How did you figure out the SPAHT = 2?" I have to plead "trial and error." I put every command in manually (using Script Editor and Serial Bridge) and looked at the responses, and happened to notice that when the Spa (or Pool) were heating the returned value was different from when it was on but not heating.

Hope that helps. If not let me know. Unfortunately, I won't be able to do any live testing until next spring, as my system is now off here in PA.

Hoping you're enjoying your Jandy system in a warm location,
Jim

Posted on
Mon Nov 10, 2008 7:50 pm
yergeyj offline
Posts: 260
Joined: Dec 29, 2004

Re: Jandy Aqualink Pool / Spa Control

asw24b wrote:
yergeyj wrote:
All,

SPAHT is not documented as ever returning 2.

Do you have an errata for the serial doc ?

Thanks !

Mike


Rereading you post, I realized what you probably wanted was a listing of all of the differences I uncovered, like SPAHT=2, in one place. Sorry, I didn't compile that specifically, just in the comments in the code itself.

If you think it would be really valuable, i can try to do so next spring, when I can use my system again.

Jim

Posted on
Thu Aug 27, 2009 2:16 pm
hamw offline
Posts: 1212
Joined: Mar 31, 2008

(No subject)

Resurrecting this thread for a couple of questions.

--How much is the Jandy serial interface and where does it go?

--My pool is 100 ft from the house. Do I have to run a cable from the computer to the Jandy box to access the interface?

--How do the scripts integrate with Indigo Touch; eg does one need to create a control page or can they appear as devices or something? Do you all have any control pages you could post?

--Has it been pretty reliable?

Thanks!

Posted on
Fri Aug 28, 2009 8:23 am
yergeyj offline
Posts: 260
Joined: Dec 29, 2004

(No subject)

The Jandy Aqualink Generic Serial Adaptor was ~$550 in 2007 when I purchased it.

You should not need to run a "separate" wire from you Jandy system to the house, BUT you should already have one going to a Jandy controller in your house, e.g. the One Touch. You will need to run a serial wire to that controller.

Do you by chance have the Jandy PDA system, which does not have an in-house mounted controller? If so, you'll need to add other components to the Jandy Power Center; I'd have to do some checking to remember what those additional components are.

The interface with Indigo is through a serial-USB converter, and uses Serial Bridge to communicate with the Jandy Serial Adaptor. Scripts interface with the iPhone Touch using a Control Page. If you think it will be useful, I'll work on getting a post of my Indigo Touch Control panel screen.

I've found the interface with the Jandy system is as reliable as all my other Indigo / INSTEON system components, which is very good.

Jim

Posted on
Fri Aug 28, 2009 11:50 am
hamw offline
Posts: 1212
Joined: Mar 31, 2008

(No subject)

Yes, I have the PDA system. I'd love to see your control pages if it is not too bothersome to put them up.

It would be helpful to control the unit from the iPhone--or even my Crestron-- just trying to see how much effort/cost is involved.

Posted on
Fri Aug 28, 2009 2:02 pm
yergeyj offline
Posts: 260
Joined: Dec 29, 2004

(No subject)

D'oh, I didn't realize you can't post actual images to this BB, but only links to images in a public area; unfortunately, I don't have a readily available public web page to store and post my Control Page image for controlling the Jandy system. That said, I don't think you'll be able to use it without some significant work on the pool automation system anyway (see below).

As I indicated, if you have the Jandy PDA system, and not one of the versions that have an in-house controller, you would have to add a board to the Jandy Power Center, and run a wire into the house for the serial adaptor.

IMHO, the Jandy PDA system is a bit of a con for anyone who wants to play with their automation, as it does not provide any mechanism to control the system except through the handheld PDA. For only a few hundred $ more, you can get the wired system, a handheld PDA with more functionality, and have ready access to add a serial adaptor.

Unless you are willing to get the upgrade board, wire the system to the house, and get the serial adaptor, I'm afraid you're out of luck with regard to Indigo control. :(

Jim

Posted on
Fri Aug 28, 2009 2:12 pm
hamw offline
Posts: 1212
Joined: Mar 31, 2008

(No subject)

well, too bad. to be frank, however, my wife repeatedly tells me that I'm the only one who knows how to use any of that stuff anyway, so perhaps I should save my money and be happy....

BTW if you just wanted to email me the images, my address is hamw at comcast dot net

Posted on
Mon Sep 13, 2010 4:15 pm
n8huntsman offline
Posts: 3
Joined: Sep 13, 2010

Re: Jandy Aqualink Pool / Spa Control

Do you think the Jandy serial adapter, http://www.jandy-downloads.com/pdfs/Aqu ... manual.pdf, and the PC interface, http://www.jandy.com/pdfs/7271revE.pdf, are pretty much the same thing except one has usb support? Would this be any different that a generic RS-485 to RS-232 devices such as this; http://www.sourcingmap.com/female-db9-p ... 78888.html ? I don't wanna spend $400 on a $7 part.

Posted on
Mon Sep 13, 2010 5:08 pm
seanadams offline
Posts: 489
Joined: Mar 19, 2008
Location: Saratoga, CA

Re: Jandy Aqualink Pool / Spa Control

I'm guessing it's similar to the Pentair controls which also use an RS485 bus. The RS485 is probably an undocumented, low-level protocol. In that case the RS232 adaptor then is not just an electrical interface (which is indeed trivial) but rather a protocol adaptor device with a microcontroller in there, which presents an ASCII command interface that translates back and forth between the low-level bus commands.

Of course this is all very stupid since if they'd just expose the RS485 protocol you could make software that talks to that with hardly any more effort. But then they couldn't sell a $400 adaptor, could they?

Posted on
Wed Sep 15, 2010 9:30 am
n8huntsman offline
Posts: 3
Joined: Sep 13, 2010

Re: Jandy Aqualink Pool / Spa Control

I spoke with a Jandy tech services guy who told me that the two devices, serial adapter and PC interface use the same commands. The PC interface does not appear to have anywhere to hide a processor so I'm hoping its just a simple RS-485 to RS-232. Gonna buy the cheap one and see what I can do with it. I'll update you guys when I get some good info.

Posted on
Wed Sep 15, 2010 10:35 am
seanadams offline
Posts: 489
Joined: Mar 19, 2008
Location: Saratoga, CA

Re: Jandy Aqualink Pool / Spa Control

If you can get a hold of the documentation before buying, you can probably tell by looking at the protocol whether it is the native format for the rS485 bus or if it is being translated.

Protocols for a multi-drop bus usually include device addresses/IDs, checksums, and special timing constraints (eg send this command to poll, then wait x milliseconds for responses). They are also likely to use packed binary structures instead of ASCII commands.

OTOH, protocols for a point-to-point serial interface designed for 3rd party interfacing are usually abstracted a little higher in one or more of those aspects.

I have encountered both... it's not terribly hard talking to a multi-drop bus by the time you've done all the higher level stuff that you're going to need in either case.

Who is online

Users browsing this forum: No registered users and 6 guests