npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-aosmith

v1.0.1

Published

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](https://apps.apple.com/us/app/a-o-smith/id456489822)/[Android](https://play.google.com/store/apps/details?id=co

Downloads

4

Readme

node-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 npm, run npm install node-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.

import { AOSmithAPIClient } from "./client.js";

// Initialize API client
const client = new AOSmithAPIClient("[email protected]", "mypassword");

// Get list of water heaters linked to the account
const devices = await client.getDevices();

// Loop through the registered water heaters
for (const device of devices) {
    // Update the setpoint to 120 degrees
    await client.updateSetpoint(device.junctionId, 120);
}

API Documentation

Initialize API Client

new 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.getDevices()

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.updateSetpoint(junctionId, 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 getDevices(). To increase this maximum, manually adjust the setpoint using the buttons on the water heater.

Parameters

| Parameter | Description | | --------- | ----------- | | junctionId | Unique ID of the water heater, obtained from getDevices() | | setpoint | New target temperature to set |

Return value

None

Update mode

await client.updateMode(junctionId, 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 getDevices().

Parameters

| Parameter | Description | | --------- | ----------- | | junctionId | Unique ID of the water heater, obtained from getDevices() | | 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 getDevices() is "SELECT_DAYS".

Return value

None

Get energy use data by DSN

await client.getEnergyUseData(junctionId)

Gets energy use history data from the water heater.

Parameters

| Parameter | Description | | --------- | ----------- | | junctionId | Unique ID of the water heater, obtained from getDevices() |

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.