Hayward AquaLogic / ProLogic automation

My wireless solution is a NodeMCU (https://www.amazon.com/gp/product/B07HF44GBT/ref=ppx_yo_dt_b_asin_title_o08_s00?ie=UTF8&psc=1) that connects to my WiFi network via esp-link (https://github.com/jeelabs/esp-link) Serial to wifi bridge software. I have an RS485 to TTL adapter (https://www.amazon.com/gp/product/B082Y19KV9/ref=ppx_yo_dt_b_asin_title_o09_s01?ie=UTF8&psc=1) that connects the Node MCU to the RS485 bus on the pool. Both of these modules are soldered onto perfboard. Instead of a wall-wart power supply, I tapped into the 10V DC from the pool’s COM header through a buck converter (https://www.amazon.com/gp/product/B00VWL41TM/ref=ppx_yo_dt_b_asin_title_o03_s00?ie=UTF8&psc=1) soldered to a second perfboard. These connectors (https://www.amazon.com/gp/product/B07Q39N3T9/ref=ppx_yo_dt_b_asin_title_o09_s00?ie=UTF8&psc=1) link my interface boards via a 4 conductor cable to the pool control board. At the moment, it’s all inside the pool control box. Now that I finally have this up and running, I plan to 3D print an enclosure that will hold the stacked perfboards an mount outside the pool control box.

2 Likes

@swilson, perfect that’s what I was wondering . . . I can def. run cat5 out of my network closet to that end of my house and drop down to the panel . . . it’ll be a pain, but I’ll be doing other things in the attic at the same time.

I didn’t know that the remote panel option even existed… I’d much rather get this in HomeAssistant anyhow, but that’s nifty in case my display ever goes out in the panel box :slight_smile:

I think that on longer runs of RS485 they recommend using grounded cable to minimize noise and interference.

@ronkmd, yeah that makes sense… in my case, it will be about ~60-65 ft through the attic. So good-ole cat5 should work well I expect.

I’ve already re-wired my LED light to use Lutron Caseta switch that control via HomeAssistant has been great!

But, my goals are as follows once I’m able to get my Goldline ProLogic communicating with HomeAssistant (leveraging this awesome integration):

  1. Set up some Lutron Caseta Pico remote to control the Filter, & Aux conveniently from the Kitchen that overlooks the pool… that way my wife can turn the Fountain on/off to enjoy (but not run the pump unnecessarily as it can turn off after 30 mins if manually turned on).
  2. Control the pump (and fountains) via Alexa.
  3. Provide tracking of runtime and last filter pump turn-on/turn-off time to help keep an eye on energy.
  4. Provide a nifty run for 30 minutes button for when I add any chemicals
  5. Provide more advanced scheduling of the AUX1 timing that controls my Polaris vacuum, which currently is limited to only one schedule time per day.
  6. Help with overall energy tracking and minimum energy consumption/costs :slight_smile:

I’m sure additional valuable uses will come to mind soon!

Ok, ran some cat6 from my network closet to the pool controller today. Thankful for a cloudy/rainy day reprieve from the heat in the attic…

The RS-485 to ethernet adapter (USR-TCP232-304) will be delivered on Sunday (Prime shipping from Amazon).

I haven’t been this excited about getting an integration working since I got my Lutron Caseta Pico remotes working!

Awesome…it took some tinkering but everything is working great now!

Thanks for posting the screenshots @stoehrmark! His post from Jan. 2019 (#21 above) really helped!

I haven’t found any clear/consolidated instructions on proper setup of the USR-TCP232-304, but the critical details are in the screenshots and in the notes from @swilson in github here…

As well as the manual for the USR-TCP232-304 which is located here…

The screenshot finally helped me understand that there is a TCP Server working mode that I had not fully gleaned from the online manual, and that then related fields for TCP Client get disabled while another critical field get enabled…

It needs to be set to TCP Server mode so that clients like HomeAssistand can connect to it using TCP; which the manual documents as the robust/reliable method of maintaining a connection with minimal risk of data packet loss (vs UDP).

After selecting the server mode then the Local Port Number field is visible and enabled but defaulted to 0 (zero)!

The manual states that a port Value of 0 (zero) means that it will use a random port number, so we need to set a specific port value here where I used 4328 (the reversed characters of 8324; the default port for TCP Client Mode):

So after assigning a specific port number in the Local Port Number with TCP Server working mode and then using the USR-TCP-Test software I was able to finally connect successfully, and validate the data streaming from the Hayward Pool Controller using my Windows PC as a TCP Client to test. The software runs on windows and allows testing of connectivity to help isolate any issues with either the device configuration or with with HomeAssistant configuration.

And of course then the HomeAssistant AquaLogic integration instructions made more sense as to what port it needed configured in the configuration.yaml so that HA can successfully connect as a client:
Hass Configuration Yaml - 2020-07-05 23_46_56-Configurator - Home Assistant

Once HomeAssistant is configured and running – no errors in logs, etc. You can validate that a client has connected in the Web UI of the USR-TCP232-304 (see highlighted IP of connected client and data being transmitted):

And Voila! My HA entities appeared and were finally reporting data. The sensors and switches both immediately started working for me…

Thanks for the excellent work @swilson, I def. owe you a beer / coffee for going the extra mile and adapting the shared knowledge of the Hayward protocols into a HomeAssistant integration!

And I hope these additional details will help the next person :slight_smile:

Update:
For posterity I’ve also added this quick tutorial to a GitHub Wiki here:

3 Likes

Could you explain this a bit more, or please point me towards some relevant info? I don’t get it. Thanks!

Hi, thanks for all the work you have done. I have HA running on a virtual box and would like to use a raspberry pi with a USB RS495 adapter for connecting to my PL4. Can this be done? I assume i would need to configure ser2net on the pi, but what do i need to do on my HA vm machine? Any help would be appreciated.

I think a Raspberry Pi is probably overkill for this.I used a much smaller and cheaper esp8266 microprocessor (like a small Arduino with built-in wifi) and a cheap serial-to-RS485 board. See my setup described a few posts above.

0

im using the pi because i also have a relay board connected to control some other devices in that area… I am connected to the “remote” port on the controller and getting data (just using a py script to read the port) on the pi. where i have the issue, is reading the data in HA (remotely) using the Aqualogic code. What do i need on the HA server and how should i configure my config.yaml?

Well, this has been very reliable since setting it up! I’m already getting value out of history_stats sensors set up to show me the pump runtime for the past day, and the past week! Really helps to keep track for electricity savings purposes.

@swilson, fyi I have noticed some interesting behavior when my controller is in service mode whereby the air temp sensor and the pool temp sensor values are reported as string values unknown when in service mode.

Also I am curious if there is any way to know if it’s in service mode? Would be a nifty automation to remind me if it was in service mode for more than an hour (in case it wasn’t intentional).

I’ve been keeping it in service mode to override my schedule while I"m trying to clear some metal stains (not as successfully as I hoped, but that’s another story). Not to big of a deal, but did require setting up template sensors to avoid breaking the history graph (see below).

The temperature history graphs, in Lovelace, broke because a string value was returned unknown and were logged in the history (which I don’t want to delete/purge). This can be fixed by using some template sensors to pipe the values to int so that all string values are converted to 0.

For anyone else interested in tracking the history this will eliminate the string values:

- platform: template
    sensors:
      aqualogic_pool_temp_sanitized:
        friendly_name: "Pool Temp"
        unit_of_measurement: "°F"
        #Convert to ensure all values are numeric; string value such as 'unknown'
        # will convert to default value of 0.
        value_template: "{{ states('sensor.aqualogic_pool_temperature') | int }}"

You’d have to add code to the HA aqualogic/sensor.py that checks the service state via get_state(States.SERVICE).

Hi Ron,

I like the idea of this setup and would like to replicate it - the wifi->RS485 adapter I’m currently using is… flaky at best.

Could you share any configurations or helpful documentation you found along the way to configure settings such as the baud rate, data bits, stop bits, etc.? Or was it really as simple as flash esp-link, solder up rx/tx, and off you went?

I am stuck with a flashed nodemcu until Amazon delivers the TTL to RS485 adapter you referenced and would really like to get all my ducks in a row.

Thank you!

Edited to add:
Looks like one of my issues was being on v2.23 which didn’t have easily exposed data format settings. I updated to 3.0.14 and now see the following for available configuration:
image

Which I assume is configured correctly.

Yeah, my setup has been working for several weeks now without problems. It looks like your settings are correct. My main issues were lack of soldering skills (improving) and general inexperience with digital electronics devices. I had to read the esp-link docs over several times, each time coming away with another insight. The whole business of swapping UART pins took me a while to figure out. Then, the issue of Boot Modes, combined with some poor solder connections sent me down a rabbit hole for a while. I would recommend using the Standard UART pins (GPIO 1 & 3) and I did use 4.7K pullup resistors on GPIO0 & 2, and a pulldown on GPIO15. Not sure if the resistors are necessary but during my rabbit hole journey to find out why the board wouldn’t reboot or transmit I put them on. I finally got it all working on 2 stacked perfboards, voltage converter on one and the NodeMCU and interface board on the other. Took about a six foot length of 4 conductor cable with 4 pin male headers that match the Hayward Comm ports soldered to either end. 3D printed an open-topped box that fits the circuits and connectors. I was able to fit this behind the face panel of the Hayward control box and run the cable to the Comm Port. Took a lot longer than it should have and I’m glad I bought multiple parts to burn through. But as I said now that it’s up and running, it’s been good. I even got it to communicate with my VeraPlus hub so I can control pool lights, etc. via Alexa. Let me know if there’s anything I can help you with.

1 Like

I finally got some time to wire it up this weekend and I have to say I am very impressed. Way more stable / incredibly faster response time than my previous solution (USR-WIFI232-630)

Only note to add would be that the converter board you linked is marked for where it wants you connect TX and RX, not the connections that are exposed as RX and TX. If you’re like me, and used to wiring ESPTX->ClientRX and ESPRX->ClientTX you will run into issues. Just a quick swap and I was good to go.

Thanks again!

I ended up using 2 screw terminals for the Rx and Tx lines because I kept switching them around so much. :grinning:

Hi Carmen

Are you running home assistant with your OnCommand controller?

Guys this is awesome! I’ve been trying to do this for years! I’m not a dev by any means but can stumble my way around. I’ve got it working to the point that I have Home Assistant reading the controller just fine and can turn on/off the filet and light. I really want to switch between spa/pool and also see if heater is in auto but don’t see how to do that. Anytime I try and add a switch for spa I get a bad config error. I would love to have something like d3 here has on this screenshot. I’ve read and searched everywhere but I don’t see any switches here for pool/spa or heater here AquaLogic - Home Assistant (home-assistant.io) here is my configuration.yaml

aqualogic:
  host: XX.XX.XX.XX - not posting for security
  port: 4328
  
# Example configuration.yaml entry
sensor:
  - platform: aqualogic
    monitored_conditions:
      - pool_temp
      - air_temp
      - spa_temp
      - salt_level
      - pool_chlorinator
      - status
      
      
      # Example configuration.yaml entry
switch:
  - platform: aqualogic
    monitored_conditions:
      - lights
      - filter

Any assistance would be greatly appreciated! I was so excited today when I got it reading just these things I could have done a backflip. Now to try and sell my aq-serial-co :slight_smile:
Thanks!

Switches for heater & pool/spa are in the latest library. They haven’t been integrated into HA yet because the gatekeepers insist the config code be re-written and I haven’t had time. Here’s the (rejected) pull request: https://github.com/home-assistant/core/pull/36458

1 Like

Thanks! Are there instructions on how I can add this to my HA deployment? I’m using a VM on Hyper-V. I really can’t thank you enough for all the work you and the community have put into this as I have tried a number of platforms over the past few years and Finally have it working almost perfectly! If you’re ever in N FL I will absolutely buy you dinner and a few beers!