X10 Community Forum

💬General Category => General Discussion => Topic started by: Tids on February 26, 2012, 03:04:24 AM

Title: Blue iris to switch on lamp
Post by: Tids on February 26, 2012, 03:04:24 AM
Hi all

This is my first post and am new to X10, so please bear with me. I am loving the forums and looks like I have so much info to digest !

I have read through the forums with great excitement and am looking forward to the challenging but fun world of macros etc .

I thought I would start off with something straightforward (it is when you know the answer )

I have been running Blue iris software for my security camears for sometime now and am very pleased with it.

However, this I want to intergrate with AHP to control some lighting.
At this stage all I want to achieve is turn a lamp on in the front room when motion is detected on the front camera.  Blue iris has the ability to run a script or program when motion is detected.

This is where I'm stumped ???  where do I point Blue Iris to set off a macro (if needed) just to turn a single lamp on  ??? do I need SDK


Thanks Steve
Title: Re: Blue iris to switch on lamp
Post by: hawk1 on February 26, 2012, 08:50:23 AM
Do a search for ahcmd.exe on your computer.  I can't remember if AHP comes with it or not.  If not you will have to download the sdk from x10's website.

ahcmd is a command line program for AHP.   With it you can turn on your lamp when motion is detected.

The sdk has examples to help you get started, but if you need more help just post here.
Title: Re: Blue iris to switch on lamp
Post by: Brian H on February 26, 2012, 08:57:21 AM
http://www.x10.com/activehomepro/sdk/index.html
Title: Re: Blue iris to switch on lamp
Post by: Tids on February 26, 2012, 12:16:42 PM
Hi guys

Thanks for reply. I have downloaded SDK which gave me no end of problems (Stopped AHP working) I have downloaded a newer version of AHP and it seems to run now. However I can not register it as have no registration code. I purchased it from really clever homes, so now will have to contact them to obtain code I guess  ???  Is this stopping me obtaining full functionality  ???

I have spent a further two hours today  B:(  trying to see what the next step is regarding the SDK download.  (please bear in mind I have no experience of programming  :(

Some more pointers in the right direction on what to do next would be greatly appreciated as I'm Stumped

Steve
Title: Re: Blue iris to switch on lamp
Post by: Brian H on February 26, 2012, 12:24:03 PM
They should have given you the code when you bought it.
Did you do a fresh installation or use the update program in the software area?
http://www.x10.com/support/support_soft1.htm
Title: Re: Blue iris to switch on lamp
Post by: Tids on February 26, 2012, 12:33:33 PM
Hi Brian

I used the update link in the download area. I think its working fine but will contact retailer in the morning to request one just to confirm that I have done all I can to confirm updated version of software. I would like to get it registered

Steve
Title: Re: Blue iris to switch on lamp
Post by: hawk1 on February 26, 2012, 01:46:19 PM
You also might give iHouse a try, does a lot more and it's free!

http://www.ihousehomeautomation.com/phpBB/index.php?sid=85787beeba22e61ecf2be60025999777
Title: Re: Blue iris to switch on lamp
Post by: Tids on February 27, 2012, 07:20:04 AM
Hi Guys

I will take a look at Ihouse and give it ago. Still need to resolve the issue below  ???

I am still stumped on how to create a file that will trigger the macro in order to switch on the lamp.

Just to confirm that I am on the right wavelength.

1 create a macro to switch on and off the lamp (this I understand how to do)
2 Create a file that will trigger the macro in order to get the process going (this is what I do not understand how to do)
3 Point Blue Iris at this file in order to start off the Macro ( BI is capable of running scripts and programs, I just don't know what file to point it to)

Very frustrated

Steve
Title: Re: Blue iris to switch on lamp
Post by: hawk1 on February 27, 2012, 08:21:43 AM
Make a batch file called whatever.bat

use this as an example and change the house and unit code to match your lamp.

@ echo off
cd\
ahcmd sendplc c2 on

Now on your alerts in BI run this batch file..

You might have to find ahcmd.exe and copy it into the root directory or windows directory.
Title: Re: Blue iris to switch on lamp
Post by: Tids on February 27, 2012, 08:27:31 AM
Thanks Hawk1

I will try that. Thanks for pointing me in the right direction  >!
Title: Re: Blue iris to switch on lamp
Post by: Tids on February 27, 2012, 08:50:14 AM
Ok

I dont seem to have a ahmcd.exe file  ???

have searched on pc and even looked in AHP folder ????
Title: Re: Blue iris to switch on lamp
Post by: Brian H on February 27, 2012, 09:01:00 AM
On my XP computer. It is in C:\Programs\AHSDK\bin
It looks like it is part of the AHP SDK installation.
Title: Re: Blue iris to switch on lamp
Post by: Tids on February 27, 2012, 09:23:38 AM
Ok, thanks Brian it is where you suggested (I think its the right file)

I have found the ahcmd file but it is the appliation file, is this the same as the exe file ??

Just to confirm do I cut or copy this file into the same folder as the AHP program files ?

Thanks Steve
Title: Re: Blue iris to switch on lamp
Post by: hawk1 on February 27, 2012, 10:00:28 AM
Yes it is an application file.  Just copy ahcmd.exe to the root directory or your windows directory.
Title: Re: Blue iris to switch on lamp
Post by: Tids on February 27, 2012, 10:29:32 AM
Thanks guys

You have made my day. it works  #:) The lamps switches on when I hit the test button in BI.

Just want to confirm that all I need to do now is change the address code in the batch file to the relavant house address etc, and this will operate whatever I want (multiple batch files for whatevers needed)

I now just need to change the batch file to trigger the macro to start, is that correct, rather than the lamp itself ?

You may be thinking why don't I just try it but am VPNing to home from work to test this out, so manually cannot change the address codes on the unit.

Am I correct in my assumption ?

Thanks again, I would of given up with this otherwise  :'(

Steve
Title: Re: Blue iris to switch on lamp
Post by: Tids on February 29, 2012, 05:18:40 AM
Hi guys

Need your help again I'm afraid

I have now got all of the above up and running as I want, however seem to be stuck on a macro problem  :-[

The table lamp is set on a timer to come on at dusk and go off at 22.15 everyday .

I also have the Blue Iris camera to trigger it on when motion detected after dusk (switch on for two Min's, then off)

I cannot seem to work out how to make it dim when motion is triggered early evening when we are still in front room and the lamp is on (this I would use to indicate that the front camera has been triggered)
If its 2.00 in the morning for example it wouldn't matter because it would be off anyway so would just switch on for two Min's then off, to deter intruders.

 I have read the chapter about flags as I think this is may resolve my problem but cant seem to work out how to use them  ???

So just to confirm I want

Lamp (A3) to switch on at dusk and switch off at 22.15.  (Got this working)

Lamp (A3) to dim (when its on, this would be the early part of evening when we are still up)) for 30 secs if triggered by A4 (A4 , this is the on command/trigger from camera)

If Lamp (A3) is off ( later part of evening when we have gone to bed) to switch on (A4 trigger/camera) and stay on for two Min's then switch off.

OR am I tackling this the wrong way ?

I have attached an image of the setup so far!

(http://dl.dropbox.com/u/18696723/Macro.gif)

 Thanks Steve
Title: Re: Blue iris to switch on lamp
Post by: hawk1 on February 29, 2012, 09:07:24 AM
Someone else might have to chime in because I'm not using AHP anymore.  But I would think you could do this with an (else statement).
Title: Re: Blue iris to switch on lamp
Post by: Tids on February 29, 2012, 04:10:28 PM
Thanks Hawk1

Perhaps it can be done with flags? Have read up on them but can't seem to grasp the concept.

Anyone else help me with this or should I post it somewhere else ?

Thanks

Steve
Title: Re: Blue iris to switch on lamp
Post by: Tids on March 01, 2012, 08:11:27 AM
This will be a  no then  ???

Or should I post eleswhere ?
Title: Re: Blue iris to switch on lamp
Post by: Dan Lawrence on March 01, 2012, 01:02:55 PM
Where did you get your AHP?   From what you posted I see Marmitec to the right of  Active Home Professional so it must not have come from X10.
Title: Re: Blue iris to switch on lamp
Post by: Tids on March 01, 2012, 02:16:02 PM
Hi

I purchased it via Amazon with with the CM15pro, thought it was all off the same thing ???
Title: Re: Blue iris to switch on lamp
Post by: hawk1 on March 01, 2012, 03:31:35 PM
It pretty much is the same thing.  The Marmitek is the UK version of Active Home Pro, but should still work like AHP.  Tids, do a search on flags.  There is several good posts about them.  Here is a link to one:

http://forums.x10.com/index.php?topic=4590.msg33663#msg33663
Title: Re: Blue iris to switch on lamp
Post by: Tids on March 01, 2012, 03:57:57 PM
Thanks Hawk1, your help is very much appreciated

Will have another read and see if I can absorb a bit more ! Frustrating but addictive this x10 stuff

Thanks

Steve
Title: Re: Blue iris to switch on lamp
Post by: chinaboy on September 18, 2012, 09:48:11 PM
Make a batch file called whatever.bat

use this as an example and change the house and unit code to match your lamp.

@ echo off
cd\
ahcmd sendplc c2 on

Now on your alerts in BI run this batch file..

You might have to find ahcmd.exe and copy it into the root directory or windows directory.

Hi, I use this procedure to turn on my lights when motion is detected by the camera, but can someone guide me on how to prevent the lights from coming on during the day? And if the lights come on at night from motion, how can it make them go off after a couple minutes of no motion detection from the cam?

Thanks