Jump to content
C4 Forums | Control4

How to use Chowmain Event logging to troubleshoot unpredictable events


Clifford Musante

Recommended Posts

I've just had my systems integrator install the ChowMain logging driver, and I'm trying to use it to determine why one of my lights is turning off after about 30 seconds, when I think that I've programmed it to turn off after 3 minutes.

My plan was to go to the light in question, and any time that the status of the light changes, I would log some events, which would allow me to find out what caused the light to turn off.  But, I've got a few problems with this plan.

First of all, none of my lights are showing up in the list of details, which can be logged.  In fact, it seems that the details that can actually log do not correlate to any pattern that I can figure out.  These details are not the same as the room itself, nor are they part of the devices in that room, are even related to the room variables for the room in question. 

So, can you give us an example of how this driver would allow me to work backward from the light being turned off to know what event caused it to be turned off, or can I log all events related to the light, tracking and logging those events from the time that the light is turned on, to the time that it is turned off?

Any ideas?

Link to comment
Share on other sites


Thanks Alan,

I've been able to get the driver to log the value of variables, so the example that you've inserted into the manual was quite helpful.  Now, as a way of looking into what's happening, and when the status of an object changes, I'm trying to log the status of an object property, and once again having trouble figuring out how to log this information.  For example, if I had a light called "Main Light" in the "Dining Room" and I wanted to log whether the light is on or off, I'm not sure how to do it.

I've tried creating a conditional statement in a macro that tests to see if the status of the light is on, and then using the technique you recommended, I copied the underlying content of that line of TXT into a TXT editor.  In the end, I get something like

<item>
	<Proxy>light_v2</Proxy>
	<Type>Conditional</Type>
	<DeviceID>100</DeviceID>
	<Description>If NAME is on</Description>
	<XmlData>
		<deviceconditional owneridtype="" owneriditem="-1">
			<name>LOAD_ON</name>
		</deviceconditional>
	</XmlData>
</item>

When I ask the Event logger to log PARAM{100,-1}, it gets confused, and only logs a portion of the text and information I was looking for.  For example, the exact statement that I inserted into the logger was the string "The Office Light status has been toggled.  Current Status is on PARAM{100,-1}.  The logger then logs the following line in the log...

The Office Light Status has been toggled.  Current Status is on PARAM{100

As you can see, I'm trying to use the same syntax as I used when logging the value of variables, but it's not working in this case.  I would really like to know what the syntax is for logging the value for any parameter that exists for any object, in any room of the house.

Sorry to be a pain, and as I said, I'm not Control4 certified, and my objective is not to eliminate using my chosen Systems Integrator to perform work for me, but I can't afford to have them act as an intermediary, so that they can develop the expertise, only to find that after this problem is solved, I'll need to confront the next problem, and need to ask for help again.  I'm trying to understand how to use this tool to do what it's advertised to do, and I'm almost there.  Given the amount of work that I want to take on myself, I'm going to need to understand how to use this tool to log objects, properties, and variables.  Right now, I'm only able to log variables.

Thoughts?

Link to comment
Share on other sites

i would also check the light property page and see if they auto turn off feature is work.

 

if the light is not used heavily in programming you could also delete from the project, factory restore the switch and then add it back it. this will remove any and all settings for it

Link to comment
Share on other sites

-1 is not a valid variable id. Having said that though i'm not even sure why you trying to log variables to do your troubleshooting.  You can just add it to the LIGHT_STATE variable change and do if LIGHT_STATE = true and LIGHT_STATE = false conditionals to log the correct state.  That is the easiest way to do it if you want to log when your lights turn on and off.

Lastly as @ILoveC4 says your dealer should use detective suite as this will help him find all the programming statements in your project.  This is by far the best way to diagnose the problem.

Link to comment
Share on other sites

I've solved the problem.  As it turns out, was using the MINUTES_ON value to act like a timer, but I've now discoverd that MINUTES_ON is an aggregator of the total number of minutes that a light is on, in any given day.

So, problem solved.

That said, I'm still trying to understand how to log values associated with any object in the programming model.  Can you provide the syntax for logging the state of a light, or temperature, etc?

Thanks

PS, sorry for the delay in getting back to you.  I had neglected to "follow" the thread.

Link to comment
Share on other sites

Thanks for the help.  I found the selection in account settings, and now I will automatically follow any content I create, or reply to.

As to what I had done wrong, and how the problem got solved, here's what was wrong.

I was trying to set a timer to keep a light on for 5 minutes after its status was set to ON.  So, rather than inserting a programming wait statement, I thought that I could use the MINUTES_ON property to trigger on.  I had wrongly assumed that each time the light came on, it would track how long it was on, and once it hit X minutes, I could act against the light and turn it off.  I liked this solution because I would be able to allow for the light to be turned on multiple times, perhaps using different switches or controls, but to have it powered off at a predictable period of time, regardless of how many times it was "Turned on".

As it turns out, if the light was on for 2 minutes, and I had set a MINUTES_ON validation at 3 minutes, then the programming would work perfectly the first time, but the light would turn off after one minute the second time it was turned on.  The third time it was turned on it would likely shut off within seconds.  So, I was getting a somewhat unpredictable timer for the light, and it was all because I misunderstood the intention of the MINUTES_ON property.

Now, if I could just figure out how to select the property of an object, and insert it into the logging driver, Id' be in great shape.

Link to comment
Share on other sites

4 hours ago, Clifford Musante said:

Thanks for the help.  I found the selection in account settings, and now I will automatically follow any content I create, or reply to.

As to what I had done wrong, and how the problem got solved, here's what was wrong.

I was trying to set a timer to keep a light on for 5 minutes after its status was set to ON.  So, rather than inserting a programming wait statement, I thought that I could use the MINUTES_ON property to trigger on.  I had wrongly assumed that each time the light came on, it would track how long it was on, and once it hit X minutes, I could act against the light and turn it off.  I liked this solution because I would be able to allow for the light to be turned on multiple times, perhaps using different switches or controls, but to have it powered off at a predictable period of time, regardless of how many times it was "Turned on".

As it turns out, if the light was on for 2 minutes, and I had set a MINUTES_ON validation at 3 minutes, then the programming would work perfectly the first time, but the light would turn off after one minute the second time it was turned on.  The third time it was turned on it would likely shut off within seconds.  So, I was getting a somewhat unpredictable timer for the light, and it was all because I misunderstood the intention of the MINUTES_ON property.

Now, if I could just figure out how to select the property of an object, and insert it into the logging driver, Id' be in great shape.

in order to utilise the driver well you really need a good understanding of Composer (home or pro).  Everything is detailed in the installation guide on how to use it including insertion of variables into logged text.  It works like any other Control4 programming action where you need to place it in the correct event to fire it.

Link to comment
Share on other sites

I've also figured out how to apply the programming model to the Logging Event Driver.  So, for the sake of others, here's how you do it...

Alan explains how to capture all of the metadata for a particular object, but he does not really talk about the hierarchy, and getting at all of the metadata.  So, after having been told by Alan that I should be able to figure this out, I figured it was time to sit down and spend whatever time was necessary to figure it out.

It seems that every item in the object model (switches, lights, sensors, etc.) all have a unique ID, which is called the DeviceID.  For any Device, there are numerous properties that show the state of that device at any given time.  These properties are uniquely identified through the metadata tag "overiditem".  So, any property, for any device can be identifned as {DEVICEID, OVERIDEITEM}.  If the device is actually a variable, not an actual device, then the syntax is {DEVICEID, OVERIDEITEM} %.  Adding the percent sign simply tells the system to look for variables, not devices.

So, how do you use this information to log events.  For me, the process started out with identifying the Devices, and testing to see if I could log information about them.  So, in the "REUSABLE" macro, I inserted one command at a time.  If I wanted to know the number of minutes that a given light was on today, I would enter the programming tab, and on the RH side, I would select the property "MINUTES_ON_TODAY"

Alan shows us a neat trick to determine the DeviceID and OverideID for a given item.  I've refined his trick a little bit, it's roughly the same.

Capturing the Device ID and OverideID

Create two macros.  One called GENERIC TEST, and the other called REUSABLE.  In the GENERIC TEST macro, you'll build the macro that executes commands and logs the state of each device and property.  In the REUSABLE macro, you'll insert one statement at a time, so that you can more easily capture the information that will be inserted into GENERIC TEST macro.

In the REUSABLE macro, select the property that you want to log, and drag it into the macro.  Some objects, such as lights allow you to easily select "Turn this on" or "Turn this off".  Choose either one of these, and drag it into the macro.  With that single item in the macro, right click on it, and select copy.  Then, take what you've copied to the clipboard, and paste it into a TXT editor.  I use Notepad++ because it handles metadata very well.  Incidentally, what you'll be copying into the TXT editor is metatada.

I've changed the values, but below you'll find two examples of metadata for the MINUTES_ON and MINUTES_ON_TODAY values for a given light.

<cutitems>
    <item>
        <Proxy>control4_lights_gen3</Proxy>
        <Type>Conditional</Type>
        <DeviceID>400</DeviceID>
        <Description>If NAME-&gt;MINUTES_ON GREATER THAN OR EQUAL TO 1</Description>
        <XmlData>
            <deviceconditional owneridtype="variable" owneriditem="4141" name="&gt;=">
                <param name="value" type="int">1</param>
            </deviceconditional>
        </XmlData>
    </item>
</cutitems>
<cutitems>
    <item>
        <Proxy>control4_lights_gen3</Proxy>
            <Type>Conditional</Type>
            <DeviceID>400</DeviceID>
            <Description>If NAME-&gt;MINUTES_ON_TODAY GREATER THAN OR EQUAL TO 1</Description>
            <XmlData>
                <deviceconditional owneridtype="variable" owneriditem="4142" name="&gt;=">
                    <param name="value" type="int">1</param>
                </deviceconditional>
            </XmlData>
        </item>
</cutitems>

You can see that the light in question is device number 400, and the two properties are 4141 and 4142.

Now, you can go into the Generic Test macro, and select the Event Logging driver. 

Enter the TXT of "Office Light has been on for PARAM{400,4141} minutes."

Enter the TXT of "Office Light has been on for PARAM{400,4142} minutes today."

When you drag either of these two items into the macro "GENERIC TEST" you'll see the expression "Media-EVENTS - Log Office Light has been on for PARAM{400,4141} minutes or something to that effect.

And that's how you get at any property, for any device.  But, there is a limit to what this tool can log.  For example, in the metadata above, you'll see that there is a metadata pair for <Description>.  The description in the metadata is the description of the metadata and the event, but it is not accessible to be inserted into your logging.  So, if you wanted to use the description "MINUTES_ON_TODAY GREATER THAN OR EQUAL TO 1", you're not able to insert the description of the step within the macro, into what is logged. 

In cases like this, you'll simply need to add the appropriate text to clearly wrap the value of the property so that it is sufficiently descriptive. 

Best of luck to all

Using composer HE, there does not seem to be a way to grab the DeviceID

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.