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
Example¶
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())