Hayward AquaConnect Device Handler

project_pool
dth_pool

(Steve Tremblay) #1

Hi everyone,

I’m sharing here my WIP Aqua Connect device handler for Hayward Pool Automation. It’s working well, but features are a bit limited by the architecture of the Aqua Connect bridge.

Still you can view current status of the pool lights, heater, filter and aux relays + control the lights, mode and filter easily. Sadly, the mode/lights will not show current status after a change right away, but it will at next refresh, this is also due to the AquaConnect architecture.

You can also view current Pool/Spa temp (for spillover spas).

Code will need to be adapted a bit for led statuses based on your configuration. I also recommend using Pollster to refresh the device.

Anyway, I’m posting to see if there is anyone looking for this, then I can give more info if you want to try it !

Here is the handler :

https://github.com/SteveTheGeekHA/AquaConnectDeviceHandler/blob/master/AquaConnectDH.groovy

As usual with IP based devices you need to configure the device with the HEX encoded IP/Port, there is a lot of doc on this in this forum.

Steve


#2

Hi Steve…

Im looking to add the AquaConnect to my SmartThings as well. Just getting into the community, so still fumbling with setting up my account. Will be looking to you for further support once I get through the developer setup and documentation. I have found the Hayward API for serial communication, but not the Home Network interface API. Assume they should be close, so will go through your work and see where to begin. Thanks for the start…

R.D.


(Steve Tremblay) #3

With pleasure !

Sadly it’s not really an API, but I kinda watched how the device replied to the web browser and leveraged it :wink:


(Jamie Sanbower) #4

Steve,

Does the code need to be modified to put in IP/Port of the AquaConnect?


(Glenn Beck) #5

Hi Steve, I’m new to ST and was trying to get my Aquaconnect integrated via your code. I pulled the code from GitHub but when I added the device it doesn’t show anything. I wasn’tb sure what type of device to choose when I created it, and I don’t see where to add the converted IP? It’s not clear to me as to how ST can talk to the controller…
Thanks,
Glenn


(Steve Tremblay) #6

Hi Glenn,

You added my device handler and added the device from the Graph API console ? Did you set the ID as the encoded IP/PORT of the device ?

Steve


(Glenn Beck) #7

Thanks Steve, that’s what I needed. I had to set the device network ID as 50 so that it would be seen as 80? (0A000170:50)

Once I did that then it works. This app is awesome!

2 more questions:
The temperatures are not showing in ST, is there something that I need to modify in the code?

You mention pollster, but it’s there a native function in ST now that can be added to refresh?

Thanks again,
Glenn


(Steve Tremblay) #8

Hi Glenn,

The native refresh is kinda bad, sometimes it refreshes, sometimes it doesn’t. That’s why I use pollster.

And the temperature is linked. The way AquaConnect works is that it shows the line currently shown on your P4 display in the webapp and that’s what I read to get the data. So each minute or 2 minutes with Pollster I take what’s there and if it’s Spa or Pool temperature, I update the value. It’s not that great, but it’s the only way as there is no access to the raw data…

Steve


(Glenn Beck) #9

That makes sense. Kind of highlights what a poor job Hayward did on their design. It’s a shame they don’t redesign and push everything to the cloud and expose the API’s so we can leverage them. They had a good idea but fell short on the follow through, or maybe it’s just not a big enough market for them to focus on so it was a learning experience for their newer products.
I haven’t figured out for to use pollster yet but I’ll take a look at it and see if I can get it going. I just got my ST hub and have been enjoying seeing all the possibilities, this could get expensive. :slight_smile:
My ToDo list will probably keep me busy for a while:TappecuepHinCyberstatGarageDoorBuddyXFinity sensors - I suspect those are locked down since it’s part of home security… I moved all of my plugs to ST but would love to get at the door sensors and smoke detectors that have to stay on the XFinity zigbee network.

SteveTheGeek Steve Tremblay
January 2 |

Hi Glenn,

The native refresh is kinda bad, sometimes it refreshes, sometimes it doesn’t. That’s why I use pollster.

And the temperature is linked. The way AquaConnect works is that it shows the line currently shown on your P4 display in the webapp and that’s what I read to get the data. So each minute or 2 minutes with Pollster I take what’s there and if it’s Spa or Pool temperature, I update the value. It’s not that great, but it’s the only way as there is no access to the raw data…

Steve

Visit Topic or reply to this email to respond.

In Reply To

glenn-beck
January 2 |

Thanks Steve, that’s what I needed. I had to set the device network ID as 50 so that it would be seen as 80? (0A000170:50) Once I did that then it works. This app is awesome! 2 more questions: The temperatures are not showing in ST, is there something that I need to modify in the code? You menti…
Visit Topic or reply to this email to respond.

To unsubscribe from these emails, click here.


(Steve Tremblay) #10

Agreed, it’s a TERRIBLE design from Hayward. Not having a simple API to get the data easily is ridiculous…

Pollster is pretty easy, you install it and tell it which device to update and how often.


(Daren) #11

This is great. I didn’t think anything like this existed. I am afraid I am really new at this. Just installed my smart things hub today and still figuring out how all this works. Is there a step by step guide how to get this installed? I would appreciate any help.


(Steve Tremblay) #12

Hi sir ! I did not create a step by step guide, but I can surely help.

You have the AquaConnect on your home network, same as the Smartthings hub?

If so, do you know the IP address of the AquaConnect?


(Daren) #13

Sorry it took so long to respond. Got buried at work. Yes, the SmartThings hub is connected and I have already tested it with a light switch I just installed and my garage door. Having fun with it.

I can find out the IP address of my AquaConnect via my router. So yes.


(Steve Tremblay) #14

Great, so you need to configure the device with the HEX encoded IP/Port, there is a lot of doc on this in this forum. But basically, you encode in hexadecimal each part of the IP + the port also.

This becomes the device ID in Smart things. Then the device handler should communicate well with the device.


(Daren) #15

When you say configure the device you mean the Smarthings hub or the AquaConnect hub? I am assuming if I search HEX I should find what I need?


(Steve Tremblay) #16

You need to manually add your AquaConnect device with my device handler in the web Graph API console.

The device id needs to be:

HEX_IP:HEX_PORT with each number of the IP converted to 2 characters HEX

So for instance, my AquaConnect device id is:

C0A85631:0050

Which equals to :

C0 = 192
A8 = 168
56 = 86
31 = 49

So my hub IP is 192.168.86.49

And the port is 0050 in HEX which is 80. This is the normal port to talk to the AquaConnect, so it should be the same for you.


(Daren) #17

Oh OK that makes sense. Let me look at your code and take a stab at entering it.


(Scott Felder) #18

Hi Steve, this is awesome and very helpful! In researching on the web if Hayward provided any type of API for interacting with the AquaConnect, I came across this post for interacting directly with the AquaConnect Bridge device.

I wanted to put out here some additional information that I was able to gather while reversing the AquaConnect website. In addition to controlling the device directly, I discovered that there is an XML SOAP web service available externally that is being used by the external website ‘aquaconnectweb.com’. Not sure if anyone has documented this or not, a quick google search didn’t show any hits.

At this url, https://www.aquaconnectweb.com/AqConSrv.asmx, there is a SOAP web service available to interact with the AquaConnect bridge over the internet. I found that only a couple of them are really worth while using but does provide some basic functionality over the web. The main three I’ve been testing with are:

  • ButtonPress

  • GetUnitButtonState

  • GetUnit

In order to interact with these calls you’ll need some basic information

UnitID

Account

Mac Address

UnitID can be found in the URL query string parameter once logged in the Aqua Connect Web

Account is a little more trick. Once logged in, navigate to the “Remote Control” tab. Right click on the page and View Source. In the html source search for ‘OnClickTerminalButtonPress’. This javascript function will have the form of ’

OnClickTerminalButtonPress(unit, commandRuleID, buttonNumber, account, accessLevel, buttonText)’ In there the 4th parameter is the account.

Mac Address can be found on either the device itself or on the "Pool Settings" tab on the Aqua Connect Web.

You for some of the web service calls like ButtonPress, a Command Rule ID, Button ID and Button Text is needed. These can be found on the ‘Remote Control’ tab by hovering over each of the different buttons.

ButtonPress seems to always return a value of ‘1’. I’m guessing it means successful.

GetUnitButtonState returns ‘1’ or ‘0’ if the button is on or off.

GetUnit returns an XML string with HTML embedded. This is a DIV section that contains the status panel. So if you want to get at current pool temp or which menu is selected. It’s not really the greatest for get info back since its in HTML.

Not sure if this is helpful to anyone or not but figured I’d put it out there. Remember, Steve’s code is interacting directly with the bridge on your network, this web service is going out to Haywards’ servers then back to your bridge device. So if your internet connection is down so will controlling your device via this service. Also this is a SOAP based web service so it’s XML based.

Scott


(Vincent Pelliccia) #19

Hi Scott

I’m using Wimos D1 Mini and find it easy to interface to Alexa - The question is has anyone tried to use a Wimos (Arduino) to interface on the local network to an AquaConnect Controller?

Thanks
VincentP58


(Vincent Pelliccia) #20

Ok… that was easy… I am able to communicate from my Wemos D1 Mini to the local page of the Aquaconnect controller. I’m sending HTTP POSTs and GETs to communicate.

Uncertain of some of the fields but no login is required on the local WWW

http.POST(“unitID=XXX&buttonID=01&accountID=XXXX&commandRuleID=string&accessLevel=string&buttonText=string”);

Any idea what or where commandRuleID and accesslevel and buttonText are defined?

Thanks
Vince