How can we help?
Print

Categories:

OpenAPI

Thermostat API

SharedSchedule Attributes

UPDATED

SharedSchedule attributes allow you to set shared schedules for thermostats. Attribute names are not case-sensitive, while attribute values are case-sensitive.

Predefined system-managed attributes for SharedSchedule objects, used for essential functions like temperature control, system status, and scheduling. They follow a fixed structure and cannot be renamed or redefined by users.

Reserved Attributes

User Defined Attributes

Custom attributes that users can create, set, and retrieve for SharedSchedule objects. Any attribute name that is not reserved is treated as user-defined. These attributes are created by assigning a value via a SET request and can be accessed using GET requests. There is no restriction on the number of user-defined attributes, allowing flexibility for custom data storage and retrieval.

User-defined attributes can also be used as selection criteria. For example, if a user wants to manage a specific group of thermostats via the API, they could define an attribute named “managed” and SET its value to “yes” for the thermostats in that group. Then, by including “managed:yes;” in their selection criteria, they can filter and control only those thermostats within the designated group.

Important Considerations:

  • Getting Schedules: To avoid conflicts between the Pelican web-app and your external application, getting SharedSchedules is not currently supported. It is recommended to first delete the SharedSchedule by name, then create it with the correct scheduleRepeat, and then push your set times with successive API calls. This pattern is shown in the examples below.

  • Selection Attributes: The selection ​attributes for the SharedSchedule API are the name, dayOfWeek, and setTime attributes. 

  • scheduleRepeat: The scheduleRepeat attribute is a global schedule attribute. As such, it will be applied to the entire schedule regardless of the selection criteria other than the schedule name.

Available SharedSchedule Attributes

Name Values Settable Description
name String Yes The configured name of the thermostat.
scheduleRepeat String Yes The schedule repeat. For “Daily” only the “Sunday” dayOfWeek will be used. For “Weekday” the “Sunday” schedule will be used on weekends and the “Monday” schedule will be used for weekdays. For “Weekly” all days of the week are used.
dayOfWeek Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Vacation Yes The day of the week for this schedule set time.
setTime Integer Yes The indexed set time for this schedule entry between 1 and 12
startTime String Yes The time of day (hh:mm format) for this schedule entry
system Auto, Heat, Cool, Off Yes The system mode.
heatSetting Integer Yes The heat setting.
coolSetting Integer Yes The cool setting.
fan Auto, On Yes The fan setting.
keypad On, Off Yes The keypad setting.
delete None Yes Delete the specified schedule entry.
deleteAll None Yes Delete the schedule for the entire day.
scheduleDelete None Yes The entire schedule will be deleted.

Code Examples

SET

Delete the SharedSchedule named "Hallways"

				
					curl -Ls "https://demo.officeclimatecontrol.net/api.cgi?username=pelicandemosite@gmail.com&password=pelican&request=set&object=SharedSchedule&selection=name:Hallways;&value=scheduleDelete;"
				
			
				
					#!/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 values as hashes
my $selection = { 'name' => 'Hallways' };
my $values = {
    'scheduleDelete' => '',
};

# Call setAttributes to update the SharedSchedule
my $result = $cc->setAttributes('SharedSchedule', $selection, $values);

# 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=set&object=SharedSchedule&selection=name:Hallways;&value=scheduleDelete;"
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=set&object=SharedSchedule&selection=name:Hallways;&value=scheduleDelete;';

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

				
					<result>
  <success>1</success>
  <message>Updated 1 schedules.</message>
</result>
				
			

SET

Create a new SharedSchedule named "Hallways" that repeats daily

				
					curl -Ls "https://demo.officeclimatecontrol.net/api.cgi?username=pelicandemosite@gmail.com&password=pelican&request=set&object=SharedSchedule&selection=name:Hallways;&value=scheduleRepeat:Daily;"
				
			
				
					#!/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 values as hashes
my $selection = { 'name' => 'Hallways' };
my $values = {
    'scheduleRepeat' => 'Daily',
};

# Call setAttributes to update the SharedSchedule
my $result = $cc->setAttributes('SharedSchedule', $selection, $values);

# 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=set&object=SharedSchedule&selection=name:Hallways;&value=scheduleRepeat:Daily;"
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=set&object=SharedSchedule&selection=name:Hallways;&value=scheduleRepeat:Daily;';

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

				
					<result>
  <success>1</success>
  <message>Updated 1 schedules.</message>
</result>
				
			

SET

Set the first set time on Sunday. Since the scheduleRepeat is set to "Daily" the only day we need to set is Sunday on the schedule. See the scheduleRepeat attribute description above. Most schedules will have more than one setTime (up to 12) so increase the value for successive API calls

				
					curl -Ls "https://demo.officeclimatecontrol.net/api.cgi?username=pelicandemosite@gmail.com&password=pelican&request=set&object=SharedSchedule&selection=name:Hallways;dayOfWeek:Sunday;setTime:1&value=startTime:06:00;system:Auto;heatSetting:65;coolSetting:85;fan:Auto;keypad:On"
				
			
				
					#!/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 values as hashes
my $selection = { 
    'name' => 'Hallways',
    'dayOfWeek' => 'Sunday',
    'setTime' => '1',
};
my $values = {
    'startTime' => '06:00',
    'system' => 'Auto',
    'heatSetting' => '65',
    'coolSetting' => '85',
    'fan' => 'Auto',
    'keypad' => 'On',
    'scheduleRepeat' => 'Daily',
};

# Call setAttributes to update the SharedSchedule
my $result = $cc->setAttributes('SharedSchedule', $selection, $values);

# 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=set&object=SharedSchedule&selection=name:Hallways;dayOfWeek:Sunday;setTime:1&value=startTime:06:00;system:Auto;heatSetting:65;coolSetting:85;fan:Auto;keypad:On"
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=set&object=SharedSchedule&selection=name:Hallways;dayOfWeek:Sunday;setTime:1&value=startTime:06:00;system:Auto;heatSetting:65;coolSetting:85;fan:Auto;keypad:On';

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

				
					<result>
  <success>1</success>
  <message>Updated 1 schedules.</message>
</result>
				
			

SET

Set the SharedSchedule named "Hallways" on the thermostat named "Lobby"

				
					curl -Ls "https://demo.officeclimatecontrol.net/api.cgi?username=pelicandemosite@gmail.com&password=pelican&request=set&object=Thermostat&selection=name:Lobby;&value=scheduleName:Hallways;"
				
			
				
					#!/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 values as hashes
my $selection = { 'name' => 'Lobby' };
my $values = {
    'scheduleName' => 'Hallways'
};

# Call setAttributes to update the Thermostat
my $result = $cc->setAttributes('Thermostat', $selection, $values);

# 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=set&object=Thermostat&selection=name:Lobby;&value=scheduleName:Hallways"
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=set&object=Thermostat&selection=name:Lobby;&value=scheduleName:Hallways';

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

				
					<result>
<success>1</success>
<message>Updated 1 thermostats.</message>
...
</result>
				
			
Table of Contents