Jandy iAqualink Pool Integration

Guidelines say the integration needs to be marked unavailable. I’ve noticed some connectivity issues which I’m guessing is due to higher internet usage and congestion. I’ve noticed issues with the app as well.

Crashes shouldn’t occur, please enable debugging and submit a bug report on github. (Temporary?) issues should be handled properly.

Given that the zodiac API looks very different from the iaqualink one, I would argue that there’s anything easy about it.

These are all undocumented APIs abd there’s a lot of trial and error to get things working. Since I am the only code contributor so far, progress is blocked by lack of access to the wide variety of equipment available and/or time to do the work.

Done, link is here. TY!!!

1 Like

Thanks @flauran and @bigeazy000 - I just added a Stenner pump to my pool and started using the “Extra Aux” (‘aux_EA’) switch, but it wasn’t working from Home Assistant. I can confirm that this one-line change also fixes it for me! https://github.com/home-assistant/core/issues/34814#issuecomment-634310111

Now that I’m all set up to edit the code and test out changes, I think I’ll take a look at the light colors. I have a bulb that uses the IntelliBrite colors/shows, which is different than the current enum in iaqualink/device.py.

1 Like

You can probably reverse-engineer the values from the iAqualink manual. That part of the code needs to be cleaned up.

Hi @flauran,
I was able to extract the effect names for all the different colors/shows for all supported types of colored lights simply by going into the System Setup (in the Web UI) and pretending to have each type of light, then turning on the light in the UI.

I only have a J&J Electronics ColorSplash LXG (which exactly mimics the Pentair IntelliBrite effects), but I can confirm that it switches to the correct colors when instructed by Home Assistant. I expect the other brands’ light effects to follow the same pattern of “position in the UI list” => “numeric API value”, but can’t confirm yet. Maybe I’ll try to set up Charles Proxy someday soon and confirm the actual API values that are being sent by the app.

Anyway, I pushed my progress so far here:


and

Let me know if you have any feedback. (I have a lot of experience using git with a private server, but haven’t contributed on github yet. If there’s a better way to share my code than forking and pushing to my own fork, please do let me know - I like to learn).

One bummer so far is that the iAqualink API seems to return “state”=1 for any color/show, so I don’t see a way to retrieve the actual previously-chosen effect.

It also looks like Home Assistant UI wants me to turn the light on before choosing the effect (resulting in 2 iAqualink API calls). However, the way these lights work, we really want to choose the effect first and issue only 1 iAqualink API call - there’s already a lot of delay because the Aqualink selects the color by toggling the relay on/off a bunch of times with a few seconds of intentional delay built-in.

BTW, I found the following manuals on the iAqualink website, but wasn’t able to find a complete listing of light effects in any of them. Are there any other useful manuals you know of?

  1. iAquaLink 2.0 Web Connect Device Installation Manual (H0435500)
  2. iAquaLink 2.0 Web Connect Device Owner’s Manual (H0433600)
  3. iAquaLink 2.0 Web Connect Device Quick Start Guide (H0423300)

Thanks for your time!

On Zodiac Iqualink devices, I can :
1- list all devices with :

AQUALINK_DEVICES_URL=“https://support.iaqualink.com/devices.json

curl -X GET -H “Host:support.iaqualink.com” -H “accept:/” -H “content-type:application/json” -H “accept-encoding:gzip” -H “user-agent:iAquaLink/70 CFNetwork/901.1 Darwin/17.6.0 okhttp/3.12.0” -d @/tmp/iqualink.auth $AQUALINK_DEVICES_URL |gzip -d

/tmp/iqualink.auth look like:

{
“api_key”:“APIKEY”,
“authentication_token”:“TOKEN”,
“user_id”:“USERID”
}

2-Read all datas concerning your dev :

btoken=jq '.userPoolOAuth.IdToken' /tmp/iaqualink.token |sed -e 's;";;g'

curl -X GET -H “Host:prod.zodiac-io.com” -H “accept:application/json” -H “Authorization: Bearer $btoken” -H “accept-encoding:gzip” “https://prod.zodiac-io.com/devices/v1/$sn1/shadow” > /tmp/iaqualink.exo

3- Change Chroration state (Auto,Off,Low,Boost) :

curl -X POST -H “Host:prod.zodiac-io.com” -H “accept:application/json” -H “Authorization: Bearer $btoken” -H “content-type:application/json; charset=UTF-8” -H “accept-encoding:gzip” -H “user-agent:okhttp/3.12.0” -d @/tmp/iqualink.chloration “https://prod.zodiac-io.com/devices/v1/$sn1/shadow

/tmp/iqualink.chloration look like :

{
“state”:
{
“desired”:
{
“equipment”:
{
“swc_0”:
{
“production”:1,
“boost”:0,
“low”:0
}
}
}
}
}

4 But i can’t manage light on aux_1 (230V), any idea ?

You’d probably be interested in this: https://github.com/flz/iaqualink-py/blob/ea897802479835e942832677483a52a9805b551b/src/iaqualink/client.py

Simple on/off AUX switches can be controlled like:

GET https://iaqualink-api.realtime.io/v1/mobile/session.json?actionID=command&command=set_aux_4&serial=[*redacted*]&sessionID=[*redacted*]

Colored lights can be controlled like:

GET https://iaqualink-api.realtime.io/v1/mobile/session.json?aux=5&light=5&subtype=5&actionID=command&command=set_light&serial=[*redacted*]&sessionID=[*redacted*]

yes the really long string

Thanks but Zodiac EXO devices appear as offline on iaqualink-api.realtime.io

Hello,
New to this integration. I see it’s in the HA populated integrations, and prompts a iAqualink login when selected. I enter my credentials, same email and pass I use directly on the site (which work) and it returns “unknown error occurred”. Any thoughts?

I’m thinking that, without logs, I’m going to need a crystal ball :slight_smile:

Can you follow the documentation and turn on debugging for the integration?

That’s a logical response :laughing:

aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host support.iaqualink.com:443 ssl:True [SSLCertVerificationError: (1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056)’)]

Can you give a bit more details on your setup as well? Is this HA (formerly HASSIO), self-hosted?

Self hosted on OSX HA 0.113.2

Hi @flauran,
Did the additional details provide any insight to the issue?

Re: Colored lights

I finally got around to capturing the iOS app traffic with CharlesProxy, and the “light” params were sent as expected in the “set_light” requests.

Also, starting from a fresh install of the app, I don’t see any responses from iaqualink.net that list the available color effects, so I’m pretty confident that the effect names are hardcoded into the iOS app. That makes me feel better about hardcoding them in the iaqualink-py library too.

Pull request is here: https://github.com/flz/iaqualink-py/pull/5

Would love to get this support into the official release.

Thanks @flauran!

I’m seeing SSL errors now in my Docker installation:

2020-09-01 11:49:51 WARNING (MainThread) [homeassistant.components.iaqualink] Failed to refresh iAqualink state
2020-09-01 11:50:21 ERROR (MainThread) [iaqualink] Unhandled exception: Cannot connect to host iaqualink-api.realtime.io:443 ssl:default [[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1108)]
2020-09-01 11:50:21 ERROR (MainThread) [iaqualink] Traceback (most recent call last):
2020-09-01 11:50:21 ERROR (MainThread) [iaqualink]   File "/usr/local/lib/python3.8/site-packages/aiohttp/connector.py", line 936, in _wrap_create_connection
2020-09-01 11:50:21 ERROR (MainThread) [iaqualink]     return await self._loop.create_connection(*args, **kwargs)  # type: ignore  # noqa
2020-09-01 11:50:21 ERROR (MainThread) [iaqualink]   File "/usr/local/lib/python3.8/asyncio/base_events.py", line 1050, in create_connection
2020-09-01 11:50:21 ERROR (MainThread) [iaqualink]     transport, protocol = await self._create_connection_transport(
2020-09-01 11:50:21 ERROR (MainThread) [iaqualink]   File "/usr/local/lib/python3.8/asyncio/base_events.py", line 1080, in _create_connection_transport
2020-09-01 11:50:21 ERROR (MainThread) [iaqualink]     await waiter
2020-09-01 11:50:21 ERROR (MainThread) [iaqualink]   File "/usr/local/lib/python3.8/asyncio/sslproto.py", line 529, in data_received
2020-09-01 11:50:21 ERROR (MainThread) [iaqualink]     ssldata, appdata = self._sslpipe.feed_ssldata(data)
2020-09-01 11:50:21 ERROR (MainThread) [iaqualink]   File "/usr/local/lib/python3.8/asyncio/sslproto.py", line 189, in feed_ssldata
2020-09-01 11:50:21 ERROR (MainThread) [iaqualink]     self._sslobj.do_handshake()
2020-09-01 11:50:21 ERROR (MainThread) [iaqualink]   File "/usr/local/lib/python3.8/ssl.py", line 944, in do_handshake
2020-09-01 11:50:21 ERROR (MainThread) [iaqualink]     self._sslobj.do_handshake()
2020-09-01 11:50:21 ERROR (MainThread) [iaqualink] ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1108)
2020-09-01 11:50:21 ERROR (MainThread) [iaqualink] 
2020-09-01 11:50:21 ERROR (MainThread) [iaqualink] The above exception was the direct cause of the following exception:
2020-09-01 11:50:21 ERROR (MainThread) [iaqualink] 
2020-09-01 11:50:21 ERROR (MainThread) [iaqualink] Traceback (most recent call last):
2020-09-01 11:50:21 ERROR (MainThread) [iaqualink]   File "/usr/local/lib/python3.8/site-packages/iaqualink/system.py", line 75, in update
2020-09-01 11:50:21 ERROR (MainThread) [iaqualink]     r1 = await self.aqualink.send_home_screen_request(self.serial)
2020-09-01 11:50:21 ERROR (MainThread) [iaqualink]   File "/usr/local/lib/python3.8/site-packages/iaqualink/client.py", line 157, in send_home_screen_request
2020-09-01 11:50:21 ERROR (MainThread) [iaqualink]     r = await self._send_session_request(
2020-09-01 11:50:21 ERROR (MainThread) [iaqualink]   File "/usr/local/lib/python3.8/site-packages/iaqualink/client.py", line 152, in _send_session_request
2020-09-01 11:50:21 ERROR (MainThread) [iaqualink]     return await self._send_request(url)
2020-09-01 11:50:21 ERROR (MainThread) [iaqualink]   File "/usr/local/lib/python3.8/site-packages/iaqualink/client.py", line 79, in _send_request
2020-09-01 11:50:21 ERROR (MainThread) [iaqualink]     r = await self.session.request(
2020-09-01 11:50:21 ERROR (MainThread) [iaqualink]   File "/usr/local/lib/python3.8/site-packages/aiohttp/client.py", line 480, in _request
2020-09-01 11:50:21 ERROR (MainThread) [iaqualink]     conn = await self._connector.connect(
2020-09-01 11:50:21 ERROR (MainThread) [iaqualink]   File "/usr/local/lib/python3.8/site-packages/aiohttp/connector.py", line 523, in connect
2020-09-01 11:50:21 ERROR (MainThread) [iaqualink]     proto = await self._create_connection(req, traces, timeout)
2020-09-01 11:50:21 ERROR (MainThread) [iaqualink]   File "/usr/local/lib/python3.8/site-packages/aiohttp/connector.py", line 858, in _create_connection
2020-09-01 11:50:21 ERROR (MainThread) [iaqualink]     _, proto = await self._create_direct_connection(
2020-09-01 11:50:21 ERROR (MainThread) [iaqualink]   File "/usr/local/lib/python3.8/site-packages/aiohttp/connector.py", line 1004, in _create_direct_connection
2020-09-01 11:50:21 ERROR (MainThread) [iaqualink]     raise last_exc
2020-09-01 11:50:21 ERROR (MainThread) [iaqualink]   File "/usr/local/lib/python3.8/site-packages/aiohttp/connector.py", line 980, in _create_direct_connection
2020-09-01 11:50:21 ERROR (MainThread) [iaqualink]     transp, proto = await self._wrap_create_connection(
2020-09-01 11:50:21 ERROR (MainThread) [iaqualink]   File "/usr/local/lib/python3.8/site-packages/aiohttp/connector.py", line 941, in _wrap_create_connection
2020-09-01 11:50:21 ERROR (MainThread) [iaqualink]     raise ClientConnectorSSLError(req.connection_key, exc) from exc
2020-09-01 11:50:21 ERROR (MainThread) [iaqualink] aiohttp.client_exceptions.ClientConnectorSSLError: Cannot connect to host iaqualink-api.realtime.io:443 ssl:default [[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1108)]
2020-09-01 11:50:21 ERROR (MainThread) [iaqualink] 
2020-09-01 11:50:52 WARNING (MainThread) [homeassistant.components.iaqualink] Reconnected to iAqualink