Previous Topic

Next Topic

Book Contents

Book Index

Device Class Object Property Command (deprecated)

A command for changing the value of a Device Class Object property of a specific device.

Managing Device Class Object Property Commands

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

Via Java API

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

Target Device

The HAM retrieves the Home Device.

Property

When the command is executed the HAM changes the value of the target device's property.

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. Refer to Configuring HDM via ConfigTree.

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

Download Device Class Object Property 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="dcoPropertyCommand">

        <xs:complexContent>

            <xs:extension base="configNode">

                <xs:sequence>

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

                        <xs:alternative test="@key eq 'uid' and  @type eq 'string'" type="valueString"/>

                        <xs:alternative test="@key eq 'device_class' and @type eq 'string'" type="valueString"/>

                        <xs:alternative test="@key eq 'property_name' and @type eq 'string'" type="valueString"/>

                        <xs:alternative test="@key eq 'property_value' and @type eq 'int'" type="valueInt"/>

                        <xs:alternative test="@key eq 'property_value' and @type eq 'string'" type="valueString"/>

                        <xs:alternative test="@key eq 'property_value' and @type eq 'char'" type="valueChar"/>

                        <xs:alternative test="@key eq 'property_value' and @type eq 'boolean'" type="valueBoolean"/>

                        <xs:alternative test="@key eq 'property_value' and @type eq 'byte'" type="valueByte"/>

                        <xs:alternative test="@key eq 'property_value' and @type eq 'short'" type="valueShort"/>

                        <xs:alternative test="@key eq 'property_value' and @type eq 'long'" type="valueLong"/>

                        <xs:alternative test="@key eq 'property_value' and @type eq 'double'" type="valueDouble"/>

                        <xs:alternative test="@key eq 'property_value' and @type eq 'float'" type="valueFloat"/>

                        <xs:alternative test="@key eq 'property_value' and @type eq 'long'" type="valueLong"/>

                        <xs:alternative test="@key eq 'property_value' and @type eq 'map'" type="valueMap"/>

                        <xs:alternative test="@key eq 'property_value'" type="valueString"/>                        

                        <xs:alternative test="@key eq 'async' and  @type eq 'boolean'" type="valueBoolean"/>

                        <xs:alternative test="@key eq 'ttl' and @type eq 'long'" type="valuePositiveLong"/>

                        <xs:alternative test="@key eq 'state' and @type eq 'int'" type="valueSceneState"/>

                        <xs:alternative test="@key eq 'usedInScenes' and @type eq 'string[]'" type="valueString"/>

                        <xs:alternative test="@key eq 'usedInRules' and @type eq 'string[]'" type="valueString"/>

                        <xs:alternative test="@key eq 'command_count' and @type eq 'int'" type="valuePositiveInt"/>

                        <xs:alternative test="@key eq 'command_id' and @type eq 'string'" type="valueString"/>

                        <xs:alternative test="@key eq 'command_type' and @type eq 'string'" type="valueString"/>

                        <xs:alternative test="@key eq 'name' and @type eq 'string'" type="valueString"/>

                        <xs:alternative test="@key eq 'application' and @type eq 'string'" type="valueString"/>

                        <xs:alternative test="@key eq 'internal' and @type eq 'boolean'" type="valueBoolean"/>

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

                        <xs:unique ref="uniqueProperties"/>

                        <xs:unique ref="uniqueConfigNodes"/>

                    </xs:element>

                </xs:sequence>

                <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='property_name']) eq 1"/>

            </xs:extension>

        </xs:complexContent>

    </xs:complexType>

    <xs:complexType name="attributeDCOPropertyCommand">

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

            <xs:simpleType>

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

                    <xs:enumeration value="DCOPropertyCommand"/>

                </xs:restriction>

            </xs:simpleType>

        </xs:attribute>

    </xs:complexType>

    <xs:complexType name="dcoPropertyCommands">

        <xs:complexContent>

            <xs:extension base="attributeDCOPropertyCommand">

                <xs:all>

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

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

                       <xs:unique ref="uniqueProperties"/>

                    </xs:element>

                </xs:all>

            </xs:extension>

        </xs:complexContent>      

    </xs:complexType>

    <!-- XML Schema definition -->

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

        <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 Property Command which finds the device with ID hdm:ZigBee:000d6f0001b57a6e and changes the value of the mode property of its NetworkControllerExt Device Class Object, thus setting the controller in pairing mode.

Device Class Object Operation Command Configuration

<config name="DCOPropertyCommand">

  <config name="DCOPropertyCommand1">

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

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

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

    <property key="property_name" value="mode" type="string"/>

  </config>

</config>