- KickAss HAL Programming -

  

 

 

 

 

Some Skinny on accessing HAL Data from external scripts

 

Data Change Trigger

The state of HAL flags, counters, timers and the like are stored internally in the HAL Database. This database is a generic DBASE III or FoxPro format database, which is often known generically as xBase. The database is a collection of related files which have the file extension .DBF.

There are a number of tools on the web for manipulating xBase files, and most of them will work with HAL files just fine. After looking at several, I selected the program CDBFlite. It encapsulates a lot of functionality in a small package, and is relatively independant of the actual file format. There are many other packages, including Perl modules available on CPAN.

There are many individual files that hold many different types of data, but the most interesting for our immediate purpose is the file DEVICE.DBF, which holds among other things, Flags, Counters and Timers.

If we write a Perl script that sleeps for a few seconds, checks the status of a flag, and then takes action when that flag becomes true, that program can be triggered into action based on the state of HAL Flags.

The drawback is that we can't check the flag state too often because of the system overhead associated with doing so. This means that there is a certain minimum latency between when a flag is set and the desired action is executed.

For non-time-critical applications, this is an excellent method of invoking external actions. The less time-critical the desired action is, the greater the tolerable latency, and the less overhead the program places on the system. Properly done, the overhead can be nil.

The Perl script can simply run as a program in a DOS box, or with a little more work, be set up as a service using the utility SRVANY.

 

 

 

 

 

 

 

 

 

 

Action Events (Cont.)

Macros and Rules

Built-in HAL Actions (Cont.)

Set Thermostat

Telephone Operations

Email Notification

Set Listen Mode

Attention Mode

Infrared Command

Send X10 Command

Send Page

Send Email

Security System Operation

External HAL Actions

Run Program

Call DLL

Data Change Trigger

Windows Scheduler

Ocelot Program

Navigation

Triggers, Conditions and Actions

More Macros

Scenes and Modes

Rules and Programs

Programs vs. Scripts

Main Menu