Check out our onboarding guide to learn how to onboard users. The rest of this quick start guide will walkthrough how to use the API once you have onboarded users.

The onboarding flow should provide a homeId for each user. However, we also expose endpoints to list out all homes.

// Fetch all homes.
const homes = await wattshiftApiCall("/homes/list");
const home = homes[0];

It is recommended to store the homeId against the user during the onboarding flow.

Querying Devices

We can list out all the devices for a given home.

// Fetch devices for the home.
const devices = await wattshiftApiCall(`/homes/${home.id}/devices/hvac/list`);
const hvac = devices[0];