How can we help?
Print

Categories:

OpenAPI

Thermostat API

ThermostatHistory Attributes

UPDATED

The ThermostatHistory attributes enable retrieval of historical readings and setpoint information from Pelican thermostats. To perform a ThermostatHistory request, you must specify at least the required selection attributes, including a starting date/time (startDateTime) and an ending date/time (endDateTime). If no specific object attributes are requested, the API will return all historical information for every thermostat within the specified date range.​

ThermostatHistory Selection Attributes

Attribute names are not case-sensitive, whereas attribute values are case-sensitive.

Name Values Required Description
startDateTime Date/Time Yes ISO 8601 formatted date and time indicating the start of the history range to retrieve.
endDateTime Date/Time Yes ISO 8601 formatted date and time indicating the end of the history range to retrieve. A maximum of 30 days can be retrieved in a single request.
name String No The configured name of the thermostat.
groupName String​ No The configured group name for the thermostat.
serialNo String​ No The thermostat's unique serial number.

ThermostatHistory Object Attributes

Since this pertains to historical information, all requests are GET only.​

Name Values Description
name String The configured name of the thermostat.
groupName String The configured group name for that thermostat.
serialNo String The thermostat's serial number. Unique factory set identifier.
system Off, Auto, Heat, Cool The active thermostat's system mode
heatSetting Integer The thermostat's active Heat Setting.
coolSetting Integer The thermostat's active Cool Setting.
fan Auto, On The thermostat's active Fan Mode.
status Occupied, Vacant Normally Occupied. Vacant when vacation schedule is active.
temperature Decimal The thermostat's current measured temperature.
humidity Integer The current measured humidity (% RH); returns zero (0) if humidity is not supported.
humidifySetting Integer The thermostat's minimum humidity setting.
dehumidifySetting Integer The thermostat's maximum humidity setting.
co2Setting Integer The thermostat's demand ventilation CO2 setting.
co2Level Integer The thermostat's current measured CO2 level.
setBy Station, Remote, Schedule Indicates how the active thermostat settings were set.
frontKeypad On, Off Indicates whether the thermostat keypad is active (On) or locked (Off).
runStatus Off, Cool-Stage1, Cool-Stage2, Heat-Stage1, Heat-Stage2, Fan, Fan2 The currently active Fan, Heat or Cool status
auxStatus On, Off The thermostat's active Auxiliary Heat status.
slaves Array List of the remote temperature sensors and devices assigned to this thermostat and their values.
setback On, Off Whether a temporary Demand Response setback was active.
timestamp Date/Time ISO 8601 Formatted Date Time.

Code Examples

GET

Get the historical Temperature for all thermostats

				
					curl -Ls "https://demo.officeclimatecontrol.net/api.cgi?username=pelicandemosite@gmail.com&password=pelican&request=get&object=ThermostatHistory&selection=startDateTime:2025-03-15T00:00;endDateTime:2025-03-24T23:59;&value=name;temperature;timestamp"
				
			
				
					#!/usr/bin/perl -w

use strict;
use ClimateControl;
# You can request a copy of the ClimateControl Perl
# Module from Pelican Tech Support.
# Send an email to support@pelicanwireless.com

# Create a new ClimateControl object
my $cc = ClimateControl->new(
    'pelicandemosite@gmail.com',      # username
    'pelican',                        # password
    'demo.officeclimatecontrol.net'  # website
);

# Define the selection and attributes to retrieve
my $selection = {
    'startDateTime' => '2025-03-15T00:00',
    'endDateTime' => '2025-03-24T23:59'
};
my $attrlist = ['name', 'temperature', 'timestamp'];

# Call getAttributes to retrieve the ThermostatHistory data
my $result = $cc->getAttributes('ThermostatHistory', $selection, $attrlist);

# Check and display the result
if ($result->{'success'}) {
    print "Success: $result->{'message'}\n";
} else {
    print "Error: $result->{'message'}\n";
}
				
			
				
					import requests

url = "https://demo.officeclimatecontrol.net/api.cgi?username=pelicandemosite@gmail.com&password=pelican&request=get&object=ThermostatHistory&selection=startDateTime:2025-03-15T00:00;endDateTime:2025-03-24T23:59;&value=name;temperature;timestamp"
response = requests.get(url, verify=False)

if response.status_code == 200:
    print("Success:", response.text)
else:
    print("Error:", response.status_code)
				
			
				
					const https = require('https');

const url = 'https://demo.officeclimatecontrol.net/api.cgi?username=pelicandemosite@gmail.com&password=pelican&request=get&object=ThermostatHistory&selection=startDateTime:2025-03-15T00:00;endDateTime:2025-03-24T23:59;&value=name;temperature;timestamp';

https.get(url, { rejectUnauthorized: false }, (resp) => {
  let data = '';

  // Collect data chunks
  resp.on('data', (chunk) => {
    data += chunk;
  });

  // Handle the complete response
  resp.on('end', () => {
    if (resp.statusCode === 200) {
      console.log('Success:', data);
    } else {
      console.log('Error: HTTP', resp.statusCode);
    }
  });
}).on('error', (err) => {
  console.error('Error:', err.message);
});
				
			

Response

				
					<?xml version="1.0" encoding="UTF-8"?>
<result>
  <ThermostatHistory>
    <name>B102</name>
    <History>
      <temperature>68.7</temperature>
      <timestamp>2025-03-23T10:51</timestamp>
    </History>
    <History>
      <temperature>68.8</temperature>
      <timestamp>2025-03-23T10:55</timestamp>
    </History>
    ...
      </ThermostatHistory>
  <success>1</success>
  <message>Retrieved history for 71 thermostats.</message>
</result>
				
			
Table of Contents