Ron, are you using a P8? I just added some code that Mark created for the P8 that might help. It’s in my repo now. The latin-1 is a work around, not a real fix.
Pretty sure it’s a P4. Only 4 relays, not 8. But I have replaced the original circuit board. Don’t remember if it is the same model as the original, if that would matter. Main Software Revision 4.46. Display Software (I’ll have to look later)
Ron, try updating your core.py to:
text = frame. Replace(b’\xdf’, b’\xc2\xb0’).replace(b’\xba’, b’\xc2\xb0’).decode(‘utf-8’)
Instead of the latin-1. If that doesn’t work, can you post the error you’re getting?
It seems that there are differences even between versions of the same controller.
This is the error I got with that change (direct cut and paste from your previous email, old line commented out):
File "/config/custom_components/aqualogic_p4p8/core.py", line 310
text = frame. Replace(b’\xdf’, b’\xc2\xb0’).replace(b’\xba’, b’\xc2\xb0’).decode(‘utf-8’)
^
SyntaxError: invalid character '’' (U+2019)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config.py", line 1439, in _async_load_and_validate_platform_integration
platform = await p_integration.integration.async_get_platform(domain)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1079, in async_get_platform
platforms = await self.async_get_platforms((platform_name,))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1156, in async_get_platforms
import_future.result()
File "/usr/src/homeassistant/homeassistant/loader.py", line 1144, in async_get_platforms
platforms.update(self._load_platforms(platfonames))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1069, in _load_platforms
platform_name: self._load_platform(platform_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1263, in _load_platform
raise ImportError(
ImportError: Exception importing custom_components.aqualogic_p4p8.sensor
That’s a cut and paste error. I should have put it in a code block. Your code has apostrophe instead of single quote. Try this:
text = frame.replace(b'\xdf', b'\xc2\xb0').replace(b'\xba', b'\xc2\xb0').decode('utf-8')
Yes! That seemed to do the trick. All seems to be working now. Figured it was something simple. Thank you so much!
Glad you got it working!
Added the ability to unlock the configuration menu. When you’re on Configuration Menu-Locked and press the right arrow, it should unlock the menu (wait around 5 secs). You can then right arrow through.
This is a really useful addon. And is working really good.
My only issue is the menu buttons are not always responsive. I need to sometimes press them a few times for it to take.
I really wonder why this happens.
Besides that, and this has always been an issue for me…
The way my system is setup the pool and spa share a heater but have separate pumps/filters. And there is an auto valve which is supposed to trigger when the spa pump (aux1) is on. But it does not, and what ends up happening is the spa pump runs and ends up draining all the water from the spa into the pool.
I need to somehow figure this out and fix it.
I also have auto valves on aux3 and aux4.
not sure what aux3 does. Need to figure that one out. But aux 4 switches the main pool suction between the bottom drains and the skimmer.So i have aux 4 on a timer.
And prologic only allows for up to 2 of the actuating valves on aux ports. And an additional actuating valve on the pool/spa switch. The pool/spa switch is a but confusing.
I am hoping i can solve some of these issues using the automation in HA.
I am using the TCP232-304 RS485 adapter since i do have an ethernet cable run to the prologic panel. Hardwired is always better than wifi, and no one will ever convince me otherwise My entire house is hard wired with cat6. And ofc i have wifi, but not for anything static.
I get being hard wired is not always an option tho.
What i would really like is one that supports POE.
Anyone know of a good alternative module that supports POE?
I’m thinking of trying this one;
waveshare Industrial Isolated Rail-Mount RS232/485/422 Serial Server, RS232/485/422 to RJ45 Ethernet Module with POE, TCP/IP to Serial Converter, Modbus Gateway Support
I am using the TCP232-304 RS485 adapter since i do have an ethernet cable run to the prologic panel. Hardwired is always better than wifi, and no one will ever convince me otherwise My entire house is hard wired with cat6. And ofc i have wifi, but not for anything static.
In this case, the EW11 (wireless) is better than Ethernet. Not because it’s wireless, but because it has scripting which moves the timing/sending of the key frames to the device. Ethernet has too much latency for the timing needed to be reliable. It really has nothing to do with the speed of the connection. The key frames being sent are very small, but they need to be timed properly to work.
Is there no hard wired equivalent to the EW11?
I don’t know if there is another device with scripting. The EW11 works for me, so I never looked further.
Thank you JayDubs for your GitHub post. I was using ESP01M for 2 years now and could read the infos but had given up controlling remotely. Recently I got a EW11 and followed your instructions and it has been working flawlessly on my ps4. I also installed the mobile app on my android phone to see if it works and it does, response is a bit faster but I still prefer HA. My only concern was the IOTservice which is Windows only and could not make in work on LInux so I had to install a WIN11 partition on my laptop. It is possible to connect and configure the EW11 by web browser but did not find the part to install the script.
Glad to hear it’s working for you. Yeah, the IOTservice is sketchy. I uninstalled it after I imported the script. I don’t know of another way to import the script though. I also block the internet from my EW11. I do that with most of my HA devices though.
HA has some overhead that the mobile apps don’t, so it will be a little bit slower. The code in HA is also a little messy and could be optimized a bit, but since it’s working I didn’t bother. I just fixed what was not working for me, added a few things, and put it out there for others to use.
I’d really like to get rid of having to add YAML to the configuration.yaml and do the settings with a proper HA UI integration, but I haven’t gotten around to it.
Thanks again for your contribution. Ultimately, I think if this could somehow be translated to ESPHome yaml, that would be ideal. Chat GPT maybe?
Anyway, it’s been working solid so far. Awesome job!
I’m sorry if i’m being ignorant, or if this was already discussed.
The EW11 fixes the latency issues?
Cause it all works great except for sometimes buttons needing to be pressed a couple times before it takes.
I have an Elfin EW11 on order. Does not hurt to try it out regardless. Unfortunately will take a couple weeks to get it here.
I have an Aquapod 2.0 which is cool and works great. But having this on HA is so much better because of all the automation possibilities and different notification options.
I’ve already setup alerts for when the salt reaches a certain point, also added a automation to turn on superchlorinate anytime it rains over 1" here. Using Accuweather precipitation entity.
I am in florida, it happens often - and i need to superchlorinate often.
Just need to figure out the shared heater issue with the pool/spa valve.
Well, it seems that the latency issue over WiFi occurs because the HA computer sends a command to the WiFi/RS485 bridge (your EW11 or whatever device) at the pool control panel. The problem is the latency delay between when the command is sent and when it arrives at the remote device. By default, the remote device just sends the command to the control panel, without being aware of where in the sequence of keep-alive messages this takes place. HA thinks it’s sending the command at the proper time but it’s always somewhat behind because of network latency (WiFi>>Ethernet). The genius of this solution is that there’s a smart (i.e. programmable/scriptable) device directly hooked into the RS485 bus. It’s smart enough that when it gets a command from HA, instead of blindly passing it on to the RS485 line, it can say “OK, got it! I’ll send it as soon as the next sending interval opens up on the RS485 bus.” The latency between giving the command from HA and the EW11’s actually sending it is imperceptible to us but makes it able to fit the command into the RS485 bus in the small time window allowed by the protocol. Hope this made sense.
Ron is correct. It doesn’t matter if you’re using an ethernet or wireless connection because both will have enough latency that it will affect the timing. The original author tried his best to do the timing from the HA python code, but it’s a losing battle because you don’t know the latency on the connection, and it will change constantly.
The script (developed by markinpt) on the EW11 device is the key because it can do the proper timing and is connected directly to the 485 serial bus.
It sounds like you’re currently using the intregration included in HA. That’s an older version of the code. When you get the EW11, you’ll want to use the code from the repo below. You’ll disable your current integration (comment or delete from configuration.yaml). Then follow the instructions below.
Makes perfect sense. Thank you both for the detailed replies.