Aqualink PDA automation using RS485

I've not thought much about it, but all you need to do is send the series of HTTP CGI requests for the keypresses/screengrabs you mention. Python makes that part trivial.

My biggest worry would be how to synchronize things. I'd suggest that before committing to any keypress you grab the screen and verify the menu text (say, lower 5 lines or whatever) and the selected region matches what you want. Don't want to dead-head your main pump because it was 1/2 second too fast on the button presses. What happens if you're in Service Mode, for example? Or it's flashing the "SPA will start after warmup period" or whatever text...

The grab complete screen CGI is already there (the javascript webpage uses it), but maybe a "get selected text" and a "get line X" CGI would be helpful? Both could be done in your client relatively easily, otherwise.

And if we reset the interface and started from scratch (say I add a cgi keypress:power event ) that would ensure you're not in some funky mode to begin with...to some degree, but doesn't help Service Mode or Timeout...

Other fly in the ointment is "does the controller recognize keystrokes while sending the screen refresh?" If yes, you can do this mighty fast and almost blind. If no, then you've got to keypress, wait for screen to redraw, send next key, ...
 
I was updating/editing my post as you were replying so I had added a bit more commentary somewhat related to what you're saying. Great timing for an Internet outage...

Makes sense to compare the screen to where I think I am before hitting select. If the PDA is showing stats, all the buttons do is is tell the controller to go to the next page. Eventually you're back to whatever menu you were on. So yes there'd need to be some logic to be sure you're on a menu page and not status, timeout, or service mode. I think waiting for a screen re-draw with the main menu would be good. Or a few extra back buttons for good measure. Adds more lag to the whole process, but if it takes 10 secs to turn the pool on, I'm okay with the lag if it's in the background and not visible to me. ;)
 
Just saw your edits. Set those values you're grabbing into a dict[] (ie. "poolstat['pumprpm'] = xxxx, poolstat['watertemp'] =yyyy; ...), then return it as a JSON in web server portion to a new CGI request. JavaScript eats up JSON, so the parsing in the web page from there will be pretty simple. You'd fire an AJAX request for the new URL, then on receiving it you an update the HTML document accordingly.
 
Some photos of my rigged up rpi/wifi dongle/power. The rpi is shoved in the Jandy power center on the left side. The dongle is taped to the brick using a USB extension cable to get it out of the power center. The power is running to the outlet below. This is all temporary until I can run a serial cable (probably a CAT6 cable) from my office closet and move the rpi inside the house!

View attachment 66532
View attachment 66533
 
Hi guys, GREAT work! I have just set up my Pi zero w and connected it up to my old Jandy board (I replaced it with the new iAqualink one and a salt system, so I'm using the old one for testing) if I use the tip of master for aquaweb with the -a option I get the buttons, but no text in the middle, if I use the version I grabbed from the google drive aquawebpda.py - Google Drive it works fine, so not sure if tip is broken right now.

Anyway I'm a developer and have written an Alexa skill to allow me to ask it what my air/pool temp is, and intend to add just about anything else that you can do over the interface (I stated small) currently its returning dummy data, hence coming here and starting to play with aquaweb. I plan on adding code to push all the readable data into a database, and that is what I'll have the skill read the data from. I'd be happy to help you guys add to what you have, or if you prefer I can fork my own copy.

First question is how do you go about decoding the msg's from the system? I'd like to add the salt cell info it gives me the % setting that the cell is set to, and the salt ppm that the sensor is reading. I also want to pull the RMP and watts from the intelliflow data that it shows too



Thanks

Joby
 
Anyway I'm a developer and have written an Alexa skill to allow me to ask it what my air/pool temp is
This sounds like exactly what I've been doing! I have other temperature sensors about my house that I've already written a skill for, along with a weather station that supplies wind & humidity, so I've been trying to bring in the pool temperature along with it's air temp since the location of that sensor has different information than my weather station. I'd certainly be interested to see how you did it.

Aaron
 
I took the code from a few different threads in this forum, then I re wrote it to monitor the Aqualink messages, and as it sees them, post to an AWS database with a time stamp, then when the skill asks a question it looks in the database for the latest data and responds. This also gives me the data over time so that I can create some graphs and such from it.

The control side of things I have not done yet, the plan is to use AWS SQS, when you ask to turn on the pump or something, a message gets posted to a queue, there is a daemon on the Pi that listens to the queue and will action the request, however I'm not sure of the Aqualink protocol yet, I have not looked at it in detail, if an Ack or something is sent back to confirm the cmd was done then I would probably want a bi directional API for the cmds so SQS would be a bad choice.
 
Hi guys, GREAT work! I have just set up my Pi zero w and connected it up to my old Jandy board (I replaced it with the new iAqualink one and a salt system, so I'm using the old one for testing) if I use the tip of master for aquaweb with the -a option I get the buttons, but no text in the middle, if I use the version I grabbed from the google drive aquawebpda.py - Google Drive it works fine, so not sure if tip is broken right now.

Hi Joby,

If you have the PDA style, you need to use "-p", not "-a". "-a" is the old square-style @ ID=40, "-p" is the new PDA @ ID=60.

There are no messages on your RS485 bus for ID=40, so no screen with -a.

Would you be able to try the GITHUB version head with -p, and if it doesn't work then please open an Issue?

Thx
-EFP3
 
Actually, when you get back just pull the latest version from GitHub and run with *no* options. I've added an auto-detect which probes the bus and identifies which controllers the main box can communicate with and runs them automatically. Ctrl-C to exit the app also now works as a bonus.
 

Enjoying this content?

Support TFP with a donation.

Give Support
Making good progress on PDA automation. It doesn't look like much yet but there's a lot of work done under the hood with working macros (one click (or http post) buttons that perform various functions). I would imagine this will work with the various other remotes/iAqualink as well. Unfortunately, I've been using a forked version (with a fair amount of code removed) from efp3's. Eventually will need to merge it back in. If you have a PDA and want the code, send me a note. It's ever changing but getting there...

jt
 
Here's a screenshot of the PDA remote. I've got dynamic sizing via css now so the table and buttons will auto size and resize according to the browser window. It looks great on iphone, android, and various web browsers in mac and windows. My code is still a major fork off of efp3's so I'll work to integrate it into his then put it on github. Again, if anyone wants it as it, happy to send.


Screen Shot 2017-08-16 at 12.14.54 PM.jpg
 
Hi Joby -

The control side of things I have not done yet, the plan is to use AWS SQS, when you ask to turn on the pump or something, a message gets posted to a queue, there is a daemon on the Pi that listens to the queue and will action the request, however I'm not sure of the Aqualink protocol yet, I have not looked at it in detail, if an Ack or something is sent back to confirm the cmd was done then I would probably want a bi directional API for the cmds so SQS would be a bad choice.

The Aqualink PDA (not sure about the others) does not send a confirmation of a command other than displaying a line or two on the screen. All the communication is up/down/select and screen drawing. It's mostly one way communication (controller to PDA) with button pushes going PDA->controller. For this reason it's pretty crappy. In other words it's not super easy to confirm a command worked. I'm assuming the iAqualink is similar but I haven't worked directly with it yet. I have edit the aquaweb code to run preprogrammed macros, that is, series of things to do. Basically it automatically moves up and down the menu to select items and will nest as many levels deep as needed. It's very difficult to confirm that the button presses worked, but they do work most of the time and it's pretty cool to watch in action. ;)

jt
 
Great work guys! I've been super busy with work, so not had any time to update to your new code, or experiment after you're advice I'll try and get back to it in the next week or so!
 
Hi All,

I know this is a bit of an older post but it's a great project!
Is anyone willing to write a detailed (step-by-step) guide for less advanced Raspberry/Linux users?
Earle was actually a great help when I contacted him through email.

I followed Earle's/this post's steps and when I run "sudo python /root/aquaweb/aquaweb.py" it gets stuck on the following screen:
"Creating screen emulator...Creating spa emulator...
Creating RS485 port..."

I changed "RS485Device = "/dev/RS485" to "RS485Device = "/dev/ttyUSB0" in "/root/aquaweb/aquaweb.py" in line 19.
Before changing RS485 to ttyUSB0 it would give me following error:
"Creating screen emulator...
Creating spa emulator...
Creating RS485 port...
Traceback (most recent call last):
File "/root/aquaweb/aquaweb.py", line 762, in <module>
main()
File "/root/aquaweb/aquaweb.py", line 746, in main
i = Interface("RS485")
File "/root/aquaweb/aquaweb.py", line 619, in __init__
self.msg += self.port.read(1)
AttributeError: 'NoneType' object has no attribute 'read'"



Any help would be much appreciated.
 
I'm traveling right now, but maybe I can help.

First of all, can you reclone my repository? I added some auto detect of Jandy control types a while back which can help debug your problem. I don't think johnnytaco merged his fork with this change yet.

The easiest thing is that you have a PDA style controller, which before required a command line switch but now will "just work" since the script will snoop the bus and see what addresses are being probed. The old script would default to my older square PDA which is a different address than the newer one... But essentially the same protocol and device internally.

If the auto detect doesn't see any valid traffic on the USb adaptor, that could mean you've got a wiring problem into the control head.

There is not supposed to be any additional output to the screen once it starts up, so you'll need to connect to the website it serves to validate.
 
Hi Earle,

Sorry for my late response, I was traveling too.
I recloned your repository but the output is the same :(
I have not connected Pi to Jandy yet, since I wanted to test it "offline" first. My problem seems to be that either adapter is not recognized correctly or the websrever is not starting up. Not sure, might be something else since I am new to linux.
Do you recommend me connecting Pi to Jandy and then trying running python script again?
As soon as run the script, it stops at: "Creating RS485 port..."

Thanks!
 
There's the problem...

...
I have not connected Pi to Jandy yet, since I wanted to test it "offline" first. My problem seems to be that either adapter is not recognized correctly or the websrever is not starting up. Not sure, might be something else since I am new to linux.
Do you recommend me connecting Pi to Jandy and then trying running python script again?
As soon as run the script, it stops at: "Creating RS485 port..."
...

If there is no RS485 connection to the control unit, then the script won't have anything to do, and you won't see anything on the web interface. I should probably put an error message when this occurs, but I frankly never thought about running w/o a connection.

There is *no* intelligence in the Jandy remotes that it emulates, all the brains live inside your control head. The remote, be it this or the wireless one, is just a dumb TTY for it. No connection, no display at all.

I'd hook it up and watch the startup to see what the new one detects...
 

Enjoying this content?

Support TFP with a donation.

Give Support
Thread Status
Hello , This thread has been inactive for over 60 days. New postings here are unlikely to be seen or responded to by other members. For better visibility, consider Starting A New Thread.