DateTime Driver

Modified on 2010/12/15 10:09 by Administrator — Categorized as: Driver

This driver triggers events based on date and time, time intervals and sunrise/sunet.

Manufacturer: N/A


Configuration Settings


When using the geographic coordinates, do not use a negative sign since it is implied by entering W. When using the decimal format, use a negative sign only for South.
When using the geographic coordinates, do not use a negative sign since it is implied by entering S. When using the decimal format, use a negative sign only for West.

Events

Ready State Changed

The device's running and ready state changed.

Whenever Filter:

none

EventArgs:


At Sunrise

Occurs at a sunrise.

Whenever Filter:


EventArgs:

none

At Sunset

Occurs at a sunset.

Whenever Filter:


EventArgs:

none

At a Specific Date & Time

Occurs once at a specific date and time.

Whenever Filter:


EventArgs:

none

Daily At a Specific Time

Occurs every day at a specific time.

Whenever Filter:


EventArgs:

none

Every # of Seconds

Occurs every X seconds.

Whenever Filter:


EventArgs:

none

Every # of Minutes

Occurs every X minutes.

Whenever Filter:


EventArgs:

none

Every # of Hours

Occurs every X hours.

Whenever Filter:


EventArgs:

none

At Random Intervals

Occurs at random intervals between a specified minimum and maximum duration.

Whenever Filter:


EventArgs:

none

At Scheduled Intervals

Occurs based on an advanced schedule.

Whenever Filter:


EventArgs:

none

Instance Properties

IsDarkOutside

Gets a value indicating if it is dark outside.

Accessibility : Read Only

Type: Boolean

IsLightOutside

Gets a value indicating if it is light outside.

Accessibility : Read Only

Type: Boolean

Sunrise

Gets the date/time of the next sunrise. This could be tomorrow if today's sunset has already occurred.

Accessibility : Read Only

Type: DateTime

Sunset

Gets the date/time of the next sunset. This could be tomorrow if today's sunset has already occurred.

Accessibility : Read Only

Type: DateTime

CurrentDateTime

Gets the current date/time in the device's timezone.

Accessibility : Read Only

Type: DateTime

DayOfWeek

Gets the day of the week. 0=Sunday, 1=Monday, etc.

Accessibility : Read Only

Type: Number

DayOfYear

Gets the day of the year.

Accessibility : Read Only

Type: Number

Day

Gets today's day of the month.

Accessibility : Read Only

Type: Number

Month

Gets today's month of the year.

Accessibility : Read Only

Type: Number

Year

Gets today's year.

Accessibility : Read Only

Type: Number

Hour

Gets the current time's hour component.

Accessibility : Read Only

Type: Number

Minute

Gets the current time's minute component.

Accessibility : Read Only

Type: Number

Second

Gets the current time's second component.

Accessibility : Read Only

Type: Number

Millisecond

Gets the current time's millisecond component.

Accessibility : Read Only

Type: Number

IsWeekday

Gets a value indicating today's date is a weekday day (Monday through Friday).

Accessibility : Read Only

Type: Boolean

IsWeekend

Gets a value indicating today's date is a weekend day (Saturday or Sunday).

Accessibility : Read Only

Type: Boolean

MoonPhases

Gets the moon phases for the next 30 days.

Accessibility : Read Only

Type: Array

DeviceDisplayName

The display name for this device.

Accessibility : Read Only

Type: String

DeviceStartTime

The date and time when this device was started.

Accessibility : Read Only

Type: DateTime

DeviceLifecycleStage

The current lifecycle stage of the device. The stages in order are: Pending Start, Starting, Running, Stopping

Accessibility : Read Only

Type: Number

DeviceIsRunningAndReady

Indicates if the device is ready for use, ie it is in the Running lifecycle stage and all properties are valid and all methods are ready to be used.

Accessibility : Read Only

Type: Boolean

Instance Methods

OffsetDays ( Number )

Gets the current date/time offset by the specified number of days.

Syntax

DateTime OffsetDays( Number days )

Parameters

days : A number of whole and fractional days. The value can be negative or positive.

OffsetHours ( Number )

Gets the current date/time offset by the specified number of hours.

Syntax

DateTime OffsetHours( Number hours )

Parameters

hours : A number of whole and fractional hours. The value can be negative or positive.

OffsetMilliseconds ( Number )

Gets the current date/time offset by the specified number of milliseconds.

Syntax

DateTime OffsetMilliseconds( Number milliseconds )

Parameters

milliseconds : A number of whole and fractional milliseconds. The value can be negative or positive. Note that this value is rounded to the nearest integer.

OffsetMinutes ( Number )

Gets the current date/time offset by the specified number of minutes.

Syntax

DateTime OffsetMinutes( Number minutes )

Parameters

minutes : A number of whole and fractional minutes. The value can be negative or positive.

OffsetMonths ( Number )

Gets the current date/time offset by the specified number of months.

Syntax

DateTime OffsetMonths( Number months )

Parameters

months : A number of months. The months can be negative or positive.

OffsetSeconds ( Number )

Gets the current date/time offset by the specified number of seconds.

Syntax

DateTime OffsetSeconds( Number seconds )

Parameters

seconds : A number of whole and fractional seconds. The value can be negative or positive.

OffsetYears ( Number )

Gets the current date/time offset by the specified number of years.

Syntax

DateTime OffsetYears( Number years )

Parameters

years : A number of years. The value can be negative or positive.

GetMoonPhase ( DateTime )

Gets the moon phase for the specified date.

Syntax

Number GetMoonPhase( DateTime date )

Parameters

date : The date.

SetPropertyForDuration ( String, TimeSpan, Object, Object )

Sets a property for a duration of time and then sets the property to a subequent value asynchronously. This action returns after setting the first value and the timer and subsequent property set run in the background. Subsequent sets of the same property will reset the timer if the subsequent value has not yet been set. This is an advanced feature, be sure to set the property name correctly.

Syntax

void SetPropertyForDuration( String propertyName, unknown duration, Object initialValue, Object finalValue )

Parameters

propertyName : The name of the property to set.
duration : The amount of time to wait after setting the initial value to set the subsequent value.
initialValue : The value to set the property to initially.
finalValue : The value to set the property to after the duration of time has passed.

SetPropertyForDuration ( String, Number, TimeSpan, Object, Object )

Sets a property for a duration of time and then sets the property to a subequent value asynchronously. This action returns after setting the first value and the timer and subsequent property set run in the background. Subsequent sets of the same property will reset the timer if the subsequent value has not yet been set. This is an advanced feature, be sure to set the property name correctly.

Syntax

void SetPropertyForDuration( String propertyName, Number arrayIndex, unknown duration, Object initialValue, Object finalValue )

Parameters

propertyName : The name of the property to set.
arrayIndex : The property's array index to set.
duration : The amount of time to wait after setting the initial value to set the subsequent value.
initialValue : The value to set the property to initially.
finalValue : The value to set the property to after the duration of time has passed.