The pool is dumb, and the controller sucks! A simple action like turning on the hot tub takes nearly a minute of fiddling around with a dinky controller. The system has aged poorly. However, it's not like the PLC has aged beyond usefulness. I figured there was a way to introduce networking to the pool that would allow for integration into Home Assistant?
After doing some research, I came across the AqualinkD project! This problem had already luckily been solved. The project listed fairly basic hardware in order to get the pool online. All I'd need is a Raspberry Pi Zero W and a USB-to-RS485 adapter and it should be running in no time!
Unfortunately, I hit a wall very fast with my controller. While it was technically compatible with AqualinkD, it only supported a very basic signalling protocol called PDA protocol, which was only reserved for the cheapest, most basic Jandy controllers. On some configurations, this just won't work at all. After a few days of troubleshooting, I just set off to eBay to buy a slightly newer controller that supported the Jandy AllButton protocol.
After removing high-voltage power and installing the new controller, I was able to connect to the RS485 interface with some of Jandy's installer tools and could successfully communicate with the controller from my laptop. Now it was time to build out the embedded Linux box.
All I needed to get this working was a weather-proof enclosure, an extension cable i hacked and spliced into the pool controllers high-voltage input, and a little heat sink for the Raspberry Pi. I set up the system with Raspbian Lite 13 and enabled a read-only file system to prevent SD card corruption from power loss or due to logging, and enabled MQTT for HA integration.
I ran into strange issues with Wi-Fi disconnections with my Unifi APs, so I implemented some restart and Wi-Fi monitoring scripts for the system.
After bringing the RPi up on the network, I was able to see the basic HTML page that AqualinkD provides to confirm we had functionality. Then I connected the appliance to Home Assistant thru Mosquitto MQTT broker, which automatically adopted all available devices and sensors from the Jandy controller.
With this, I could built a dashboard to show on the home's control panel in the kitchen. This give us way easier access to controlling the Spa, and remote access as well.
Home Assistant can also integrate other sensors aswell to determine what state the pool should be in.
Hot tub on but no motion detected on cameras for over an hour -> Shut off automatically.
How long should pool run daily? -> Determine if it should run between 6-8 based on date/season.
In conclusion, the amount of effort I put into this project for the conveinence and ease-of-use it returned was absolutely worth it.
It also prompted me to think about how embedded devices will become more and more common-place in our homes as we have more "smart" items and appliances.
Building this required me to enforce my requirement of home automation equipment functioning as an appliance and not like a computer. A microwave doesn't randomly give you an error code, your dishwasher doesnt disconnect from the dishnet and prevent you from doing your dishes, these things just work when you ask them to. I think home automation should be the exact same way.
Security and attack surfaces are also a big thing for this particular installation. A nuisance attacker could waste water, energy, damage your pool equipment, or even use the box as a jump-point on your network.