Poolcop integration?

Hi,
Is anyone aware of a “Poolcop” integration from PCFR? They do have an API available. It’s a pool automation system.

https://www.poolcop.com/en/

The API is a simple HTTP/JSON endpoint. You can find the documentation here : https://poolcopilot.com/api/docs/

They even made a connector for Constellation on GitHub : https://github.com/myconstellation/constellation-packages/tree/master/PoolCop
Constellation is a platform to interconnect software and device for home automation or any other use case : http://www.myconstellation.io/

Hi Tim, did you find a solution to integrate PoolCop into Home Assistant?

Unfortunately not :pensive:.
However there is a full api available, so it shouldn’t be that difficult if you are a programmer.
Unfortunately I’m not a programmer.

Hi all.
First post on the forum. Just subscribed to let you know that I have started playing around with HA API integration and have just requested my API key from the Poolcop guys.
If the doc I have read is right I should be able to at least get fairly quickly some feedback from the Poolcop into HA.
I’m not a pro dev so the first iterations might be a bit rough but I’ll welcome testers if you’re still interested.

My immediate goal is to obtain the equivalent of the mobile app dashboard.
So pressure, water level, PH, water and air temps, chlorine and salt levels
Filtration mode (read + trigger backwash if possible)
Pump status/speed (read and update if possible)
Auxiliaries status (read and update if possible)
Possibly add poolcop version and whether there’s an available update.

Seems complete enough to me but let me know if you can think of something else interesting.

I will post here my progress, hoping to have a working prototype by mid January 2024.

Kind regards

Well that’s absolutely great news :slightly_smiling_face: :clap:
Would be great to have all information of the mobile app dashboard into HA.

Maybe also interesting to show the last backwash time in HA?
I also received an api key from Coolcop, so I certainly can test :wink:

Hi again.

A quick update:
I have received my API key and have started tinkering.
What’s working so far:

  • Get a token from the API key and refresh it every 15 minutes
  • Use the token for a global status call (refresh every 30 seconds for now).
  • Grab all necessary info from the call (IP, MAC, version, status code, name, pH, orp, water level, air and water temps, pressure, last water refill, last backwash, valve position, pump speed and status of all connected options and auxiliaries)
  • Created a card to display the data
  • Managed to make a couple of POSTS to update some elements (I can turn pump on and off)

What’s causing me grief for now, is posting requests to the API whenever I have to provide a payload. Seems like the API doesn’t process it correctly. Still quite a bit of work there to understand how it operates. So for now I can neither change pump speed nor turn on/off auxiliaries.

So quite a bit of work still to get everything working, and even more templating to make it more accessible. A lot of the data the API returns is not directly human readable (0/1 for on/off, numbers codes for statuses and errors…)

I’ll join a screen of my progress before the weekend is over, and share some code when I have found a solution to my payload issue.

We’re getting somewhere!

1 Like

Thanks for the update! Looking forward to it :grin:

Sorry about the delay, took me longer than expected to find the solutions I was looking for.
But I don’t come empty-handed. I am now pleased to report that I am able to turn pump on and off, and change the speed as well! The same goes for valve position, for which the code is written but as yet untested (I want to be right by the poolcop when I test this to make sure the pump gets turned off automatically before the valve tries turning).
Also, I solved the mistery of the aux api call. There was a bug on PCFR end which got solved quickly when I reported the issue to them. So I was able to control auxiliaries from the command line (no code yet) after they confirmed the fix.

So there is no more issues blocking my way and I should be able to have a fairly final release around mid january.

The caveats that remain though: The elements that are overseen by the poolcop directly are not controllable through the API. So I cannot trigger closing/opening of the pool cover or start/stop the jet stream.
Also, the salinity data - though available through the poolcop interface - isn’t exposed in the API so I cannot bring it over to you guys. I will have another discussion with their support to see if they would accept a feature request for this, but until then, there’s nothing I can do.

And as promised, the famous screenshot of the work in progress below (better late than never)

1 Like

Wow this is absolutely amazing :star_struck: :clap:
This is exactly what I was looking for.

Also the fix for the aux api call is good news. This will allow to activate & desactivate the pool lights I think :slight_smile: Or how are your pool lights connected to poolcop?

I guess the poolcop api is based on polling and not push? Is that correct?

Thanks for all your hard work.

Hi there.
Thanks for the support, it helps!

I confirm, the API is polling only
A first bit of script calls the token API endpoint every 15 minutes (which is the validity period for the token). And then I use that token to place a call to the status API (every 15 seconds).
A side effect is that when you first load the interface, and for a few seconds, you get a lot of undefined/erroneous data displayed before the first call happens and the data is properly initialized.

For the Aux, I personally use 3 different ones that are user switchable

  • Pool lighting
  • Pool colour switching (with poolcop sending a 2 second impulse on that channel, triggering a relay that interrupts the power supply to the lights thus causing them to change colour)
  • PoolHouse lighting
  • And coming soon heat pump control.

But in itself it won’t matter, I have devised my scripting in such a way that the card I add for the auxiliaries will dynamically scan the status API for each aux and only display the ones the Poolcop considers switchable (meaning having an assigned function that is not Poolcop-reserved)
So even if you copy-paste my code, your auxiliary card would have different content from mine, relevant to your own setup. Because depending on your hardware we might not even have the same number of auxiliaries. So globally on the card I attempted to make everything conditional so it only displays elements relevant to your system. For example it won’t display the air temp gauge if you don’t have one installed, or offer to change pump speed if your pump only has one.

Hopefully the code part will be mostly done by the end of the week with only testing and polishing to do.

Kind regards

I also would appreciate your input on one thing.
Is your disinfection system chlorine or salt-based?
If it is salt, is it a Poolcop Ocean?
In any case (unless it is a Poolcop Ocean, which is my own setup), I would appreciate a screenshot of your Poolcop interface (the old one).
I would like to see what data is exposed in those cases and if it is in any way different from mine so I can handle any difference properly as well.

Kind regards,

Hi,
Off course.

I am using a chlorine based desinfection system.
It’s a PoolCop Evolution.

Do you mean the general overview screen? Normally this is in Dutch language for me, but I changed it to English now, so you get an overview of what is displayed :slight_smile:

Thanks for that
Good to see that the data is actually the same so nothing extra to handle.
I notice your lights are slaved to the pump, which makes me think I need to test that case too. No idea how the API behaves when you try toggling an aux in that config.
I will test that later when I’m back home.

Next update should come on Saturday. Stay tuned!

Hi, what do you mean with that exactly? My pool cover is not connected to PoolCop, it works with a separate remote control.
To be honest, I have problems with activating/desactivating the pool light through the “Pool Light” button in PoolCop. The status of the lights is only changed each time after toggling twice the button in PoolCop. So the button state shown in PoolCop is not correct. The installer proposed to add a relay so that it will work correctly. But maybe the problem is related to something you noticed?
How are your pools lights working exactly?

This is the config of my lights:

Hi

As a first step, you might want to untick the “slaved to pool cover” box. Especially if the pool cover itself is not operated by poolcop.
The interest of that option is that if the poolcop is operating the pool cover itself, it will make sure the lights cannot remain turned on when the cover is closed.
I think that might be thee root of your issue, unless your installer setup the cover position as an input on the poolcop.
But to me it looks like the poolcop does not properly read the cover status and therefore does not immediately obey the command.

My setup is simpler, as I do not have a cover. I have a shelter above the pool.
So my auxilairies are in manual mode as well (apart from the color switching one) but not slaved to anything, and they toggle on and off without any issue.

On another note I am pretty much done with the scripting, and I will add a screenshot of the result below. Let me know if you think something could be added/removed.

I have also contacted poolcop support again about the salinity data. Mixed news on that front. They are definitely adding the data to their API, but to a new version coming sometime in 2024. So good news is we’ll get more info then, but the downside is they describe it as a complete revamp. So my current work might go down the drain.
We’ll see when it happens and I’ll adapt whatever I’ll need to at that point.

I need to polish my scripts, iron out a couple of kinks and think of how I can package it so it’s not too difficult to integrate for people but I expect aa release during the first week of January.

Kind regards,

Thanks for the suggestion. Will give it a try.

Great, give me a shout when you want someone to test.

Happy holidays!

Hi All,

i’m also using Home Assistant and have a Poolcop system running. Maybe i can help you also with testing and debugging if you want :slight_smile:

Are there also member who are using the modbus posibilities of Poolcop?

Hi,
Certainly willing to test. So if you need a tester, give me shout :slight_smile: