Jump to content


Photo
- - - - -

How to add 'non-standard' enhancements.


  • Please log in to reply
No replies to this topic

#1 123

123

    Cocoonut

  • Registered
  • PipPipPipPip
  • 2171 posts
  • Location:Montreal, QC
  • Experience:average
  • Software:Premise
  • Hardware:Elk M1

Posted 07 May 2009 - 12:34 PM

One of the cool things about Premise is that it is based on an engine called SYS whose 'purpose in life' is defined by XML Schema files. Premise includes schemas that make SYS a Home Automation application. If you were adventurous, you could alter the schemas and make SYS do something else.

The schema files are located in \Program Files\Premise\SYS\schema.
_alarms.xml
_device.xml
_forms.xml
_home.xml
_logic.xml
_media.xml
_script.xml
_timers.xml
_x10.xml

Another thing you can do is make subtle alterations to the schema files in order to add new or missing functionality. Before attempting this stunt, please note the following:
  • If Premise was still a supported product, altering its schema files would be highly inadvisable. Newer versions of Premise would've undoubtedly included altered schema files that trounced your modifications (or worse). However, since Premise is frozen at V2.1, there's no danger of new schema versions.
  • The schemas define all Premise Home objects and much more. If you make mistakes altering them, you should expect the worst. Always maintain backup copies of the schemas!
  • Changing how objects are defined, in the schemas, will make your Modules non-portable! Other users will be unable to use your Modules unless they also alter their schemas to match yours.
  • For all practical purposes, there is no need to modify the schemas. Ensure you can't accomplish your goal in Premise the 'normal way' before deciding you need to alter how things are defined in the schemas!
So why am I thinking of altering the _devices.xml schema file ... ???

DigitalOutput is the object normally used for Relays. It has one bindable property: State (i.e. a relay is On or Off).
DigitalOutputEx is an enhanced variation that has three properties: State, Invert, and AutoReset. AutoReset is the time period to wait before resetting State back to its original value. Anyone who has programmed an ELK M1 will recognize that this is equivalent to:
TURN OUTPUT ON FOR <time in seconds>.

The problem is that the AutoReset property is not bindable! That means its value cannot be transferred from a Home object to a Driver object ... and that makes DigitalOutputEx less than useful. However, if you open up _devices.xml in an text editor, go to line 167 and change it from:
<Object ID="{9BEA8781-5529-4701-8ADA-4E3B740D8A86}" Name="AutoReset" Class="sys://Schema/System/Number" Description="Time in milliseconds SYS waits after the Value property is set to true before resetting (set to false) the output."/>
to:
<Object ID="{9BEA8781-5529-4701-8ADA-4E3B740D8A86}" Name="AutoReset" Bindable="-1" Class="sys://Schema/System/Number" Description="Time in milliseconds SYS waits after the Value property is set to true before resetting (set to false) the output."/>
then restart the Premise Server service, AutoReset becomes a bindable property and DigitalOutputEx becomes useful when modelling an ELK M1's Outputs.

Edited by 123, 07 May 2009 - 12:40 PM.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users