X10 output not working in my setup!?

Forum for questions and support relating to the 1.24.x releases only.
Locked
zappen
Posts: 12
Joined: Wed May 20, 2009 4:34 pm

X10 output not working in my setup!?

Post by zappen »

Hi alls! i'm triing the mighty ZoneMinder for the first time, i'm not yet very familiar with linux but i'm getting better, and after some installations i finally got the system up, version 1.24.1, following this guide:
http://www.zoneminder.com/wiki/index.ph ... ola-0.7%29

My problem actually it's with the X10 output, it doesn't work...
i noticed in the settings/general tab of my Monitor there is a X10 triggers checkbox, i check it, save, but it will always come back as unchecked.
is that checkbox needed for the X10 output? what could be wrong? could anyone please check if you can enable this checkbox and if stays on??

X10 is enabled in the options, ports and codes are ok,
if i launch the command zmX10.pl with the state/Housecode/unitcode parameters the switch turns on/off, so the system is talking correctly with it.

looking for some help/hint... i tried checking the extended logs @ level 5 but couldn't get a clue :)

Thanks inadvance and congrats for this cool software!
zappen
Posts: 12
Joined: Wed May 20, 2009 4:34 pm

Post by zappen »

just installed 1.23.3 thru get-apt on a kubuntu 8.10 fresh updated installation, the X10 triggers checkbox stays saved in this version/installation, anyone using 1.24.1 can please try and report me if your X10 triggers checkbox stays saved checked?
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

What error does apache produce?
zappen
Posts: 12
Joined: Wed May 20, 2009 4:34 pm

Post by zappen »

i don't have the box here, i'll check tomorrow! btw can you enable X10 triggers in 1.24.1 (general tab)?
Reece
Posts: 3
Joined: Thu Jun 04, 2009 12:11 am

Post by Reece »

It looks like ZoneMinder 1.24.1 support of X10 alarm output is partially broken. It generates "alarm end" actions just fine, but never generates "alarm start" actions.

The easiest way to verify this is to set your X10 device into the "alarm active" state, then trigger an alarm. When ZoneMinder decides the alarm is over, your X10 device will switch to the "alarm inactive" state.

The problem is in the zmx10.pl script. It's is looking for a transition from IDLE or TAPE state to ALARM or ALERT state to trigger an X10 "alarm active" action, but the sequence I see is from IDLE to PREALARM to ALARM state. This doesn't meet the match criteria.

So... how do you fix it?

Bring up the zmx10.pl script in an editor. Go to line 306 -- you should see something like this (with a few lines for context):

Code: Select all

					if ( ($state == STATE_ALARM || $state == STATE_ALERT) && ($monitor->{LastState} == STATE_IDLE || $monitor->{LastState} == STATE_TAPE) ) # Gone into alarm state
					{
						Debug( "Applying ON_list for $monitor_id\n" );
						$task_list = $monitor->{"ON_list"};
					}
It's this "if" condition that needs fixing to add STATE_PREALARM to the valid LastState values. I changed it to look like this:

Code: Select all

					if ( ($state == STATE_ALARM || $state == STATE_ALERT) &&
					     ($monitor->{LastState} == STATE_IDLE || $monitor->{LastState} == STATE_PREALARM || $monitor->{LastState} == STATE_TAPE) ) # Gone into alarm state
					{
						Debug( "Applying ON_list for $monitor_id\n" );
						$task_list = $monitor->{"ON_list"};
					}
Give this a try. I want to do some more testing, but if it holds up I'll get around to submitting it as a patch eventually.
Reece
Posts: 3
Joined: Thu Jun 04, 2009 12:11 am

Post by Reece »

My problem actually it's with the X10 output, it doesn't work...
i noticed in the settings/general tab of my Monitor there is a X10 triggers checkbox, i check it, save, but it will always come back as unchecked.
is that checkbox needed for the X10 output? what could be wrong? could anyone please check if you can enable this checkbox and if stays on??
It looks like if you define a monitor and then turn on the X10 support in the global options, you can't check the X10 checkbox for the existing monitor. However, if you already have the X10 option enabled, newly created monitors can have the X10 box checked.

What's happening in the first case is the "Triggers" field of the "Monitors" table ends up blank, which is bad. If you've already enabled X10 support when the monitor is created, this field ends up containing the string "X10".

I'm not much of a PHP, Perl, or HTML guru, so I hope someone else who is will fix this.
zappen
Posts: 12
Joined: Wed May 20, 2009 4:34 pm

Post by zappen »

Hi Reece thanks for the replyes :)
Reece wrote:However, if you already have the X10 option enabled, newly created monitors can have the X10 box checked.
i brought the box home so i'll do some more tests/debugging, now i just tested what you said and during the tests the monitors created after the X10 option was enabled weren't keeping the X10 checkbox enabled. i tried also this way, disabled X10, restarted ZM, enabledx10, restarted ZM, created a new monitor and enabled the X10 checkbox togheter with all the settings, and one time i seen the checkbox still there, but after a while it poped up still unchecked, so the problem persists.. maybe it's related with the typo bug that i reported yesterday? bugs like me ;)
Locked