flz / iaqualink-py Goto Github PK
View Code? Open in Web Editor NEWAsynchronous library for Jandy iAqualink
License: BSD 3-Clause "New" or "Revised" License
Asynchronous library for Jandy iAqualink
License: BSD 3-Clause "New" or "Revised" License
Please consider supporting One Touches and Color lights, I have the EISY/ISY/IoX/PG3x version of an iaqualink and it was updated to support One Touches and Color lights recently. I can assist with testing if needed.
Example logic call and results
pi@raspberrypi:~ $ cat aqua.py
#!/usr/bin/python
import iaqualink
from iaqualink.client import AqualinkClient
import asyncio
async def main():
async with AqualinkClient('[email protected]', 'password') as c:
print(c)
s = await c.get_systems()
print(s)
d = await list(s.values())[0].get_devices()
print(d)
if name=="main":
asyncio.run(main())
pi@raspberrypi:~ $ python aqua.py
<iaqualink.client.AqualinkClient object at 0xb5cfb370>
i2d is not a supported system type.
{}
Traceback (most recent call last):
File "/home/pi/aqua.py", line 16, in
asyncio.run(main())
File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
return future.result()
File "/home/pi/aqua.py", line 12, in main
d = await list(s.values())[0].get_devices()
IndexError: list index out of range
๐ Hi, can you explain me why the tcx
device type isn't supported?
homeassistant | 2023-10-02 11:50:04.244 DEBUG (MainThread) [iaqualink] <- 200 OK - https://r-api.iaqualink.net/devices.json?api_key=....&authentication_token=....&user_id=...
homeassistant | 2023-10-02 11:50:04.244 WARNING (MainThread) [iaqualink] tcx is not a supported system type.
Hi,
for me all devices are showing as offline. They even show as offline on iaqualink.zodiacpoolsystems.com
, so probably not an issue with this library.
I can however see all of them as online in the iOS app, so maybe there was another API change? Or is it just me?
It seems like the wheel for v0.4.1
was overwritten yesterday with the contents of v0.5.0
. For Home Assistant this will break any new installs by users since we've pinned v0.4.1
currently and haven't been able to update yet. Would it be possible to upload the wheel for v0.4.1
again so it's fixed?
https://pypi.org/project/iaqualink/0.4.1/#files
/CC: @flz
Just curious is you have a HA component that works with this. Thanks!
Using the library from the iaqualink integration in Home-Assistant, I am getting a HTTP 500 returned.
Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/homeassistant/components/websocket_api/commands.py", line 200, in handle_call_service
await hass.services.async_call(
File "/usr/local/lib/python3.9/dist-packages/homeassistant/core.py", line 1738, in async_call
task.result()
File "/usr/local/lib/python3.9/dist-packages/homeassistant/core.py", line 1775, in _execute_service
await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
File "/usr/local/lib/python3.9/dist-packages/homeassistant/helpers/entity_component.py", line 204, in handle_service
await service.entity_service_call(
File "/usr/local/lib/python3.9/dist-packages/homeassistant/helpers/service.py", line 676, in entity_service_call
future.result() # pop exception if have
File "/usr/local/lib/python3.9/dist-packages/homeassistant/helpers/entity.py", line 931, in async_request_call
await coro
File "/usr/local/lib/python3.9/dist-packages/homeassistant/helpers/service.py", line 713, in _handle_entity_call
await result
File "/opt/homeassistant/custom_components/iaqualink/__init__.py", line 190, in wrapper
await func(self, *args, **kwargs)
File "/opt/homeassistant/custom_components/iaqualink/switch.py", line 50, in async_turn_on
await self.dev.turn_on()
File "/opt/homeassistant/deps/lib/python3.9/site-packages/iaqualink/device.py", line 318, in turn_on
await self.system.set_production(1)
File "/opt/homeassistant/deps/lib/python3.9/site-packages/iaqualink/system.py", line 276, in set_production
r = await self.aqualink.send_shadow_desired(self.serial, {"equipment": {"swc_0": {"production": state}}})
File "/opt/homeassistant/deps/lib/python3.9/site-packages/iaqualink/client.py", line 227, in send_shadow_desired
r = await self._send_aws_request(
File "/opt/homeassistant/deps/lib/python3.9/site-packages/iaqualink/client.py", line 212, in _send_aws_request
return await self._send_request(url, headers={"authorization":self._IdToken}, **kwargs)
File "/opt/homeassistant/deps/lib/python3.9/site-packages/iaqualink/client.py", line 123, in _send_request
raise AqualinkServiceException(m)
iaqualink.exception.AqualinkServiceException: Unexpected response: 500 Internal Server Error
I am not the only one, at least one other - refer to https://community.home-assistant.io/t/jandy-iaqualink-pool-integration/105633/358?u=whytey
iaqualink-py/src/iaqualink/client.py
Line 93 in 01419eb
We recently discovered httpx does not perform well without passing in an ssl context (home-assistant/core#89932)
see encode/httpx#2609 encode/httpx#838 (comment)
The shared helper will be updated for this issue as well so it can be used and passed the library
from homeassistant.helpers.httpx_client import get_async_client
to get the shared client
from homeassistant.helpers.httpx_client import create_async_httpx_client
to create a new one (if you need to recreate or need you own)
Thanks for the cool package. I've using it for a couple of years with a python script. It recently stopped working. I'm getting this error.
C:\Program Files\Python38\lib\site-packages\iaqualink\client.py", line 110, in login
raise AqualinkLoginException(f"Login failed: {r.status} {r.reason}")
iaqualink.client.AqualinkLoginException: Login failed: 403 Forbidden
My login credentials work still work fine on the website.
I'm currently using iaqualink==0.2.9 but I tried upgrading the most recent version and I still got the same error.
Any ideas?
Hi,
I am trying to login to my iAqualink through HomeAssistant and the console and somehow, I can't properly authenticate.
I am able to login just fine at https://support.iaqualink.com/users/sign_in
but when I load https://support.iaqualink.com/devices.json
, I get:
{"status":"401","error":{"error_code":"error_auth_required","message":"Authorization Required","details":"Please provide proper authentication details."}}
I am able to use the mobile app from my phone and I see my pool just fine at https://iaqualink.zodiacpoolsystems.com
.
Is there anything in particular I need to make the support.iqualink.com
host behave?
Thanks
It would be very helpful if you could tag releases as well. This would enable distributions to use the GitHub release to build their packages.
Thanks
It looks like there is an issue with the 0.4.X release of iaqualink. Looking at the module contents, it looks like it's empty. The module was installed via pip/python3.9
Version 0.4.1, sane thing for 0.4.0
Python 3.9.10 (main, Feb 4 2022, 08:57:12)
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
import iaqualink as a
dir(a)
['author', 'builtins', 'cached', 'doc', 'email', 'file', 'loader', 'name', 'package', 'path', 'spec', 'version', 'annotations']
a.version
'0.4.1'
Version 0.3.90, which is working.
import iaqualink as a
dir(a)
['AqualinkAuxToggle', 'AqualinkBinarySensor', 'AqualinkClient', 'AqualinkColorLight', 'AqualinkDevice', 'AqualinkDimmableLight', 'AqualinkHeater', 'AqualinkLight', 'AqualinkLightEffect', 'AqualinkLightToggle', 'AqualinkLightType', 'AqualinkLoginException', 'AqualinkPoolSystem', 'AqualinkPump', 'AqualinkSensor', 'AqualinkState', 'AqualinkSystem', 'AqualinkThermostat', 'AqualinkToggle', 'author', 'builtins', 'cached', 'doc', 'email', 'file', 'loader', 'name', 'package', 'path', 'spec', 'version', 'annotations', 'client', 'const', 'device', 'exception', 'system', 'typing']
a.version
'0.3.90'
The previous release was 0.4.0. Yesterday 0.3.90 was released.
It looks like that both branches (master
and 0.3.x
) contains the API endpoint URLs. Could you please release 0.4.1 if the update URLs are needed for 0.4.x too? Otherwise it would require that distributions patch their packages till 0.4.1 is released.
Thanks
Because of the definition of the with
statement (https://docs.python.org/3/reference/compound_stmts.html#the-with-statement) if the login throws an AqualinkLoginException then the __aexit__
routine never gets called and so the session never gets cleaned up.
Would he awesome to support Jandy integrated pool vacuums, at the very least I would love to stop / start and see time to completion... Is the Jandy api documented anywhere?
Hello, I hope I'm putting this in the correct location. The Jandy IQPUMP01 shows up in the Iaqualink app but not on the integration. Here is a log output:
_Logger: homeassistant.components.iaqualink
Source: components/iaqualink/init.py:98
Integration: Jandy iAqualink (documentation, issues)
First occurred: 12:28:20 AM (8 occurrences)
Last logged: 1:28:00 PM
No systems detected or supported_
Would appreciate any help. Thanks.
๐
Do you know if this issue is on the iqualink-py lib or on the Home Assistant intgreation?
2023.9.1
0.5.0
2023-09-15 12:37:37.920 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry [email protected] for iaqualink
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/anyio/streams/tls.py", line 131, in _call_sslobject_method
result = func(*args)
^^^^^^^^^^^
File "/usr/local/lib/python3.11/ssl.py", line 921, in read
v = self._sslobj.read(len)
^^^^^^^^^^^^^^^^^^^^^^
ssl.SSLWantReadError: The operation did not complete (read) (_ssl.c:2580)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/httpcore/_backends/anyio.py", line 34, in read
return await self._stream.receive(max_bytes=max_bytes)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/anyio/streams/tls.py", line 196, in receive
data = await self._call_sslobject_method(self._ssl_object.read, max_bytes)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/anyio/streams/tls.py", line 138, in _call_sslobject_method
data = await self.transport_stream.receive()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 1203, in receive
await self._protocol.read_event.wait()
File "/usr/local/lib/python3.11/asyncio/locks.py", line 213, in wait
await fut
asyncio.exceptions.CancelledError
During handling of the above exception, another exception occurred:
Is there any API access to the AquaPure? It is available in the iAqualink WebUI (if you click on the "status" icon). I haven't seen any official API documentation; the Android App only has access to it "via the webUI".
It would be really nice to be able to see pool salt level as a sensor and be able to control the Pool and Spa generation, but I suspect the only way to do that is via the webUI?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.