I get a lot of junk with NodeMCU(ESP8266) too. Perhaps this has something to do with it?
From the ESPHome UART Bus page:
“ Note
On the ESP32, this component uses the hardware UART units and is thus very accurate. On the ESP8266 however, ESPHome has to use a software implementation as there are no other hardware UART units available other than the ones used for logging. Therefore the UART data on the ESP8266 can have occasional data glitches especially with higher baud rates…”
I am not sure that has anything to do with it as I am not using ESPHome. ESP-Link may have the same limitation since your citation references hardware differences. 19200 is not a particularly high baud rate relatively speaking so I am not sure what to think. I recently stumbled upon so talk of ESP-Link being ported to ESP-32 so I may check it out and see if it helps.
Awesome work. This seems to be working on my controller as well. Perhaps can pass in some variable into the plugin to use these different values instead.
Yep, that’s my next step. I might fork the project and setup a custom component and write up a README to make instructions clear on how to use it. There’s a few things I wanted to tweak to make it more suitable for the PS-4 and/or wireless remote compatible terminals for people who have network latency issues.
For now I’m just going to fork the aqualogic library and get this working with wireless controls on a PS-4. I also wanted to document how people can use the updated states without the config flow in HA (Pool/Spa, Heater, etc). Having them labeled as Aux 1-7 makes things more difficult, and since the gatekeepers want a new config flow it’s probably better to set it up as a custom component in the meantime.
I came across some more info related to your comments and found conflicting information. While I2C is implemented in software on the ESP8266, it does have 2 hardware UART channels. However, as I understand it, on the ESP8266, one is tied to the serial flashing interface leaving one available. ESP-HOME uses that for logging so it has to use a software implementation on the ESP8266 for any other applications. I do not think that is the case for ESP-LINK. None-the-less, I am currently looking to use an ESP-32 serial to wifi bridge solution but the best option I have found does not seem to be as polished as ESP-LINK so will like take some tinkering to get working.
Great troubleshooting, hopefully when implemented this will help me with my problem too.
I don’t suppose you have an RGB LED pool light? One of the things this integration is missing is the ability to set the RGB LED pool light color. On the ProLogic Controller itself, you just need to keep turning the light on and off to toggle through the colors and patterns. However, there is a remote (there is a wired and wireless version, the wired version must be RS485) that can be purchased that allows you to directly set a color or pattern, which means there has to be a value that can be passed to the light to pick a color, and HA should be able to do it if someone is able to figure out how to set the value…
Unfortunately no RGB lighting here, so I wouldn’t be able to test this. You’re more than welcome to come up with a solution and I can look at your pull requests if you figure something out
I believe you need an additional controller to manage the color selection without power cycling and I am sure it has an undocumented comms protocol. Would be nice to see though!
It looks like you are essentially correct. The older RGB LEDs can be directly controlled, but it is only through a 2-wire power feed through the relay, there is no separate data feed. The wired controller must somehow send a data signal over the power wires and the LED unit itself is able to interpret this signal. This means there is no way to control this directly through the AquaLogic/ProLogic interface. It also appears that there are newer “networked” RGB lights that can be directly controlled through Hayward OmniLogic controllers. Of course that is not relevant to this library since OmniLogic has a different component.
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.