[download] Module: LogMaster - add logging to Premise classes.


Senior Member
File Name: Module: LogMaster - add logging to Premise classes.
File Submitter: 123
File Submitted: 26 Jun 2009
File Category: Premise
Author: 123
Contact: PM me
Version: 1.0

LogMaster is a Module that adds logging capabilities to the following classes:
  • Lighting
  • DoorSensor
  • GarageDoorSensor
  • TemperatureSensor
  • MotionDetector
  • WindowSensor

LogMaster can be extended to support other Premise classes, like HeatSensor, WindSensor, Television, CoffeeMaker, etc, and custom classes. The following video demonstrates how to add logging to the Pump class.

Once installed, LogMaster will record the activities of supported objects in an Access MDB file. Each object acquires a LoggingEnabled property that permits you to enable/disable logging on a per object basis. The LogMaster Module also provides scripts that allow you to globally enable/disable logging for all supported objects.

LogMaster.mdb contains a single table called ObjectLog. ObjectLog records the following data:
  • Recorded (Date and time.)
  • ObjectLocation (Location in Premise Home.)
  • ObjectName (Name you've assigned to the object.)
  • ObjectClass (The object's class.)
  • ObjectState (The value assigned to the object's ValueProperty.)

Recorded (6/26/2009 2:47:55)
ObjectLocation (Home/Master Bedroom/Master Bathroom)
ObjectName (BathroomTemperature)
ObjectClass (TemperatureSensor)
ObjectState (76)

Installation Instructions
  1. Extract the contents of the attached zip archive (LogMaster.xdo and LogMaster.mdb).
  2. Create a new folder, called "Log", in the SYS folder (i.e. "C:\Program Files\Premise\SYS\Log").
  3. Copy the extracted MDB file into the Log folder.
  4. Make a backup copy of the MDB file.
  5. Using Builder, click Modules in the Shortcut Bar.
  6. Click File > Import and select the extracted XDO file.

Configuration Instructions
How to enable logging for a specific Lighting object.
  1. Using Builder, click Home in the Shortcut Bar.
  2. Click any Lighting object in the Home treeview.
  3. In the Properties window, enable the object's LoggingEnabled property.

How to enable logging for all Lighting objects.
  1. Using Builder, click Modules in the Shortcut Bar.
  2. Navigate to Modules > LogMaster > Macros > LoggingControl
  3. Select LightingLoggingEnabled.
  4. In the Properties window, click the Trigger property.

Analysis and Reporting
You can use Microsoft Access or Microsoft Excel to analyze the data collected in the LogMaster.mdb file. It is important to note that the LogMaster Module will open the Logmaster.mdb file and hold it open for as long as Premise Server is operational. This behavior is confirmed by the presence of a LogMaster.ldb file in the Log folder (i.e. a "lock" file). Assuming you are using MS-Access, you cannot create queries, reports, etc while the LogMaster.mdb file is held open by the LogMaster Module. It is best to create a new MDB file (for reports, queries, etc) and link it to the LogMaster.mdb file.

If you find a need to modify the LogMaster.mdb file, you can release it by using the DisconnectDB script macro (Modules > LogMaster > Macros > LogMasterMacros > DisconnectDB). All logging will cease after the database file is disconnected. To re-establish the connection, use the InitializeDB script macro (Modules > LogMaster > Macros > LogMasterMacros > InitializeDB).

Click here to download this file