How can we help?
Print

Categories:

OpenAPI

Power Control Module API

PowerSchedule Attributes

UPDATED

The PowerSchedule attributes enable you to add, modify, delete, and retrieve one-time or recurring run-time schedules for Pelican’s Power Control Modules (PM5 Series). This functionality allows for precise control over connected electrical equipment, optimizing energy usage and operational efficiency.

Key Features:

  • Advanced Scheduling: Supports both one-time and recurring schedules to accommodate various operational requirements.

  • Unlimited Schedules: No restriction on the number of schedules that can be added.

  • External Tracking: Schedules added through the API are tracked as “External” schedules.

Important Considerations:

  • Overlapping Schedules: Any overlapping schedules are automatically merged to prevent conflicts.

  • Day Boundaries: Schedules cannot cross day boundaries. For schedules that need to extend beyond midnight, multiple schedules should be created.

  • Editable Attribute: The editable attribute determines whether a schedule can be modified through the Pelican App:

    • Yes: The schedule can be edited or deleted by users via the Schedule Dashboard.

    • No (default): The schedule is viewable but cannot be modified or deleted through the App.

PowerSchedule - Object Attributes

​Attribute names are not case-sensitive; attribute values are case-sensitive.​

Name Values Settable Description
name String No The configured name of the power module output.
serialNo String No The power control module serial number.
scheduleId String Yes The unique ID of this schedule (See Note 1).
title String Yes descriptive label for the schedule.
startDate String Yes The first date the schedule will run in ISO 8601 format.
endDate String Yes The last date the schedule will run in ISO 8601 format.
startTime String Yes The time of day ISO 8601 extended local time format.
endTime String Yes The time of day ISO 8601 extended local time format.
repeat String Yes The frequency the schedule will run (See Note 2).
editable Yes, No Yes Whether users can edit the schedule through the Schedule Dashboard.
origin Internal, External, All No How the schedule was created (See Note 3)
delete Yes Yes Delete the specified schedule entry.
Note 1: ScheduleID
  • scheduleID is a unique identifier for each schedule.
  • The scheduleID can either be system-generated or user-provided.
  • If not specified when adding a new schedule, the system will automatically generate a unique scheduleID and return it in the response.
  • To modify an existing schedule, include the scheduleID in the request, and the provided attributes will be updated.
  • To delete a schedule, specify its scheduleID in the selection and set delete=Yes.

Note 2: Repeat

The repeat attribute determines how frequently a schedule runs.

Valid values:

  • None – Runs only once on the specified startDate.
  • Daily (Default) – Runs every day from startDate to endDate. If endDate is not specified, it continues indefinitely.
  • Weekly (Mo,Tu,We,Th,Fr,Sa,Su) – Runs on specific days of the week.
    • Days must be comma-separated and enclosed in parentheses.
    • Example: repeat=Weekly(Mo,We,Fr) (schedule runs every Monday, Wednesday, and Friday).
    • At least the first two letters of each day must be included.
  • Monthly – Runs once per month on the same day as startDate.
  • Yearly – Runs once per year on the same day as startDate.

Note 3: Origin

The origin attribute specifies whether a schedule was created through the API (External) or through the Pelican App (Internal).
  • When used in a GET request as a selection attribute, it filters returned schedules.
  • Default value: External (returns only API-created schedules).
  • Retrievable in a value list to determine how a schedule was created.
  • Only “External” schedules can be created via the API. However, both Internal and External schedules can be modified or deleted through the API.

Code Examples

GET

Get all events for a single Power Module. Including the name of the relay output or a scheduleId will filter the list of results returned to you

				
					curl -L "https://your-site-name.officeclimatecontrol.net/api.cgi?username=USERNAME&password=PASSWORD&request=get&object=PowerSchedule&selection=serialNo:{powerModuleSerialNo};origin:all;&value=name;serialNo;scheduleId;title;startDate;endDate;startTime;endTime;repeat;editable;origin;"
				
			
				
					#!/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(
    'USERNAME',      # username
    'PASSWORD',                        # password
    'your-site-name.officeclimatecontrol.net'  # website
);

# Define the selection and attributes to retrieve
my $selection = { 'serialNo' => '{powerModuleSerialNo}', 'origin' => 'all' };
my $attrlist = [
    'name',
    'serialNo',
    'scheduleId',
    'title',
    'startDate',
    'endDate',
    'startTime',
    'endTime',
    'repeat',
    'editable',
    'origin'
];

# Call getAttributes to retrieve the Thermostat data
my $result = $cc->getAttributes('PowerSchedule', $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://your-site-name.officeclimatecontrol.net/api.cgi?username=USERNAME&password=PASSWORD&request=get&object=PowerSchedule&selection=serialNo:{powerModuleSerialNo};origin:all;&value=name;serialNo;scheduleId;title;startDate;endDate;startTime;endTime;repeat;editable;origin;"
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://your-site-name.officeclimatecontrol.net/api.cgi?username=USERNAME&password=PASSWORD&request=get&object=PowerSchedule&selection=serialNo:{powerModuleSerialNo};origin:all;&value=name;serialNo;scheduleId;title;startDate;endDate;startTime;endTime;repeat;editable;origin;';

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>
  <PowerSchedule>
    <name>Boiler1</name>
    <serialNo>6A3-D9LN</serialNo>
    <scheduleId>SCHEDULE-6</scheduleId>
    <title></title>
    <startDate>2025-07-28</startDate>
    <endDate></endDate>
    <startTime>07:00</startTime>
    <endTime>07:05</endTime>
    <repeat>Daily</repeat>
    <editable>Yes</editable>
    <origin>Internal</origin>
  </PowerSchedule>
  <PowerSchedule>
    <name>Boiler1</name>
    <serialNo>6A3-D9LN</serialNo>
    <scheduleId>SCHEDULE-11</scheduleId>
    <title></title>
    <startDate>2025-09-15</startDate>
    <endDate></endDate>
    <startTime>06:00</startTime>
    <endTime>06:05</endTime>
    <repeat>Daily</repeat>
    <editable>Yes</editable>
    <origin>Internal</origin>
  </PowerSchedule>
  <success>1</success>
  <message>Retrieved attributes for 2 schedules.</message>
</result>
				
			

SET

Create a daily recurring event that begins at 07:00 and ends at 17:00 that will run for 7 days.

				
					curl -L "https://your-site-name.officeclimatecontrol.net/api.cgi?username=USERNAME&password=PASSWORD&request=set&object=PowerSchedule&selection=serialNo:{powerModuleSerialNo};name:{relayName}&value=startDate:2025-09-13;endDate:2025-09-18;startTime:07:00;endTime:17:00;title:{yourTitle};scheduleID:{yourScheduleId};editable:Yes;repeat: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(
    'USERNAME',      # username
    'PASSWORD',                        # password
    'your-site-name.officeclimatecontrol.net'  # website
);

# Define the selection and values as hashes
my $selection = { 'serialNo' => '{powerModuleSerialNo}', 'name' => '{relayName}' };
my $values = {
    'startDate' => '2025-09-13',
    'endDate' => '2025-09-18',
    'startTime' => '07:00',
    'endTime' => '17:00',
    'title' => '{yourTitle}',
    'scheduleID' => '{yourScheduleId}',
    'editable' => 'Yes',
    'repeat' => 'Daily'
};

# Call setAttributes to update the Thermostat
my $result = $cc->setAttributes('PowerSchedule', $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://your-site-name.officeclimatecontrol.net/api.cgi?username=USERNAME&password=PASSWORD&request=set&object=PowerSchedule&selection=serialNo:{powerModuleSerialNo};name:{relayName}&value=startDate:2025-09-13;endDate:2025-09-18;startTime:07:00;endTime:17:00;title:{yourTitle};scheduleID:{yourScheduleId};editable:Yes;repeat: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://your-site-name.officeclimatecontrol.net/api.cgi?username=USERNAME&password=PASSWORD&request=set&object=PowerSchedule&selection=serialNo:{powerModuleSerialNo};name:{relayName}&value=startDate:2025-09-13;endDate:2025-09-18;startTime:07:00;endTime:17:00;title:{yourTitle};scheduleID:{yourScheduleId};editable:Yes;repeat: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>
  <scheduleId>SCHEDULE-9390-12</scheduleId>
  <success>1</success>
  <message>Updated 1 schedules.</message>
</result>
				
			

SET

Delete an event. You will need to know the scheduleId in order to delete it

				
					curl -L "https://your-site-name.officeclimatecontrol.net/api.cgi?username=USERNAME&password=PASSWORD&request=set&object=PowerSchedule&selection=scheduleId:{yourScheduleId};&value=delete:Yes;"
				
			
				
					#!/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(
    'USERNAME',      # username
    'PASSWORD',                        # password
    'your-site-name.officeclimatecontrol.net'  # website
);

# Define the selection and values as hashes
my $selection = { 'scheduleID' => '{yourScheduleId}' };
my $values = {
    'delete' => 'Yes'
};

# Call setAttributes to update the Thermostat
my $result = $cc->setAttributes('PowerSchedule', $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://your-site-name.officeclimatecontrol.net/api.cgi?username=USERNAME&password=PASSWORD&request=set&object=PowerSchedule&selection=scheduleId:{yourScheduleId};&value=delete:Yes;"
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://your-site-name.officeclimatecontrol.net/api.cgi?username=USERNAME&password=PASSWORD&request=set&object=PowerSchedule&selection=scheduleId:{yourScheduleId};&value=delete:Yes;'

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>Schedule successfully deleted.</message>
</result>
				
			
Table of Contents