Jandy iAqualink Pool Integration

Just pushed a fix. Update your checkout and you should be good to go.

Edit: It fixed the issue but introduced a new one. It seems to be making way more requests than necessary. Obviously I messed up something in the config_flow implementation.
Edit 2: Should be good now!

Getting this error after upgrade to .94.1, as well as downloading / overwriting the newest version / files from Git

## Log Details (ERROR)

Sun Jun 09 2019 21:08:16 GMT-0500 (Central Daylight Time)

Migration handler not found for entry Aqualink for aqualink

In config_flow.py, try replacing the version from 2 to 1.

After updating this and rebooting:

Mon Jun 10 2019 08:25:40 GMT-0500 (Central Daylight Time)
Error setting up entry Aqualink for aqualink
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 273, in async_setup
    hass, self)
  File "/config/custom_components/aqualink/__init__.py", line 61, in async_setup_entry
    username = entry.data[CONF_USERNAME]
KeyError: 'username'

configuration.yaml (unchanged since upgrade)

aqualink:
  username: !secret aqualink_user
  password: !secret aqualink_pass

After setting the VERSON in cofnig_flow.py to 1, I now get this same error about username.

Can you go in the UI -> Configuration -> Integrations, remove all the Aqualink ones and restart HA?

1 Like

And… that looks to have fixed it. As always, THANK YOU @flauran!

1 Like

Well, chances are I got it broken in the first place but I’m glad it was a somewhat easy fix :slight_smile:

On a side note, I finally got around to replicating the setup that was used to man-in-the-middle the SSL traffic (and document the API) so I’ll be able to add support for onetouch if someone is willing to give me access to their setup (I don’t have onetouch working for some reason?).

While I was looking at the requests, I noticed a few differences between the iAqualink app and my implementation of the API:

  • App is using HTTP/2.0, not HTTP/1.1: Unfortunately here, I’m using aiohttp which doesn’t support http2. This means I’d have to switch to another HTTP library.
  • App uses compressed requests/responses: Probably won’t make a huge difference.
  • App makes requests every 7 seconds on the active page. Connection is persistent (Keep-Alive) unlike with my code.

I’ve also noticed cases of requests hanging causing the whole component to stall HA. The library I use (aiohttp) doesn’t have a timeout by default, setting a 5s timeout solved that particular issue so I’ll land that fix at some point this week along with making entities unavailable on the HA side when the system is reported as Offline.

I’ve also started working on integrating the code with homeassistant but a few things need to be cleaned up (and docs need to be written) before I submit a pull request. Hopefully I’ll be done in time for HA 1.0.

1 Like

Is there a way to reduce the polling frequency?

I hadn’t ever had issue w/ connectivity, and now I can’t even get in via my web interface. I’m wondering if they’re rate-limiting my account b/c of this HA add-on?

I even thought it was wireless connectivity issues, so I went so far as to pull a cat-5 to the iAqualink connect unit outside - and still I’m getting no connectivity. Anyhow - thought maybe polling every 5 / 10 minutes would be better?

I was thinking ratelimiting might be a thing but when my system shows Offline, rebooting my router typically fixes it. Not sure what to make of that though.

The polling interval isn’t configurable right now, I’d have to change a few things on the component side to have a built-in timer.

Thinking of reaching to iobridge and get info from them directly. Hopefully they’ll be ok with our use case given that it’s pretty niche and unlikely to cause the Jandy AWS bill to skyrocket.

This is some fantastic code! For those who can’t afford the iAqualink upgrade and have older Aqualink RS equipment - spend $25 for a Pi Zero, RS-482 Adapter and take a look here: https://github.com/sfeakes/aqualinkd

I am running this on HASS.IO with full control over every part of my Aqualink RS6 from 2001.

Cheers.

1 Like

FYI. I have noticed that if i have the iAqualink client running in my browser as well as this component in HA I will get occasional disconnects. When i made sure that the browser version was closed (no other connections to iAqualink), i would not get the occasional disconnects.

1 Like

That’s a good point actually… Thanks @chasut!

When you reach out, I would like to know if they have a local api. That could simplify this and help maintain control when we lose connection.

1 Like

I was getting a disconnect at least once a day. I reconfigured one of routers to make it a roaming network and problem solved. Haven’t had a disconnect in days.

Agree on the local API to device vs. cloud. I’m still getting sporadic disconnects once a week or so, and even went so far as to hard-wire the iaqualink unit into the network. I don’t have an IP reserved for it but considering it. Also considering putting a switch in between the the router and that swtich on a zwave outlet and power down the zwave outlet for a minute and then power it back up to essentially reset the jandy connection. Super kludgy, but still keep getting these disconnects… :shrug:

I haven’t gotten a response to my Twitter reachout. I highly doubt they would support a local API but if you don’t ask, you don’t get…

I did exactly this with a Zwave outlet module when I was having issues. My aqualink is hardwired as well. Turn off the zwave module for a few seconds and then back on cycles my router. My issues were solved with correcting my network though. I haven’t had a disconnect in quite some time.

flauran - thanks for the great work here and after using for the last few months I had to replace my SD card and in doing so ended up with a fresh install that’s running version 0.95 and getting the following errors with the integration not loading:

2019-06-26 21:22:29 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for aqualink which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2019-06-26 21:22:33 ERROR (MainThread) [homeassistant.config_entries] Config flow is not supported for custom integration aqualink
2019-06-26 21:22:42 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 64, in async_init
    handler, context=context, data=data)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 562, in _async_create_flow
    raise data_entry_flow.UnknownHandler
homeassistant.data_entry_flow.UnknownHandler

Any thoughts or suggestions? Happy to help test if helpful. Thanks

flauran - Would it be possible to add sensors to show the Watts and RPMs that the filter is running? Much like the AquaLink webview shows under Status.
Thank you and great work!

2 Likes