Hayward AquaLogic / ProLogic automation

Now that it spring here in the GWN, I’ve finally got Home Assistant talking to my Hayward AquaLogic pool controller:

image

The AquaLogic interface code is here: https://github.com/swilson/aqualogic, and the Home Assistant code is here: https://github.com/swilson/home-assistant/tree/aqualogic.

Still has some rough edges (e.g. multi-speed pumps aren’t handled, no documentation), but if you have one of these controllers feel free to try it out.

5 Likes

swilson, thanks for starting to create Hayward automation for Home Assistant.

I have a Hayward AquaPlus which I think is an AquaLogic / ProLogic that includes the salt sanitation system. I want to add my pool control to Home Assistant, but it currently has no network interface. Do you happen to know what module is required? I found the 900 MHz antenna module on Hayward’s website (AQL2-BASE-RF) but it is not clear if I can connect it to any Z-wave hub, or if it requires the AquaConnect module also (AQ-CO-HOMENET).

Thanks

I believe the AquaPlus is an updated ProLogic, which uses an RS-485 interface. The 900 MHz module only talks to the Hayward remotes. To hook it up to Home Assistant you need an RS-485 interface adapter. I’m using an RS-485 to Ethernet converter; you can also get RS-485 to WiFi if your Hayward box isn’t close to your house.

Thanks. I looked through the git hub and have a few questions. I am currently running HA on Qnap through a docker container. Do you know if custom code can be added when running in docker, or do I need to wait for HA to pull your code into mainstream? Second, any luck with variable speed pumps? My AquaLogic allows me to have 4 preset pump speeds, it would be nice to be able to support that in HA. Third, is it (or will it be) possible to set the color of a RGB LED light?

I have a feeling the answer to question 2 and 3 involve capturing and reverse engineering the data sent over the RS-485 bus. What I saw of the hex code that has been reverse engineered, that seems like it will be difficult and time consuming. I suspect it is too much to hope for Hayward to release documentation…

I have a Hayward VSP waiting to be hooked up. I’ve done a bit of playing around, and the VSP interface on my AquaLogic only supports 2 speeds, and the only way know what speed you’re on is to check if the Filter LED is flashing :frowning:. So not sure how it behaves on an AquaPlus.

For the LEDs you’d have to reverse-engineer the protocol; I just have regular bulbs. Don’t know anything about Docker, sorry.

This is great! Is there any reason you haven’t opened a pull request to contribute the changes back into mainline Home Assistant?

Just haven’t had time to clean it up and add documentation.

Hi guys,

Just bought a pool but it came with Aqua Trol. Do you guys know if I can attach it to some kind of network in order to see the sensors on HA?

Thanks

From photos on-line it looks like the Aqua Trol board has an RS-485 interface. The protocol may or may not be similar to the one used on the Aqualogic/Prologic.

Where did you see that? Just got my pool installed.

Thanks

Got my TriStar VS pump installed and updated the code to support it. Hopefully I’ll get to the documentation soon so the code can be integrated into HA.

2 Likes

Thanks very much for your development work here. I was thrilled to see this project.

I set up a NodeMCU development board.

with an RS-485 to UART
https://www.amazon.com/gp/product/B010723BCE/ref=oh_aui_detailpage_o01_s00?.
ie=UTF8&psc=1

I flashed a serial bridge program called ESPLINK
https://github.com/jeelabs/esp-link

The monitoring end seems to be working well. When I change states on the Hayward remote, I see the change in HA immediately.

Are you able to control devices? I’m not able to turn anything on or off in HA. Not sure where to start to troubleshoot that part. Would welcome any suggestions.

Kind Regards and Thanks again for a great addition to Home Assistant

Robert

Yes, I can control the devices. First thing to check would be to verify the TX data is coming out of your UART (and subsequently the RS-485 bridge).

Also see https://github.com/swilson/aqualogic/wiki/RS‐485-Notes; the TX code works ok on my setup but if you have too much latency in the system the TX messages might constantly collide with the keep-alive messages being sent by the AquaLogic.

Note that if the aqualogic library doesn’t see the state change it retries sending the request; you’ll see a bunch of

                _LOGGER.info('Sent: %s', binascii.hexlify(data['frame']))

messages in your log. Hope this helps.

1 Like

That is helpful. Thanks very much.

Robert

I’m getting a lot of stuff in the logs. Is this consistent with yours? It looks to be the display updates. The sent messages you mentioned are going out. I can see the TX led flicker each time it sends. Still no joy on controlling switches via HA. I did fire out some commands using a a terminal, and was able to engage a switch on occasion, so I’m inclined to think my set up is working. When I change things with the remote HA picks up the change very quickly.

If you have other suggestions for further troubleshooting, I would be grateful for that. Wondering if the WLAN is introducing latency, but not sure how to rule that out. My RS-485 to UART is now on a Raspberry Pi Zero, and I’m using ser2net for the serial to TCP link. You have some python programs on your Git page. I’m not sure how to set up and/or run them on the PI outside of HA. That seemed like another thing worth trying. Where exactly is the window or data/string/command to send the commands out?

Kind Regards,
Robert

Pasted portion of log follows.

b’830002280000000000000003202020202053616c74204c6576656c2020202020202020202020323930302050504d20202020202000’
2018-12-02 21:55:57 INFO (Thread-2) [aqualogic.core] Unknown frame: b’040a’ b’8c000f3516076769008225’
2018-12-02 21:55:58 INFO (Thread-2) [aqualogic.core] Unknown frame: b’040a’ b’8c000f3516076769008225’
2018-12-02 21:55:59 INFO (Thread-2) [aqualogic.core] Unknown frame: b’040a’ b’830002280000000000000003202020202020486561746572312020202020202020202020204d616e75616c204f6666202020202000’
2018-12-02 21:55:59 INFO (Thread-2) [aqualogic.core] Unknown frame: b’040a’ b’8c000f3516076769008225’
2018-12-02 21:56:00 INFO (Thread-2) [aqualogic.core] Unknown frame: b’040a’ b’8c000f3516076769008225’
2018-12-02 21:56:01 INFO (Thread-2) [aqualogic.core] Unknown frame: b’040a’ b’830002280000000000000003202020202020486561746572312020202020202020202020204d616e75616c204f6666202020202000’
2018-12-02 21:56:01 INFO (Thread-2) [aqualogic.core] Unknown frame: b’040a’ b’8c000f3516076769008225’
2018-12-02 21:56:01 INFO (Thread-2) [aqualogic.core] Unknown frame: b’008c’ b’01000000000000000000’
2018-12-02 21:56:01 INFO (Thread-2) [aqualogic.core] Unknown frame: b’040a’ b’8c0010002c3504093c000000000000000000000000000042’
2018-12-02 21:56:02 INFO (Thread-2) [aqualogic.core] Unknown frame: b’040a’ b’8c000f3516076769008225’
2018-12-02 21:56:03 INFO (Thread-2) [aqualogic.core] Unknown frame: b’040a’ b’8300022800000000000000032020202020202053756e64617920202020202020202020202020203130ba3533502020202020202000’
2018-12-02 21:56:03 INFO (Thread-2) [aqualogic.core] Unknown frame: b’040a’ b’8c000f3516076769008225’
2018-12-02 21:56:04 INFO (Thread-2) [aqualogic.core] Unknown frame: b’040a’ b’8c000f3516076769008225’
2018-12-02 21:56:05 INFO (Thread-2) [aqualogic.core] Unknown frame: b’040a’ b’8300022800000000000000032020202020202053756e64617920202020202020202020202020203130ba3533502020202020202000’
2018-12-02 21:56:05 INFO (Thread-2) [aqualogic.core] Unknown frame: b’040a’ b’8c000f3516076769008225’
2018-12-02 21:56:06 INFO (Thread-2) [aqualogic.core] Unknown frame: b’040a’ b’8c000f3516076769008225’
2018-12-02 21:56:07 INFO (Thread-2) [aqualogic.core] Unknown frame: b’040a’ b’8300022800000000000000032020506f6f6c2054656d70202036355f46202020202020202020202020202020202020202020202000’
2018-12-02 21:56:07 INFO (Thread-2) [aqualogic.core] Unknown frame: b’040a’ b’8c000f3516076769008225’
2018-12-02 21:56:08 INFO (Thread-2) [aqualogic.core] Unknown frame: b’040a’ b’8c000f3516076769008225’
2018-12-02 21:56:09 INFO (Thread-2) [aqualogic.core] Unknown frame: b’040a’ b’8300022800000000000000032020506f6f6c2054656d70202036355f46202020202020202020202020202020202020202020202000’
2018-12-02 21:56:09 INFO (Thread-2) [aqualogic.core] Unknown frame: b’040a’ b’8c000f3516076769008225’

The ‘040a’ packets appear to be display updates for a larger display (I only have the 2x16 character displays, so I don’t see these messages on my system). Don’t know about the ‘008c’ packets; my AquaLogic is really old so it is probably a newer message.

There is a command line tool in the aqualogic git repository that you can use to test. Clone the repository to your Pi, and then run ‘python3 aqualogic/cli.py localhost [port]’ where [port] is the port number of your ser2net instance. You can then send commands to toggle any of the States by typing in the state name, e.g. LIGHTS. If the state change was successful you should see it reflected in the States printout.

Hello All:
I’m stuck trying to get HA to talk back to my aqualogic controller. I have a new install of hassbian and added the aqualogic component. (This has been my dream for many years now, so I was so excited to see this finally come to fruition) For the RS485 link, I choose a USR-W610 wifi converter (amazon USR-WIFI232-610-Serial-802-11-Ethernet-Converter) as it’d be nearly impossible to run a wire between my controller and my pi. I have this working, talking to my network and communicating with HA. I can see the changes in HA immediately when I press a button on my aqualogic. I can also see the TXD light flash when I change the mode on a switch in HA. But it won’t change the aqualogic. I get a bad CRC message in my log, but that’s about it.

019-01-05 22:09:10 WARNING (Thread-16) [aqualogic.core] Bad CRC
2019-01-05 22:09:29 WARNING (Thread-16) [aqualogic.core] Bad CRC

I have literally gone thru the W610 settings and changed each one, rebooted the w610 and rebooted HA without success.

Any idea where to begin looking?

My w610 settings are below. I’m using it in ‘STAtion’ mode not ‘Access Point’ mode.

USR-W610

WI-FI Settings
Mode: STA Mode

Mode Selection: Working Mode Selection
STA Mode (station)
Data Transfer Mode: Transparent Mode

AP Interface Setting (not Used)
Wireless Network
Network Mode: 11b/g mixed mode
Network Name: blank
BSSID: [default]
Frequency: Autoselect
USR-WIFI232-AP
Security mode: disable
Lan Setup
IP Address (Default DHCP Gateway: blank
Subnet Mask: blank
DHCP: disable

STA Interface Settings
STA Interface Parameters
AP’s SSID: [my wifi name]
Security mode: [my wifi mode]
AP+STA: off
WAN Connection Type: DHCP (auto config)
Hostname: USR-W610_xxxx

Application Setting
Uart setting
Baudrate: 19200
Data bits: 8
Parity: none
Stop: 2
Flow control: Disable
485 mode: Enable
Baudrate adaptive: Disable
Uart AutoFrame: Disable
Registered Package setting: off
Custom heartbeat packet setting: off
Socket Distribution setting: off
Modbus Polling: off
httpdclient Mode setting: long
Network A Setting
Mode: Server
Protocol: TCP
Port: 8899
Server Address: 192.168.1.78
Max TCP: 24
TCP Timeout: 0
TCP connection password authentication: disable
Socket B Setting
Open Socket B function: off
Protocol: TCP
Port: 18899
Server Address: 10.10.100.100
TCP: Timeout: 0
Ethernet Port settings
Ethernet Setting
Open the ethernet: disable
Set Ethernet work mode: LAN port
Ethernet mode: n

One other thing before I forget, my Aux 3 (Valve 3-Solar) and Aux 4 (Value 4-Waterfall) don’t work. I think this is a mapping issue with my aqualogic, but if anyone has solved this, I’d be very grateful!
Thanks - Rob

Your settings look ok to me. I notice the USR-W610 doesn’t have a ground connector for RS-485; the signals are differential but I still wonder if that might be the issue? My USR-TCP232-304 has a reference ground and I’ve got it hooked up. You could try attaching the ground from the AquaLogic to the RS-232 ground in the D-Sub connector and see if that makes a difference.

I added a ground wire but that didn’t help. I believe it’s a latency issue in using WiFi. Using the USR-TCP232-Test RS232 to Ethernet converter tester http://www.usriot.com/support/downloads/usr-tcp-test-testing-software.html, I sent the lights on/off code repeatedly every 900ms or so, and got the lights to turn on/off every few seconds. It seemed to collide about 9 out of 10 times. Following this, I clicked the lights on/off switch in HA repeatedly. I was able to toggle the lights about every 20-30 clicks, so this is telling me that it’s probably a latency issue with the RS485 WiFi converter. I ordered the non-WiFi version (USR-TCP232-304) and if that works, I’ll have to scramble into the attic and do some wire pulling.

I also tried disconnecting my existing aqualogic wireless remote, but that seemed to have no effect. (Just trying to document everything for next person)

Thanks for the assistance. One last thing: Any plans on turning on the rest of the aqualogic features (e.g. mode switch, valves, super chlorinate, etc)? I see that you decoded most of these in your interface, they just aren’t part of the aqualogic component.

1 Like

Unfortunately I only have the basic Aqualogic control, which doesn’t have buttons for any of the other features. So I have no way to reverse engineer what key events to send to toggle them (assuming they can be toggled by a keypress).