Skip to main content

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.

PyPi

Ayla References

This device is integrated by/with Ayla Networks and (generally) uses their documentation.

These can be used as starting references:

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 a username and password (typically a smart device's app login credentials) 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()

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ayla_iot_unofficial-1.4.2.tar.gz (19.9 kB view details)

Uploaded Source

Built Distribution

ayla_iot_unofficial-1.4.2-py3-none-any.whl (20.2 kB view details)

Uploaded Python 3

File details

Details for the file ayla_iot_unofficial-1.4.2.tar.gz.

File metadata

  • Download URL: ayla_iot_unofficial-1.4.2.tar.gz
  • Upload date:
  • Size: 19.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for ayla_iot_unofficial-1.4.2.tar.gz
Algorithm Hash digest
SHA256 dca19cd3b7e7b2083f1cddb5ad364416c8f1c427203a7e14c991d725dcde4361
MD5 2867cab20182ec45ea89f443e92d8996
BLAKE2b-256 4052c62888e0c8379af64204b09336d255c2242cd03e480c69d57ac2a677872b

See more details on using hashes here.

File details

Details for the file ayla_iot_unofficial-1.4.2-py3-none-any.whl.

File metadata

File hashes

Hashes for ayla_iot_unofficial-1.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f5da6d2fd03400f7df84e33f06201bd33d172b0f1cb69665a98831218346db27
MD5 42483eea530596aaf036c6a1f2337351
BLAKE2b-256 65f09059f5752dc19ef26e042166b58092c69c6f01029fa24bd0f7f4d322841a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page