Previous Topic

Next Topic

Book Contents

Book Index

Device Class Object Operation Command (deprecated)

A command for execution of a Device Class Object operation on a specific device.

Managing Device Class Object Operation Commands

The type of the command is stored in the TYPE constant of the com.prosyst.mbs.services.hdm.ham.command.DCOOperationCommand interface.

Via Java API

To configure the command, use the following methods from the DCOOperationCommand class:

Target Device

The HAM retrieves the Home Device.

Operation

When the command is executed the HAM invokes the operation on the target device.

Asynchronous Execution

After you configure your command, call the save method. The Command Provider will save the command in Config Tree.

Via ConfigTree

All commands are stored in ConfigTree, which allows you to import/export them and to add/edit commands by modifying XML files.

You can create a command directly from ConfigTree by writing/generating an XML file, according to the following schema definitions:

Download Device Class Object Operation Command Schema Definition

Download Common Datatypes Schema Definition

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

    <!-- Include common types -->

    <xs:include schemaLocation="HAMCommonTypes.xsd"/>

    <!-- Global elements definitions -->

    <xs:complexType name="dcoOperationCommand">

        <xs:complexContent>

            <xs:extension base="configNode">

                <xs:all>

                    <xs:element name="property" type="propertyKey" minOccurs="0" maxOccurs="unbounded">

                        <xs:alternative test="@key eq 'uid'" type="typeString"/>

                        <xs:alternative test="@key eq 'device_class'" type="typeString"/>

                        <xs:alternative test="@key eq 'operation'" type="typeString"/>

                        <xs:alternative test="@key eq 'async'" type="typeBoolean"/>

                        <xs:alternative test="@key eq 'ttl'" type="typePositiveLong"/>

                        <xs:alternative test="@key eq 'state'" type="typeSceneState"/>

                        <xs:alternative test="@key eq 'usedInScenes'" type="typeStringArray"/>

                        <xs:alternative test="@key eq 'usedInRules'" type="typeStringArray"/>

                        <xs:alternative test="@key eq 'command_count'" type="typePositiveInt"/>

                        <xs:alternative test="@key eq 'command_id'" type="typeString"/>

                        <xs:alternative test="@key eq 'command_type'" type="typeString"/>

                        <xs:alternative test="@key eq 'name'" type="typeString"/>

                        <xs:alternative test="@key eq 'application'" type="typeString"/>

                        <xs:alternative test="@key eq 'internal'" type="typeBoolean"/>

                        <xs:alternative type="xs:error"/>

                    </xs:element>

                    <xs:element name="config" type="configNode" minOccurs="0" maxOccurs="1">

                        <xs:alternative test="@name eq 'args'" type="commandOperationArguments"/>

                        <xs:alternative type="xs:error"/>

                        <xs:unique ref="uniqueConfigNodes"/>

                    </xs:element>

                </xs:all>

                <xs:assert test="count(property[@key='uid']) eq 1"/>

                <xs:assert test="count(property[@key='device_class']) eq 1"/>

                <xs:assert test="count(property[@key='operation']) eq 1"/>

            </xs:extension>

        </xs:complexContent>

    </xs:complexType>

    <xs:complexType name="attributeDCOOperationCommand">

        <xs:attribute name="name" use="required">

            <xs:simpleType>

                <xs:restriction base="xs:string">

                    <xs:enumeration value="DCOOperationCommand"/>

                </xs:restriction>

            </xs:simpleType>

        </xs:attribute>

    </xs:complexType>

    <xs:complexType name="dcoOperationCommands">

        <xs:complexContent>

            <xs:extension base="attributeDCOOperationCommand">

                <xs:all>

                    <xs:element name="property" type="valueString" minOccurs="0" maxOccurs="unbounded"/>

                    <xs:element name="config" type="dcoOperationCommand" minOccurs="0" maxOccurs="unbounded">

                        <xs:unique ref="uniqueProperties"/>

                        <xs:unique ref="uniqueConfigNodes"/>

                    </xs:element>

                </xs:all>

            </xs:extension>

        </xs:complexContent>        

    </xs:complexType>

    <!-- XML Schema definition -->

    <xs:element name="config" type="dcoOperationCommands">

        <xs:unique name="uniqueProperties">

            <xs:selector xpath="property"/>

            <xs:field xpath="@key"/>

        </xs:unique>

        <xs:unique name="uniqueConfigNodes">

            <xs:selector xpath="config"/>

            <xs:field xpath="@name"/>

        </xs:unique>

    </xs:element>

</xs:schema>

The following example contains a Device Class Object Operation Command which finds the device with ID hdm:ZigBee:000d6f0001b57a6e and executes the setModeDuration operation on its NetworkControllerExt Device Class Object with a set of predefined arguments.

Device Class Object Operation Command Configuration

<config name="DCOOperationCommand">

  <config name="DCOOperationCommand1">

    <property key="uid" value="hdm:ZigBee:000d6f0001b57a6e" type="string"/>

    <property key="operation" value="setModeDuration" type="string"/>

    <property key="device_class" value="com.prosyst.mbs.services.hdm.deviceclasses.NetworkControllerExt" type="string"/>

    <config name="args">

      <property key="1" value="10000" type="string"/>

      <property key="0" value="2" type="string"/>

    </config>

  </config>

</config>