Can't get X10 to work

Forum for questions and support relating to the 1.27.x releases only.
Post Reply
nakkimunakas
Posts: 4
Joined: Wed Sep 03, 2014 12:43 pm

Can't get X10 to work

Post by nakkimunakas » Thu Sep 04, 2014 6:23 am

Hi there

First let me thank everyone involved for this great software.


I've been fighting with Zoneminder for over a month now and now I can get Zoneminder to work properly on Lubuntu 14.04 with ordinary cameras and ip cameras I also got the email notifications to work.

Last step for my needs would be to get the external motion detectors to work.

I have Marmitek CM11E interface connected to COM port then there's TM13G tranceiver and 2 MS13E PIRs.

First I tested the equipment with Marmiteks Activehome software and with that everything works ok. Then I followed these instructions combined with some other hints and tips and now the log says X10 server starting and such without errors.

zmx10.pl -u 1 -c on
zmx10.pl -u 1 -c off

commands works and when using those commands Zoneminder log says "got signal X10 A01 ON/OFF" but when when the TM13 got activated by PIR zoneminder doesn't see it. I've been testing zoneminder with multiple computers an in one setup zoneminder log did receive couple off X10 A01 OFF commands but not the ON commands.

zmx10.pl -u 1 -c commands only work with sudo or in root terminal is this normal or is there some rights things messed up?

Also when Zoneminder log does see X10 command nothing happens, no recording takes place nor any events appear.


Thing is that I don't know what i'm doing. Mostly I'm just copying commands to terminal and hoping for the best. I did take a look at the zmx10.pl and zmtrigger.pl but I suck at everything that got to do with code.

I really like Zoneminder but if I can't get those external PIRs to work I have to admit defeat and turn to some commercial Windows software and I really hate Windows!

luwii
Posts: 8
Joined: Thu Dec 27, 2012 9:24 pm

Re: Can't get X10 to work

Post by luwii » Tue Mar 10, 2015 10:26 am

I'm basically in the same boat as you were. Don't really know what I'm doing but hacked it to the same point as you were.

I can get the command line to work, but a camera in alarm mode does nothing. Settings in the monitor setup for X10 don't seem to stay at all. (direct database entry or not) Using V1.28.1

Did you make any progress?

luwii
Posts: 8
Joined: Thu Dec 27, 2012 9:24 pm

Re: Can't get X10 to work

Post by luwii » Wed Mar 18, 2015 5:01 pm

I was trying to get an alarm condition to trigger an X10 action, but I eventually gave up on the built-in X10 side of things.
Here is a relatively obvious way to get the same result.

Basically follow the example Perl script (in the wiki or doc page, can't remember) to monitor for any alarm condition. I included my version below, as it has some minor syntax tweaking to make it run. (I don't know Perl and the example did not work for me)
Then you can use any other tool to communicate X10 command. I used heyu in this example to test and that worked fine. (See the section 'Do your stuff here' in the code )
Just run this process somewhere, and all is well.

Code: Select all

#!/usr/bin/perl -w
#use strict;
use ZoneMinder;

$| = 1;

my $dbh = DBI->connect( "DBI:mysql:database=".$Config{ZM_DB_NAME}.";host=".$Config{HOST}.";port=".$Config{PORT}, $Config{ZM_DB_USER}, $Config{ZM_DB_PASS} );

my $sql = "select M.*, max(E.Id) as LastEventId from Monitors as M left join Events as E on M.Id = E.MonitorId where M.Function != 'None' group by (M.Id)";
my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() );

my $res = $sth->execute() or die( "Can't execute '$sql': ".$sth->errstr() );
my @monitors;
while ( my $monitor = $sth->fetchrow_hashref() )
{
    push( @monitors, $monitor );
}

print( "\n\nRunning zmAlarmMonitor\n");
while( 1 )
{
    foreach my $monitor ( @monitors )
    { 
        #print( "In while\n");
        #print( "Monitor \n".$monitor->{Name});
        next if ( !zmMemVerify( $monitor ) );
        
        if ( my $last_event_id = zmHasAlarmed( $monitor, $monitor->{LastEventId} ) )
        {
            $monitor->{LastEventId} = $last_event_id;
            $datestring = gmtime();
            print( "$datestring : Monitor ".$monitor->{Name}." has alarmed\n" );
            #
            # Do your stuff here
            #
            system("/usr/local/bin/heyu", "on", "a4");
            
        }
    }

    sleep( 1 );
    $datestring = gmtime();
    print( "$datestring" );
    print "\r";


nakkimunakas
Posts: 4
Joined: Wed Sep 03, 2014 12:43 pm

Re: Can't get X10 to work

Post by nakkimunakas » Sat Jun 25, 2016 4:40 pm

luwii wrote:Did you make any progress?
F that!

What I did was that I bought X10 controlled power sockets for the wired old school cameras. When camera doesn't get juice picture is black, power comes on picture also comes on and modect sees this as movement and records a clip. This does't work for wireless IP cams of course so they just have rely on video motion detection - which sucks. But I don't really care anymore.

Not only that I had to install these systems for friends when they saw my system and for them I just went with the default video motion detection and told them that I'ts going to give lot off false alarms so live with it.(I also told them that this system could work a lot better if it was installed by someone who knew what he was doing).

What comes to those commercial softwares they suck even more than zoneminder. (Most likely I didn't know how to use those either).

I've chosen my path which is zoneminder but still I hate this shit :evil:

Zoneminder is awesome software but I'm just not qualified to use it.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests