Skip to main content

A Python client library for A. O. Smith water heaters

Project description

py-aosmith

This is an API Client for A. O. Smith iCOMM-enabled water heaters. If you can control your water heater using the A. O. Smith mobile app (iOS/Android), then it should be compatible with this library.

Known Compatible Models

If your water heater is not working with this library, but it can be controlled using the A. O. Smith mobile app, please open an issue so that support can be added.

Similarly, if your water heater is working with this library, but is not listed here, please open an issue so it can be added to the list.

Installation

To install the latest release from PyPI, run pip3 install py-aosmith.

Quick Start

You will need a compatible water heater which is already connected to Wi-Fi and linked to your A. O. Smith account.

This example initializes the API client and gets a list of water heaters linked to the account. Then, for each water heater, it updates the setpoint to 120 degrees.

from py_aosmith import AOSmithAPIClient

# Initialize API client
client = AOSmithAPIClient("myemail@example.com", "mypassword")

# Get list of water heaters linked to the account
devices = await client.get_devices()

# Loop through the registered water heaters
for device in devices:
    # Update the setpoint to 120 degrees
    await client.update_setpoint(device.get("junctionId"), 120);

API Documentation

Initialize API Client

AOSmithAPIClient(email, password)

Parameters

Parameter Description
email The email address for your A. O. Smith account
password The password for your A. O. Smith account

Return value

Returns an instance of AOSmithAPIClient which can be used to invoke the below methods.

Get List of Devices

await client.get_devices()

Gets a list of water heaters linked with the A. O. Smith account. May only include devices which are known to be compatible with this library.

If your water heater can be controlled in the A. O. Smith mobile app, but is not included in the return value of this method, please open an issue so that support can be added.

Parameters

None

Return value

[
    {
        "brand": "aosmith",
        "model": "HPTS-50 200 202172000",
        "deviceType": "NEXT_GEN_HEAT_PUMP",
        "dsn": "xxxxxxxxxxxxxxx",
        "junctionId": "xxxxxxxxxxxxxxxxxx", // Unique ID needed to call the other API methods
        "name": "Water Heater", // Custom nickname assigned in the mobile app
        "serial": "xxxxxxxxxxxxx",
        "install": {
            "location": "Basement" // Install location set in the mobile app
        },
        "data": {
            "__typename": "NextGenHeatPump",
            "temperatureSetpoint": 130, // Current setpoint (target water temperature)
            "temperatureSetpointPending": false,
            "temperatureSetpointPrevious": 130,
            "temperatureSetpointMaximum": 130, // Max possible setpoint - to increase this, manually adjust the setpoint using the buttons on the water heater
            "modes": [ // Available operation modes
                {
                    "mode": "HYBRID",
                    "controls": null
                },
                {
                    "mode": "HEAT_PUMP",
                    "controls": null
                },
                {
                    "mode": "ELECTRIC",
                    "controls": "SELECT_DAYS"
                },
                {
                    "mode": "VACATION",
                    "controls": "SELECT_DAYS"
                }
            ],
            "isOnline": true,
            "firmwareVersion": "2.14",
            "hotWaterStatus": "LOW", // Current hot water availability ("LOW", "MEDIUM", or "HIGH")
            "mode": "HEAT_PUMP", // Current operation mode
            "modePending": false,
            "vacationModeRemainingDays": 0,
            "electricModeRemainingDays": 0
        }
    }
]

Update setpoint

await client.update_setpoint(junction_id, setpoint)

Updates the setpoint (target water temperature) of the water heater.

When using this method, the setpoint cannot be adjusted above the temperatureSetpointMaximum from the return value of get_devices(). To increase this maximum, manually adjust the setpoint using the buttons on the water heater.

Parameters

Parameter Description
junction_id Unique ID of the water heater, obtained from get_devices()
setpoint New target temperature to set

Return value

None

Update mode

await client.updateMode(junction_id, mode, days)

Sets the operation mode of the water heater. To determine the list of modes supported by your water heater, check data.modes[] in the return value of get_devices().

Parameters

Parameter Description
junction_id Unique ID of the water heater, obtained from get_devices()
mode New operation mode to set
days Optional. Number of days after which the device will automatically exit this mode. Only works for modes where data.modes[].controls from get_devices() is "SELECT_DAYS".

Return value

None

Get energy use data

await client.get_energy_use_data(junction_id)

Gets energy use history data from the water heater.

Parameters

Parameter Description
junction_id Unique ID of the water heater, obtained from get_devices()

Return value

{
    "average": 2.7552000000000003,
    "graphData": [
        {
            "date": "2023-10-30T04:00:00.000Z",
            "kwh": 2.01
        },
        {
            "date": "2023-10-31T04:00:00.000Z",
            "kwh": 1.542
        },
        {
            "date": "2023-11-01T04:00:00.000Z",
            "kwh": 1.908
        },
        /* ... */
    ],
    "lifetimeKwh": 132.825,
    "startDate": "Oct 30"
}

Disclaimer

This project is not affiliated with or endorsed by A. O. Smith. This is not an official API, and it may stop working at any time without warning.

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

py_aosmith-1.0.1.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

py_aosmith-1.0.1-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file py_aosmith-1.0.1.tar.gz.

File metadata

  • Download URL: py_aosmith-1.0.1.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.12 Linux/5.15.0-89-generic

File hashes

Hashes for py_aosmith-1.0.1.tar.gz
Algorithm Hash digest
SHA256 c571ccb39b95cfd843d23ec0a4f53da3c0ca730185617169becaaa641d850f76
MD5 489059de1c59b80d4ef0bd5f80caab8b
BLAKE2b-256 59e827d9fd3518671b5967c60699c5dff998d0227b38d23452ce5d917833813d

See more details on using hashes here.

File details

Details for the file py_aosmith-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: py_aosmith-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.12 Linux/5.15.0-89-generic

File hashes

Hashes for py_aosmith-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7008de1fc7ab055e263c3199549162fe5dbfa46b00b76ca7348413d079baa044
MD5 3b9f506389631a1f9ae6130c7d26eebf
BLAKE2b-256 be555c93a7a017b8b85ccaed83f792c7ad8250cf60a8854af72ca305e7c956f1

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