TadoX class provides functions to interact with the TadoX API, including user authentication and various home and device management operations.

// Import the TadoX client
const { TadoX } = require("node-tado-client");

// Create a new TadoX instance
var tado = new TadoX();

// Set a cllabck to catch token changes
tado.setTokenCallback(console.log);

// Authenticate with the Tado API
const [verify, futureToken] = await tado.authenticate("refresh_token");

if (verify) {
console.log("------------------------------------------------");
console.log("Device authentication required.");
console.log("Please visit the following website in a browser.");
console.log("");
console.log(` ${verify.verification_uri_complete}`);
console.log("");
console.log(
`Checks will occur every ${verify.interval}s up to a maximum of ${verify.expires_in}s`,
);
console.log("------------------------------------------------");
}
await futureToken;

const me = await tado.getMe();
console.log(me);

Hierarchy

  • BaseTado
    • TadoX

Constructors

Accessors

  • get token(): undefined | Token

    Get the latest Oauth Token and Refresh Token

    Returns undefined | Token

    The latest token

Methods

  • Adds an energy IQ meter reading for a given home.

    Parameters

    • home_id: number

      The ID of the home.

    • date: string

      The date of the meter reading in ISO format.

    • reading: number

      The meter reading value.

    Returns Promise<AddEnergiIQMeterReadingResponse>

    A promise that resolves to the response of the API call.

  • Adds a new energy IQ tariff for a specified home.

    Parameters

    • home_id: number

      The identifier of the home.

    • unit: IQUnit

      The unit of energy measurement.

    • startDate: string

      The start date of the tariff in ISO format.

    • endDate: string

      The end date of the tariff in ISO format.

    • tariffInCents: number

      The tariff amount in cents.

    Returns Promise<void>

    A promise that resolves to the API response.

    TadoError if the unit is not valid.

  • Makes an API call to the provided URL with the specified method and data.

    Type Parameters

    • R

      The type of the response

    • T = unknown

      The type of the request body

    Parameters

    • url: string

      The endpoint to which the request is sent. If the URL contains "https", it will be used as is.

    • method: Method = "get"

      The HTTP method to use for the request (e.g., "get", "post").

    • Optionaldata: T

      The payload to send with the request, if applicable.

    Returns Promise<R>

    A promise that resolves to the response data.

  • Makes an API call to the provided TadoX URL with the specified method and data.

    Type Parameters

    • R

      The type of the response

    • T = unknown

      The type of the request body

    Parameters

    • url: string

      The endpoint to which the request is sent. If the URL contains "https", it will be used as is.

    • method: Method = "get"

      The HTTP method to use for the request (e.g., "get", "post").

    • Optionaldata: T

      The payload to send with the request, if applicable.

    Returns Promise<R>

    A promise that resolves to the response data.

  • Authenticate with the Oauth server. A refresh token may be supplied to bypass the device auth flow if it is still valid, otherwise the device flow is initiaited.

    Parameters

    • OptionalrefreshToken: string

      Attempt to use this refresh token to re-authenticate

    • Optionaltimeout: number

      Ignore the Tado provided timeout for device auth and use this value

    Returns Promise<[undefined | DeviceVerification, Promise<Token>]>

    A promise that resolves to either a DeviceVerification object for device auth flows and a promise of a token, or an undefined auth flow and a promise of a token, if the refresh token was supplied

  • Creates an invitation for a specified home.

    Parameters

    • home_id: number

      The unique identifier of the home to which the invitation will be sent.

    • email: string

      The email address of the invitee.

    Returns Promise<Invitation>

    A promise that resolves to an Invitation object.

  • Creates a push notification registration for a given home and mobile device.

    Note: Do not use this unless you know what you are doing, you might want to consider registering a dummy device.

    Parameters

    • home_id: number

      The identifier for the home.

    • mobile_device_id: number

      The identifier for the mobile device.

    • token: string

      The push notification token for the device.

    Returns Promise<PushNotificationRegistration>

    A promise that resolves to the push notification registration (AWS SNS Endpoint ARN).

  • Deletes a specific energy meter reading for a given home.

    Parameters

    • home_id: number

      The unique identifier of the home.

    • reading_id: number

      The unique identifier of the meter reading to be deleted.

    Returns Promise<void>

    A promise that resolves when the meter reading has been successfully deleted.

  • Deletes an invitation associated with a home.

    Parameters

    • home_id: number

      The unique identifier of the home.

    • token: string

      The token associated with the invitation.

    Returns Promise<void>

    A promise that resolves when the invitation is successfully deleted.

  • Disable Flow Temperature Optimization settings.

    Parameters

    • home_id: number

      The unique identifier of the home.

    Returns Promise<string>

    if changed.

  • Enable Flow Temperature Optimization settings.

    Parameters

    • home_id: number

      The unique identifier of the home.

    Returns Promise<string>

    if changed.

  • Retrieve actionable devices.

    Parameters

    • home_id: number

      The ID of the home for which to fetch the zones.

    Returns Promise<ActionableDevice[]>

    A promise that resolves to a list of actionable devices.

  • Retrieves the air comfort details for a given home.

    Parameters

    • home_id: number

      The ID of the home for which to get the air comfort details.

    Returns Promise<AirComfort>

    A promise that resolves to an AirComfort object containing the air comfort details.

  • Fetches detailed air comfort information for a specific home.

    Parameters

    • home_id: number

      The unique identifier of the home.

    Returns Promise<AirComfortDetailed>

    A promise that resolves to detailed air comfort data.

  • Retrieves the away configuration for a specific home and zone.

    Parameters

    • home_id: number

      The unique identifier of the home.

    • room_id: number

      The unique identifier of the zone within the home.

    Returns Promise<XRoomAwayConfiguration>

    A promise that resolves to the away configuration object.

  • Retrieves information about the specified boiler system. This includes model name, image used by the app, and manufacturer names.

    Parameters

    Returns Promise<BoilerSystemInformation>

    A promise that resolves to an object containing the boiler system information.

    const heatingSystem = await tado.getHomeHeatingSystem(1907);
    const boilerInformation = await tado.getBoilerSystemInformation(heatingSystem.boiler.id);
    console.log(
    `Your boiler model is ${boilerInformation.modelName} manufactured by ${boilerInformation.manufacturers[0].name}`,
    );
  • Retrieves energy consumption details for a specified home, month, and year.

    Parameters

    • home_id: number

      The unique identifier of the home.

    • month: number

      The specific month for which the consumption details are requested.

    • year: number

      The specific year for which the consumption details are requested.

    Returns Promise<EnergyIQConsumptionDetails>

    A promise resolving to the energy consumption details for the specified time period.

  • Fetches the Energy IQ meter readings for a specified home.

    Parameters

    • home_id: number

      The unique identifier of the home for which the meter readings are to be retrieved.

    Returns Promise<EnergyIQMeterReadings>

    A promise that resolves to the Energy IQ meter readings for the specified home.

  • Fetches the energy consumption overview for a specified home, month, and year.

    Parameters

    • home_id: number

      The unique identifier of the home.

    • month: number

      The month for which the energy overview is needed.

    • year: number

      The year for which the energy overview is needed.

    Returns Promise<EnergyIQOverview>

    A promise that resolves to an EnergyIQOverview object containing the energy consumption details.

  • Fetches the EnergyIQ tariff for a given home.

    Parameters

    • home_id: number

      The unique identifier of the home.

    Returns Promise<EnergyIQTariffs>

    A promise that resolves to the EnergyIQTariffs object.

  • Fetches the energy savings report for a specific home and time period.

    Parameters

    • home_id: number

      The unique identifier of the home.

    • year: number

      The year for the report.

    • month: number

      The month for the report.

    • countryCode: string

      The country code of the home.

    Returns Promise<EnergySavingReport>

    A promise that resolves to the energy savings report.

    const today = new Date();
    const countryCode = await tado.getHome(home_id).address.country;
    const report = await this tado.getEnergySavingsReport(home_id, today.getFullYear(), today.getMonth() + 1)
  • Fetches the features supported by the home.

    Parameters

    • home_id: number

      The ID of the home for which to fetch the zones.

    Returns Promise<XFeatures>

    A promise that resolves to a list of features.

  • Retrieves the heating circuits associated with a given home based on the home ID.

    Parameters

    • home_id: number

      The ID of the home for which to retrieve heating circuits.

    Returns Promise<HeatingCircuit>

    A promise that resolves to a HeatingCircuit object.

  • Fetches and returns the home details for the specified home ID.

    Parameters

    • home_id: number

      The ID of the home to be retrieved.

    Returns Promise<Home>

    A promise that resolves to the details of the home.

  • Retrieves the heating system information for a specific home.

    Parameters

    • home_id: number

      The unique identifier of the home.

    Returns Promise<HeatingSystem>

    A promise that resolves to the heating system information of the specified home.

  • Fetches a subset of the home info.

    Parameters

    • home_id: number

      The ID of the home for which to fetch the zones.

    Returns Promise<XHomeSummary>

    A promise that resolves to home summary data.

  • Fetches incident detection details for the specified home.

    Parameters

    • home_id: number

      The unique identifier of the home.

    Returns Promise<HomeIncidentDetection>

    A promise that resolves to the incident detection details of the home.

  • Fetches the list of installations for a given home.

    Parameters

    • home_id: number

      The ID of the home for which to fetch installations.

    Returns Promise<Installation[]>

    A promise that resolves to an array of installations.

  • Retrieves an invitation based on the provided home ID and token.

    Parameters

    • home_id: number

      The ID of the home for which the invitation is to be retrieved.

    • token: string

      The unique token (invitation id) associated with the invitation.

    Returns Promise<Invitation>

    A promise that resolves to the invitation details.

  • Fetches the list of invitations for a specified home.

    Parameters

    • home_id: number

      The ID of the home for which to retrieve invitations.

    Returns Promise<Invitation[]>

    A promise that resolves to an array of Invitation objects.

  • Fetches the current user data.

    Returns Promise<Me>

    A promise that resolves to the user data.

  • Fetches a mobile device associated with the given home ID and mobile device ID.

    Parameters

    • home_id: number

      The ID of the home.

    • mobile_device_id: number

      The ID of the mobile device.

    Returns Promise<MobileDevice>

    A promise that resolves to the mobile device data.

  • Fetches the geo-location configuration for a specific mobile device in a home.

    Parameters

    • home_id: number

      The unique identifier of the home.

    • mobile_device_id: number

      The unique identifier of the mobile device.

    Returns Promise<MobileDeviceGeoLocationConfig>

    A promise that resolves to the mobile device's geo-location configuration.

  • Retrieves a list of mobile devices associated with a given home ID.

    Parameters

    • home_id: number

      The unique identifier of the home.

    Returns Promise<MobileDevice[]>

    A promise that resolves to an array of MobileDevice objects.

  • Fetches the settings for a specific mobile device within a given home.

    Parameters

    • home_id: number

      The unique identifier of the home.

    • mobile_device_id: number

      The unique identifier of the mobile device.

    Returns Promise<MobileDeviceSettings>

    A promise that resolves to the mobile device's settings.

  • Fetches the rooms for a given home.

    Parameters

    • home_id: number

      The ID of the home for which to fetch the zones.

    Returns Promise<XRoom[]>

    A promise that resolves to a list of room states.

  • Retrieves a list of rooms and devices associated with the given home ID.

    Parameters

    • home_id: number

      The unique identifier of the home.

    Returns Promise<XRoomsAndDevices[]>

    A promise that resolves to an object containing rooms and devices.

  • Fetches the state of a specified room in a home.

    Parameters

    • home_id: number

      The ID of the home.

    • room_id: number

      The ID of the room within the home.

    Returns Promise<XRoom>

    A promise that resolves to a room's state.

  • Retrieves the running times for a specific home within a given date range.

    Parameters

    • home_id: number

      The unique identifier for the home.

    • from: string

      The start date of the range in ISO 8601 format.

    • to: string

      The end date of the range in ISO 8601 format.

    • aggregate: RunningTimeAggregation

      The method of aggregation for the running times.

    • summary_only: true

      Indicates that only a summary of the running times is to be returned.

    Returns Promise<RunningTimesSummaryOnly>

    A promise that resolves to a summary of the running times.

  • Retrieves the running times of a specific home within a specified date range.

    Parameters

    • home_id: number

      The unique identifier of the home.

    • from: string

      The start date of the range in ISO 8601 format.

    • to: string

      The end date of the range in ISO 8601 format.

    • aggregate: RunningTimeAggregation

      The type of aggregation to apply to the running times.

    • summary_only: false

      If false, detailed running times are included; otherwise, only the summary is provided.

    Returns Promise<RunningTimes>

    A promise that resolves to the running times data for the specified home and date range.

  • Fetches the state of a home based on the provided home ID.

    Parameters

    • home_id: number

      The unique identifier of the home for which the state is to be retrieved.

    Returns Promise<State>

    A promise that resolves to the state of the specified home.

  • Fetches the list of users associated with a given home.

    Parameters

    • home_id: number

      The ID of the home for which to fetch users.

    Returns Promise<User[]>

    A promise that resolves to an array of User objects.

  • Fetches the weather information for a specified home.

    Parameters

    • home_id: number

      The unique identifier of the home for which to retrieve the weather data.

    Returns Promise<Weather>

    A promise that resolves to a Weather object containing the weather information for the specified home.

  • Checks if anyone is at home based on the geo-tracking data of mobile devices.

    Parameters

    • home_id: number

      The unique identifier of the home.

    Returns Promise<boolean>

    A promise that resolves to a boolean indicating if any tracked device is at home.

  • Check if home is hot water capable.

    Parameters

    • home_id: number

      The unique identifier of the home.

    Returns Promise<boolean>

    True if the home is hot water capable, false otherwise.

  • Checks if the early start feature is enabled for a given home.

    Parameters

    • home_id: number

      The unique identifier of the home.

    Returns Promise<boolean>

    A promise that resolves to a boolean indicating whether the early start feature is enabled.

  • Sets manual control for a specific room in a home.

    Parameters

    • home_id: number

      The identifier of the home.

    • room_id: number

      The identifier of the room within the home.

    • power: Power

      The power state, either 'ON' or 'OFF'.

    • termination: number | XTermination

      The termination condition for the overlay. Options include 'MANUAL', 'NEXT_TIME_BLOCK', or a number representing duration in seconds.

    • Optionaltemperature: number

      The desired temperature for the overlay, in celsius.

    Returns Promise<unknown>

    A promise that resolves to the created zone overlay.

  • Perform a predefined quick action on all rooms.

    Parameters

    • home_id: number

      The ID of the home.

    • action: XQuickAction

      The action to perform.

    Returns Promise<string>

    A promise that resolves on completion.

  • Resends an invitation to a specific home.

    Parameters

    • home_id: number

      The ID of the home for which the invitation is to be resent.

    • token: string

      The token representing the invitation to be resent.

    Returns Promise<void>

    A promise that resolves once the invitation has been resent.

  • Resumes the schedule for a specific room in a home.

    Parameters

    • home_id: number

      The unique identifier of the home.

    • room_id: number

      The unique identifier of the room within the home.

    Returns Promise<string>

    A promise that resolves when the operation is complete.

  • Sets the away configuration for a specified zone in the home.

    Parameters

    • home_id: number

      The unique identifier of the home.

    • room_id: number

      The unique identifier of the zone within the home.

    • config: Omit<XRoomAwayConfiguration, "roomId">

      The configuration settings for away mode.

    Returns Promise<XRoomAwayConfiguration>

    A promise that resolves when the configuration has been successfully set.

  • Sets the away radius for a specific home.

    Parameters

    • home_id: number

      The ID of the home.

    • away_radius_meters: number

      The away radius in meters.

    Returns Promise<void>

    A promise that resolves when the away radius is successfully set.

  • Set device child lock status.

    Parameters

    • home_id: number

      The ID of the home for which to fetch the zones.

    • serial_no: string

      The serial number of the device.

    • child_lock: boolean

      Boolean value to enable or disable the child lock.

    Returns Promise<void>

    A promise that resolves when the operation is complete.

  • Set device child lock status.

    Parameters

    • home_id: number

      The ID of the home for which to fetch the zones.

    • serial_no: string

      The serial number of the device.

    • temperatureOffset: number

      The temperature offset to be set, in degrees Celsius.

    Returns Promise<void>

    A promise that resolves when the operation is complete.

  • Sets the early start feature for a specified home.

    Parameters

    • home_id: number

      The unique identifier of the home.

    • enabled: boolean

      A boolean indicating whether the early start feature should be enabled or disabled.

    Returns Promise<void>

    A promise that resolves when the early start setting has been successfully updated.

  • Set the Flow Temperature Optimization max temperature.

    Parameters

    • home_id: number

      The unique identifier of the home.

    • temperature: number

      The max. temperature.

    Returns Promise<string>

    if changed.

  • Sets the geo-tracking settings for a specified mobile device in a given home.

    Parameters

    • home_id: number

      The ID of the home.

    • mobile_device_id: number

      The ID of the mobile device.

    • geoTrackingEnabled: boolean

      A flag indicating whether geo-tracking should be enabled.

    Returns Promise<MobileDeviceSettings>

    A promise that resolves to the updated mobile device settings.

  • Enables or disables incident detection for a specified home.

    Parameters

    • home_id: number

      The unique identifier of the home.

    • enabled: boolean

      Indicates whether incident detection should be enabled (true) or disabled (false).

    Returns Promise<void>

    A promise that resolves when the operation is complete.

  • Updates the presence status for a specified home.

    Parameters

    • home_id: number

      The unique identifier for the home.

    • presence: StatePresence

      The new presence state which must be "HOME", "AWAY", or "AUTO".

    Returns Promise<void>

    Resolves when the presence status has been successfully updated.

    TadoError if the supplied presence state is not "HOME", "AWAY", or "AUTO".

  • Set the callback function that is called when the Oauth token changes.

    Parameters

    • Optionalcb: (token: Token) => void

      The callback function

    Returns void

  • Updates the Energy IQ tariff for a specified home.

    Parameters

    • home_id: number

      The unique identifier for the home.

    • tariff_id: string

      The unique identifier for the tariff.

    • unit: IQUnit

      The unit of the tariff, either "m3" or "kWh."

    • startDate: string

      The start date of the tariff in the format 'YYYY-MM-DD.'

    • endDate: string

      The end date of the tariff in the format 'YYYY-MM-DD.'

    • tariffInCents: number

      The tariff rate in cents.

    Returns Promise<EnergyIQTariffInfo>

    A promise that resolves to the response of the API call.

    TadoError if the unit is not "m3" or "kWh."

  • Updates the presence state of the specified home.

    This method checks if anyone is currently at home and compares it with the current presence state. If there is a discrepancy, it updates the presence state accordingly. If the presence state is already accurate, it returns a message indicating no change was needed.

    Parameters

    • home_id: number

      The unique identifier of the home whose presence state is to be updated.

    Returns Promise<void | "already up to date">

    A promise that resolves when the operation is complete, or returns a message if the presence state was already accurate.