Skip to content

Get Thermostat Details

Returns a list of thermostats for a given Kraken account number.

Authentication Required

Requires account user level access.

Arguments

  • accountNumber: String!

Returns

query getThermostatDetails($accountNumber: String!) {
    getThermostatDetails(accountNumber:$accountNumber) {
        thermostats {
            id
            name
            hvacMode
            enabled
            deviceType
            deviceVendor
            currentTemp
            tokenStatus
        }
    }
}
1
2
3
4
5
6
# Input variables
{
    "input":{
        "accountNumber": "",
    }
}

Example

query getThermostatDetails($accountNumber: String!) {
    getThermostatDetails(accountNumber:$accountNumber) {
        thermostats {
            id
            name
            hvacMode
            enabled
            deviceType
            deviceVendor
            currentTemp
            tokenStatus
        }
    }
}
1
2
3
4
# Input variables
{
    "accountNumber": "A-1234567",
}
import pprint

import requests

# API_URL = "https://api.oeus-kraken.energy/v1/graphql/" # prod
API_URL = "https://api.oeus-kraken.systems/v1/graphql/" # test
JWT_TOKEN = "PLACE_JWT_TOKEN_HERE"
HEADERS = {
    "Authorization": f"JWT {JWT_TOKEN}"
}

QUERY = """
query getThermostatDetails($accountNumber: String!) {
    getThermostatDetails(accountNumber:$accountNumber) {
        thermostats {
            id
            name
            hvacMode
            enabled
            deviceType
            deviceVendor
            currentTemp
            tokenStatus
        }
    }
}
"""

VARIABLES = {"accountNumber": "A-1234567"}


session = requests.Session()
session.headers.update(HEADERS)
response = session.post(
    url=API_URL,
    json={"query": QUERY, "variables": VARIABLES}
)
pprint.pprint(response.json())
"data": {
    "getThermostatDetails": {
        "thermostats": [
            {
                "id": "df1a49f502ac4bc995461f598ac376cf",
                "name": "Therminator",
                "hvacMode": "OFF",
                "enabled": "True",
                "deviceType": "THERMOSTATS",
                "deviceVendor": "ECOBEE",
                "currentTemp": "640",
                "tokenStatus": "AUTHENTICATED",
            },
            {
                "id": "3c17d8fc2fe642c4a615f6cfdfd6cf6d",
                "name": "Absolute Zero",
                "hvacMode": "HEATING",
                "enabled": "True",
                "deviceType": "THERMOSTATS",
                "deviceVendor": "ECOBEE",
                "currentTemp": "650",
                "tokenStatus": "AUTHENTICATED",
            }
        ]
    }
}
Back to top