Strange as it may seem, these timings work for a much higher percentage of attempts at interacting with a button. Most of the time I can get a button turned on within one attempt, but sometimes two or three.
The logic behind this is to wait for the keep-alive message (t = 0ms), wait 50ms (bus is busy/ignores incoming data; t=50ms), write frame to TCP socket 5 times before the next keep-alive message at t = 100ms. I accounted for latency in the network in my numbers (tended to be around 2-4ms for me on average).
I sort of piece-mealed together a working solution that has all of the buttons I need and the states that I need. I don’t have time at the moment to make it an elegant solution for more configurable modes (wireless vs wired keypress users). I do plan on trying to put a guide together on how I managed to do this and how you can go about tweaking things (like timings and such, I was too lazy to calculate network latency in code).
On a high level:
I added the necessary states to the HA code in switches.py
I created my own PyPi derivative package to support my custom timing logic (and I commented out some keys I didn’t need to use because they conflicted with my wireless codes)
I added the new dependency to the manifest.json of the HA component
If anyone really needs help sooner, let me know… I’ll work on publicly documenting this in the future so you can customize your own setup the way you need it, and hopefully I can propose a more elegant solution with a little bit more forethought and less naivety and hardcoding.
I haven’t written anything official yet, still running off my hard-coded solution (which lacks flexibility for other setups). I’ve had to update a few things here and there to make button presses and reconnecting smoother, but other than that I haven’t published anything that wouldn’t require a bit of programming knowledge.
If you’ve been using the Aqualogic integration for your Hayward pool hardware for more than the past 12 months, what do you do for it off-season?
Assuming you shutdown your pool during the cooler – or where I live, freezing cold – months, do you still leave the integration active and sputtering away in Home Assistant, or do you somehow disable/pause/turnoff the integration?
Aqualogic doesn’t appear in the Configuration > Integrations page – at least not for the custom version I’m still trying to get running – so there’s no handy “Disable” option.
You can disable your custom integrations by renaming the custom_components folder inside your Home Assistant configuration folder to something else. Please be sure to restart Home Assistant after you’ve renamed it.
Thanks to everyone that has contributed to this thread. It has helped me quite a bit to jumpstart my own development. However, I chose a little different route. I am not so interested in HA so I decided to build my own standalone APP starting with WPF (Visual Studio) and in the future, hopefully, Android & iOS. Also, I bought one of these:
What attracted me to the EW11 is that in is a all in one unit complete with RS485 & WiFi interfaces plus an on board processor that supports TCP/IP/UDP/HTTP and scripting. The scripting component turned out to be critical because of the key press timing. I am not sure about other devices but this one frames the RS485 with a variable time gap that can be set to a minimum of 10 msec which means that the received keep alive frames are always at least 10 msec late. I first tried to do the synchronization (send key press immediately after KA) at the application layer but the key presses were only about 50% successful. Probably because of the latency variance in the LAN. So to improve on this, what I did is to create a EW11 script that sends the key ~90 msec after the last keep alive was sent. The script intercepts frames in both directions so it can log when the keep alive was received and then forward a keep press at the correct moment ~90msec in the future. This has worked pretty well with >95% success. There is still some inherent uncertainty in the latency within the unit itself but at least I have eliminated the LAN.
One other thing I discovered is that the display message is using a non-standard encoding mechanism for character codes over 0x7F. I believe this is to force the display to blink for these characters. But I found, if you just subtract 0x80, the codes become ASCII equivalents and the text is displayed as normal.
Updated script to prevent blocking in the UART. These changes also allow for the unlocking of the config menu by sending button holds at a rate of twice the KA rate to make sure there is a button hold for each KA.
@markinpt Ive read this over and over and over again. I’d so be down to pay for your app
I’m not really code savvy but I’m mechanical savvy. If love some help !! Happy to pay. Thank you!!
And to everyone else. Thank you so much for giving me hope that this 1990’s era hardware can be brought to the 21st century.
I just wanna ask Alexa to turn my 90’s crap on lol
There is an ethernet adapter that comes with the unit and there are pin outs on the side of the adapter that shows A+, B-, VCC, GND connections just like what is available on the AquaLogic board although in slightly different order. However, I took an ethernet cable, cut off one end and just connected the wires the AquaLogic remote display terminal. The connections are in more detail on this page:
As for the app, it is only in Windows at this point and I am still testing and adding features. Currently, it is nearly a direct emulation of the local controller. So the buttons all work the same way. I will be happy to share it when I feel it is in a stable form. Below is a picture of the main form.
However, if you want to have Alexa control it, then you might want to go the HA route instead. This device should work the same either way.
Hey. Thank you so much for that thorough write up
Unfortunately I can’t even get the SSID to show up.
Tried entering it manually to just in case it was not broadcasting. I don’t know what I’m doing wrong
Mine showed up fairly quickly so perhaps there is something wrong with that one.
Once when I was loading scripts, mine locked up on me and I had to do a couple of resets to bring back to factory settings. Eventually it did respond. If you connect pin 4 from the RJ45 to ground for a few seconds, that should reset the unit.