PDA

View Full Version : The role of the alert system and the design inspector


KHarms
Nov 12, 2009, 08:24 PM
In HCA there are two tools that you should be using and while they are both part of the troubleshooter they are different in what they do. I’ll take them one at a time.

The Design Inspector – open from the menu by selecting Troubleshooter then “Open Troubleshooter” and choose the Inspector tab – focuses on finding things in your design of a static nature. That is, potential problems that have nothing to do how the actual devices respond. For example, the inspector looks for programs that DIM a device but that device isn’t dimmable. It doesn’t look for devices that don’t respond to status requests – that is for the alert system.

Behind the scenes, while you perform other tasks with the HCA U, the Design Inspector is periodically looking at your design and also runs a quick check each time you make any change. You can see at a glance if the inspector finds anything by looking at the red-yellow-green indicator in the HCA status bar at the bottom right of the HCA window. Some items HCA considers “red” conditions and other “yellow” conditions. The general rule is that anything that would prevent something from working – like a program not being ready to run – is a red condition. A yellow condition is something that might be an unintended consequence. For example, suppose you have a group of devices scheduled to be on at 11am and off at noon. If you have one of the group members also scheduled to be on at 11:15 and off at 1pm, these two schedule entries conflict for that device. The Inspector will note this. Maybe you intended this and maybe you didn’t.

The inspector can sometimes be a bit too diligent in finding things. There are two ways to control it. Take a look at this screen image of the Inspector:

85

To the left of each item that the inspector found is a box you can “check off” if you decide that this is an issue that is not a concern in your design. Once you check off an item then the inspector no longer considers it when determining what the red/yellow/green indicator in the status bar shows. If you have lots of inspector messages you can enable the option at the bottom on the list to have the inspector show only what isn’t checked-off.

The second way to control the inspector is to enable or disable the classes of errors the inspector looks for. This is done on the Inspector Setup tab of the troubleshooter.

86

On this tab you can suppress whole classes of checks. The text on this tab should be understandable.

The key to the Design Inspector is that it only checks for problems by looking at your design as a static entity. But this doesn’t mean that it doesn’t find useful stuff! Check off what you don’t care about so that when it finds something new the red/yellow/green status changes and you can go see what’s up.

The other tool in the troubleshooter in the Alert Manager. This tool handles dynamic errors – errors that happen over time. Because errors like these are not as simple as what the Design Inspector looks for, it takes a bit more work to configure what happens as these things happen. This dialog appears as:

87

Before we start on how alerts are defined, it is important to understand that, like the Design Inspector, not everything found is a problem. For example it is not unusual for a device to sometimes not acknowledge an action command – like ON or Off. If it starts happening a lot then this is something that might need looking into. The Alert Manager provides a method to handle these sorts of errors and take action to alert you. This is done by changing the red/yellow/green indicator in the status bar and/or starting a HCA program that can perform any task you need. For example sending you a text message or an email.

To add a handler for an Alert, first select the condition in the dropdown then define the handler parameters. You can:


Add an entry to the Inspector log each time the error happens
Add an entry to the inspector log at most once a day
Add an entry to the inspector log after the error happens ‘n’ times but stop adding entries after ‘m’ times.

You also control the red/yellow/green indicator by specifying that if the alert happens ‘n’ times then show a yellow alert and after ‘m times then show a red alert.

And finally, you can select the name of any defined program to start.

For example, in this picture you see an alert configured for an unknown UPB Id being received and it should log each time it happens and show a yellow alert the first time it happens and then go to a red alert if it happens again.

88

To modify an alert, just select it and the modify its parameters and press the Update Alert button.

There is one more piece to this that may be helpful if you are creating programs that are started by alerts. HCA sets three flags (variables) with data before it starts the program. These are:

_AlertCode: Contains a number to show which alert. The numbers assigned to each alert are in the same order the alert types appear in the condition dropdown

_AlertInfo: This varies with each alert. It maybe the name of a device or some such.

_AlertCount: The number of times today this alert happened.

It is important to know that these are global variables so programs should copy them into their own variables or they will be lost at the next alert.


These two tools, the Design Inspector and the Alert Manager taken together can provide a huge level of sophistication to your design. The Alert Manager in particular can be very useful for HCA to tell you how things are working., All you need do is to configure it.