A condition that listens for changes of the value of a device class object property on all devices which have the same values for a set of device properties.
Managing Filter Device Class Object Property Conditions
The type of the condition is stored in the CONDITION_TYPE constant of the com.prosyst.mbs.services.hdm.ham.condition.FilterDCOPropertyCondition interface.
Via Java API
To configure the condition, use the following methods from the FilterDCOPropertyCondition class:
Target Devices
Property
When the value of this property changes the condition will be triggered.
After you configure your condition, call the save method. The Condition Provider will save the condition in Config Tree.
Via ConfigTree
All conditions are stored in ConfigTree, which allows you to import/export them and to add/edit commands by modifying XML files.
You can create a condition directly from ConfigTree by writing/generating an XML file, according to the following schema definitions:
Download Filter Device Class Object Property Condition 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="filterDCOPropertyCondition">
<xs:complexContent>
<xs:extension base="configNode">
<xs:all>
<xs:element name="property" type="propertyType" minOccurs="2" maxOccurs="unbounded">
<xs:alternative test="@key eq 'device_class' and @type eq 'string'" type="valueString"/>
<xs:alternative test="@key eq 'property' and @type eq 'string'" type="valueString"/>
<xs:alternative test="@key eq 'match_devices' and @type eq 'string[]'" type="valueString"/>
<xs:alternative test="@key eq 'comparison_operation' and @type eq 'string'" type="comparisonOperation"/>
<xs:alternative test="@key eq 'constraint' and @type eq 'int'" type="valueInt"/>
<xs:alternative test="@key eq 'constraint' and @type eq 'char'" type="valueChar"/>
<xs:alternative test="@key eq 'constraint' and @type eq 'byte'" type="valueByte"/>
<xs:alternative test="@key eq 'constraint' and @type eq 'boolean'" type="valueBoolean"/>
<xs:alternative test="@key eq 'constraint' and @type eq 'float'" type="valueFloat"/>
<xs:alternative test="@key eq 'constraint' and @type eq 'double'" type="valueDouble"/>
<xs:alternative test="@key eq 'constraint' and @type eq 'short'" type="valueShort"/>
<xs:alternative test="@key eq 'constraint' and @type eq 'long'" type="valueLong"/>
<xs:alternative test="@key eq 'constraint' and @type eq 'map'" type="valueMap"/>
<xs:alternative test="@key eq 'constraint'" type="valueString"/>
<xs:alternative test="@key eq 'condition_id' and @type eq 'string'" type="valueString"/>
<xs:alternative test="@key eq 'condition_type' and @type eq 'string'" type="valueString"/>
<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 '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 'string'" type="valueBoolean"/>
<xs:alternative type="xs:error"/>
</xs:element>
<xs:element name="config" type="filterDeviceProperties" minOccurs="1" maxOccurs="1">
<xs:unique ref="uniqueProperties"/>
</xs:element>
</xs:all>
<xs:assert test="count(property[@key='device_class']) eq 1"/>
<xs:assert test="count(property[@key='property']) eq 1"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="attributeFilterDCOPropertyCondition">
<xs:attribute name="name" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="FilterDCOPropertyCondition"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
<xs:complexType name="filterDCOPropertyConditions">
<xs:complexContent>
<xs:extension base="attributeFilterDCOPropertyCondition">
<xs:all>
<xs:element name="property" type="valueString" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="config" type="filterDCOPropertyCondition" 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="filterDCOPropertyConditions">
<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 Filter Device Class Object Property Condition that listens for all devices with type equal to Controller that contain the NetworkController Device Class Object and is triggered every time one of them changes its mode.
Filter Device Class Object Property Condition Configuration
<config name="FilterDCOPropertyCondition">
<config name="FilterDCOPropertyCondition1">
<property key="device_class" value="com.prosyst.mbs.services.hdm.deviceclasses.NetworkController" type="string"/>
<property key="property" value="mode" type="string"/>
<property key="match_devices" value="hdm:ZigBee:000d6f0001b57a6e" type="string[]"/>
<config name="properties">
<property key="type" value="Controller" type="string"/>
</config>
</config>
</config>