Python API for Ayla IoT products
Project description
ayla-iot-unofficial
An unofficial python library for interacting with the Ayla IoT API. Intended to be generic for multi-device use.
Designed primarily to be a support package for Home Assistant integrations.
This library is heavily based off of sharkiq by @JeffResc.
Ayla References
This device is integrated by/with Ayla Networks and (generally) uses their documentation.
These can be used as starting references:
- https://developer.aylanetworks.com/apibrowser
- https://docs.aylanetworks.com/reference/getting_started
- https://connection.aylanetworks.com/s/article/2080270
Installation
From PyPi
pip install ayla-iot-unofficial
Build from source
pip install build
pip build
pip install ayla-iot-unofficial
Library Requirements
Requires typical http interaction and datatype packages like requests, aiohttp, ujson
User Requirements
Reqiures either a username and password (typically a smart device's app login credentials) or a token (retrieved from device manufacturer's login flow) Requires an app_id and app_secret (granted by Ayla to the smart device's app for operation/integration)
The app_id and app_secret may need to be obtained from proxy traffic or other method.
Usage
Class Object
Instantiate a new class object through new_ayla_api() or Ayla() directly.
For devices that may be region specific, the new_ayla_api() function will create an Ayla() object based on the europe boolean.
Ayla Access_Token
Standard use should call sign_in() on the Ayla object after creation. This will perform the POST login request to obtain an access_token.
Some devices communicate with a different IoT domain but still expose the Ayla access_token. This access token can be passed into the Ayla object using _set_credentials() and the proper arguments.
Devices
By default, calling get_devices() will return a list of class specific device objects with updated properties for use.
See device.py for implemented device classes.
Typical Operation
python3 -m pip install ayla-iot-unofficial
import ayla_iot_unofficial
USERNAME = 'me@email.com'
PASSWORD = '$7r0nkP@s$w0rD'
ayla_api = new_ayla_api(USERNAME, PASSWORD, APP_ID, APP_SECRET)
ayla_api.sign_in()
devices = ayla_api.get_devices()
# Example Vacuum Devices
shark = devices[0]
shark.set_operating_mode(OperatingModes.START)
shark.return_to_base()
# Example Water Softener Devices
softener = devices[1]
softener.capacity_remaining_gallons
softener.set_vacation_mode()
Login via token
Some devices like the De'Longhi DDSX Dehumidifier are accessed by logging into the manufacturer's app which then generates an SSO token for logging into Ayla Networks.
SSO_TOKEN = 'st2...'
ayla_api = new_ayla_api_sso(SSO_TOKEN, APP_ID, APP_SECRET)
ayla_api.sign_in()
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ayla_iot_unofficial-1.5.0.tar.gz.
File metadata
- Download URL: ayla_iot_unofficial-1.5.0.tar.gz
- Upload date:
- Size: 20.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
541b1bfaf469b27ea6720becb60796652f4ae872986c3cb5f75764d3e61d088f
|
|
| MD5 |
4a54c2b21c46f8efb9c7f3013d16a05d
|
|
| BLAKE2b-256 |
829798d0f56e116229cc97a1e449e3bf0f1bc1cf22a063136a7cf8382c43d79e
|
Provenance
The following attestation bundles were made for ayla_iot_unofficial-1.5.0.tar.gz:
Publisher:
pypi.yml on rewardone/ayla-iot-unofficial
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ayla_iot_unofficial-1.5.0.tar.gz -
Subject digest:
541b1bfaf469b27ea6720becb60796652f4ae872986c3cb5f75764d3e61d088f - Sigstore transparency entry: 198984273
- Sigstore integration time:
-
Permalink:
rewardone/ayla-iot-unofficial@ca96a14d2bf6e009e1d0378b41258ee72d31838c -
Branch / Tag:
refs/heads/main - Owner: https://github.com/rewardone
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@ca96a14d2bf6e009e1d0378b41258ee72d31838c -
Trigger Event:
push
-
Statement type:
File details
Details for the file ayla_iot_unofficial-1.5.0-py3-none-any.whl.
File metadata
- Download URL: ayla_iot_unofficial-1.5.0-py3-none-any.whl
- Upload date:
- Size: 20.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f8e9f169161d71db4a8e482307c49fec84dc2b8473b3439c8a45f55c2c12c96
|
|
| MD5 |
52821ca5e0b470b0261abfaf386abcab
|
|
| BLAKE2b-256 |
1aa520cea5b0715fa4a68708e4dfd64c2a32f5fe8ddf0610f311f75311230006
|
Provenance
The following attestation bundles were made for ayla_iot_unofficial-1.5.0-py3-none-any.whl:
Publisher:
pypi.yml on rewardone/ayla-iot-unofficial
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ayla_iot_unofficial-1.5.0-py3-none-any.whl -
Subject digest:
2f8e9f169161d71db4a8e482307c49fec84dc2b8473b3439c8a45f55c2c12c96 - Sigstore transparency entry: 198984275
- Sigstore integration time:
-
Permalink:
rewardone/ayla-iot-unofficial@ca96a14d2bf6e009e1d0378b41258ee72d31838c -
Branch / Tag:
refs/heads/main - Owner: https://github.com/rewardone
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@ca96a14d2bf6e009e1d0378b41258ee72d31838c -
Trigger Event:
push
-
Statement type: