www.homeseer.com

Go Back   HomeSeer Message Board > 3rd Party Plug-Ins/Scripts > Doo Plug-Ins & Scripts > Motion Sensor Plug-In

Motion Sensor Plug-In Discussions relating to the DooMotion plug-in, provided by Jim Doolittle.

We are all saddened by the loss of Jim Doolittle in early April, 2010. A kind and helpful person who contributed much to our HS community. At this time we are uncertain of what will happen with his plug-ins and scripts, so if you are visiting these forums for the first time in search of support, please understand that the community of users of his software can only do the best they can to try to help.

Reply
 
Thread Tools Display Modes
  #1  
Old August 22nd, 2009, 03:16 PM
tonlof's Avatar
tonlof tonlof is offline
Seer Master
 
Join Date: Apr 2001
Location: Koping,Sweden
Posts: 599
Default Query time from last motion/no motion?

Can I make an inquiry about how long it was not been any movement from a given sensor? I want the room lights to be switched off after eg 10 minutes after no motion activated
__________________
Please excuse any spelling and grammatical errors I may make.
--
Tony Lofgren | Sweden
HS Pro, Win 2003, MySQL, HP ProLiant DL380 G4, 6 x 300Gb raid5, Velleman K8055 , TEMP05 V5.00, DS9097, 1Wire Dallas weatherstation, HS PCI Modem, Basic Stamp for I/O, AVS-8X8, Popcorn Hour C-200.
Reply With Quote
  #2  
Old August 22nd, 2009, 04:32 PM
rmasonjr's Avatar
rmasonjr rmasonjr is online now
Super Seer
 
Join Date: May 2001
Location: Brookhaven, MS USA
Posts: 1,723
Default

If you use doomotion's Custom Action Code (CAC), you can do this like so.

In the ON code:
PHP Code:
if(hs.isOffByName("Master Bedroom Robs Closet Light")) then
    hs
.execX10ByName("Master Bedroom Robs Closet Light","on")
end if
dm.newNoMotionDelayedEvent("Delayed Event Master Bedroom Robs Closet Light""Master Bedroom Robs Closet Light:off",2
This will turn off my closet light after 2 mins

In the OFF code - just to ensure the light gets turned off:

PHP Code:
If Sensor.FailSafeInvoked Then
   hs
.execX10ByName("Master Bedroom Robs Closet Light","off")
end If 

Hope this helps...
__________________
Dell Inspiron 1010 Atom 1.33Ghz / 1G RAM
HSPRO 2.4.0.59/ Z-Troller v1.15 / Z-Wave devices / 2 WDTC-20 thermostats
TI-103 / WGL800 / RFXCom~AC-RF2 / Oregon Scientific Sensors / Motion Sensors / X10 devices / DS10a
Check out Homeseer's YouTube Channel!
Reply With Quote
  #3  
Old August 23rd, 2009, 05:11 PM
tonlof's Avatar
tonlof tonlof is offline
Seer Master
 
Join Date: Apr 2001
Location: Koping,Sweden
Posts: 599
Default

Thank you, I have tried to paste the code but get error.
PHP Code:
2009-08-23 23:06:23  Error Script compile error'#End Region' must be preceded by a matching '#Region'.on line 20
2009
-08-23 23:06:25  SCR Option Strict Offimports Schedulerimports SystemPublic Module scriptcode20#Region "Automatically generated code, do not modify"'Automatically generated code, do not modify'Event Sources Begin    <System.ContextStaticAttribute()> Public WithEvents hs As Scheduler.hsapplication    <System.ContextStaticAttribute()> Public WithEvents hsp As scheduler.hsp    <System.ContextStaticAttribute()> Public WithEvents hssystem As scheduler.phone0'Event Sources End'End of automatically generated code#End RegionDim dm As Object = hs.Plugin("DooMotion")Dim Sensor As Object = dm.GetSensorByRef(4998)#End Region' NOTE: Do NOT change the names of the Sensor procedures. #Region " Custom Action Code for Motion Entre "Sub Sensor7867_On(ByVal Ref As Integer)'Script_Initialize(Ref)'add code here'Script_Terminate()End SubSub Sensor7867_Off(ByVal Ref As Integer)'Script_Initialize(Ref)'add code here'Script_Terminate()End SubSub Test(ByVal parms As Object)If DateDiff("n", Sensor.LastOn, Now) > Sensor.NormalElapsedTime Then hs.speak "Someone is at the front door, Motion at the front door" End SubEnd Module 
I have also tried by housecode

PHP Code:
if(hs.isOff("A8")) then 
    hs
.execX10("A8","on"
end if 
dm.newNoMotionDelayedEvent("Delayed Event Master Bedroom Robs Closet Light""A8:off",2
__________________
Please excuse any spelling and grammatical errors I may make.
--
Tony Lofgren | Sweden
HS Pro, Win 2003, MySQL, HP ProLiant DL380 G4, 6 x 300Gb raid5, Velleman K8055 , TEMP05 V5.00, DS9097, 1Wire Dallas weatherstation, HS PCI Modem, Basic Stamp for I/O, AVS-8X8, Popcorn Hour C-200.
Reply With Quote
  #4  
Old August 23rd, 2009, 06:11 PM
rmasonjr's Avatar
rmasonjr rmasonjr is online now
Super Seer
 
Join Date: May 2001
Location: Brookhaven, MS USA
Posts: 1,723
Default

Sorry - forgot to mention that I use VB.NET Scripting. In the Options pane, select "Use VB.NET Scripting"
__________________
Dell Inspiron 1010 Atom 1.33Ghz / 1G RAM
HSPRO 2.4.0.59/ Z-Troller v1.15 / Z-Wave devices / 2 WDTC-20 thermostats
TI-103 / WGL800 / RFXCom~AC-RF2 / Oregon Scientific Sensors / Motion Sensors / X10 devices / DS10a
Check out Homeseer's YouTube Channel!
Reply With Quote
  #5  
Old August 23rd, 2009, 06:13 PM
tonlof's Avatar
tonlof tonlof is offline
Seer Master
 
Join Date: Apr 2001
Location: Koping,Sweden
Posts: 599
Default

I have tried it with and without...
__________________
Please excuse any spelling and grammatical errors I may make.
--
Tony Lofgren | Sweden
HS Pro, Win 2003, MySQL, HP ProLiant DL380 G4, 6 x 300Gb raid5, Velleman K8055 , TEMP05 V5.00, DS9097, 1Wire Dallas weatherstation, HS PCI Modem, Basic Stamp for I/O, AVS-8X8, Popcorn Hour C-200.
Reply With Quote
  #6  
Old August 23rd, 2009, 06:15 PM
tonlof's Avatar
tonlof tonlof is offline
Seer Master
 
Join Date: Apr 2001
Location: Koping,Sweden
Posts: 599
Default

With vb.net I get this error.
PHP Code:
2009-08-24 00:13:49  SCR Option Strict Offimports Schedulerimports SystemPublic Module scriptcode10#Region "Automatically generated code, do not modify"'Automatically generated code, do not modify'Event Sources Begin     Public WithEvents hs As Scheduler.hsapplication     Public WithEvents hsp As scheduler.hsp     Public WithEvents hssystem As scheduler.phone0'Event Sources End'End of automatically generated code#End RegionDim dm As Object = hs.Plugin("DooMotion")Dim Sensor As Object = dm.GetSensorByRef(4998)'#End Region' NOTE: Do NOT change the names of the Sensor procedures. '#Region " Custom Action Code for Motion test_ljus "Sub Sensor9616_On(Ref)'End SubSub Sensor9616_Off(Ref)'End SubSub Test(ByVal parms As Object)if(hs.isOffByName("Master Bedroom Robs Closet Light")) then    hs.execX10ByName("Master Bedroom Robs Closet Light","on")end ifdm.newNoMotionDelayedEvent("Delayed Event Master Bedroom Robs Closet Light", "Master Bedroom Robs Closet Light:off",2)  End SubEnd Module
2009-08-24 00:13:49  Error Script compile errorStatement cannot appear within a method bodyEnd of method assumed.on line 29 


Do I need any referense in settings.ini?
__________________
Please excuse any spelling and grammatical errors I may make.
--
Tony Lofgren | Sweden
HS Pro, Win 2003, MySQL, HP ProLiant DL380 G4, 6 x 300Gb raid5, Velleman K8055 , TEMP05 V5.00, DS9097, 1Wire Dallas weatherstation, HS PCI Modem, Basic Stamp for I/O, AVS-8X8, Popcorn Hour C-200.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 09:29 PM.


Copyright 1998-2008 HomeSeer Technologies, LLC