Announcement

Collapse
No announcement yet.

Vitamin D video surveillance

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    It doen't work. It just opens the cmd line and closing again without writing anything.
    If i make an error to the path i call (c:\program files etc) it does not sent an error or something. So the process ends just with the cmd calling.
    I don't mind to run through the script connector. (I allready run it in the same machine)
    I just did not understand how to do it or what to write in the run command of vitamin d

    The syntax for executing a batch file is :
    cmd.exe /k start C:\Users\Katie\Desktop\lights.bat

    But for calling a script?

    Comment


      #17
      I install VitaminD on the homeseer machine and it working for me with the follow code in "Run the command"
      c:\windows\system32\cscript.exe /B //nologo c:\ithemmet\Scripts\test.vbs

      Check that you have cscript.exe in above folder or change it. It could be a problem with the space in your "program files"

      Try to move the .vbs file to c:\vitamindscript\

      Originally posted by coolgas View Post
      It doen't work. It just opens the cmd line and closing again without writing anything.
      If i make an error to the path i call (c:\program files etc) it does not sent an error or something. So the process ends just with the cmd calling.
      I don't mind to run through the script connector. (I allready run it in the same machine)
      I just did not understand how to do it or what to write in the run command of vitamin d

      The syntax for executing a batch file is :
      cmd.exe /k start C:\Users\Katie\Desktop\lights.bat

      But for calling a script?
      Please excuse any spelling and grammatical errors I may make.
      --
      Tasker Plugin / Speech Droid
      Tonlof | Sweden

      Comment


        #18
        OK i did it. The cscript.exe did not work because it returned an error, without prompt me.
        But when i double click the vbs file, it run through windows and returned the error line 4 char 76, expected end of statement. Its about the
        playing wav file.

        So, i put " ' " in front of it, and ... Now works!!
        I Just wanted to connect the vitamind prog with homeseer and now that you helped me, I can!

        Thank you a lot for your help and your time.
        P.S If you have any comment for not playing the hs.writelog it would be nice, cause i'd like to have a log for the camera . I'll search myself too.
        Thanks again, Kostas
        Last edited by coolgas; March 18, 2011, 07:25 AM.

        Comment


          #19
          Total nube here, I am an IT professional, but my experience is in very large network engineering, my software development experience is almost nonexistent. Your scripts demonstrate to me how much I don't know.

          I guess what I need is a little hand holding, I have HSPro running on an Asus netbook that I happened to have laying around (1.6 GHz Atom, 320 GB HDD, 2 GB RAM), and it is working well controlling a few wall switches and plug in modules. I recently purchased a HSM-100 Multi Sensor and a Foscam FI8909W netcam. I'm using the HSM-100 as an occupancy sensor for my computer room, but it has some minor issues, mostly with not being able to see me while I sitting typing, and timing out and turning off the lights.

          While playing with the netcam, I downloaded the free version of Vitamin D, and have gotten it running. Frankly I'm a bit amazed at what this software is capable of. And can see its potential of being a KILLER occupancy detector. I’m ready to drop the hammer on at least the $50 version, but I think I may have a need in the future for more than two cams, so maybe I’ll go for the Pro version instead.

          All this is, of course, contingent on my ability to fire events in HSPro with it, and frankly at this point I’m not too confident. I’m pretty sure that my netbook doesn’t have the huevos to run HSPro AND Vitamin D, so I’ll need to run the Vitamin D on my PC (i5 Sandybridge with 8GB RAM and a TB of HDD) and use Stipus Script Connector to fire the events.

          Since I have zero experience with scripting anything in HS, VBasic, VStudio, dot net, etc. a little nube hand holding PLEASE! Things like what lines to edit in the scripts, what folders to put them in, how to fire them both in test and production mode; well, you know, nube stuff!

          Oh yea, maybe a link to some help files might be nice.

          Thanks again to anyone willing to help out a nude!


          Originally posted by tonlof View Post
          If you are running VitaminD on other computer then HomeSeer you can use Stipus Script Connector.
          Under Take Actions in VitaminD you call the Scriptconnector and the script c:\homeseer\hsscript.exe vitamind_uppfart_people.vb
          http://board.homeseer.com/forumdisplay.php?f=882

          PHP Code:
          Public Sub Main(ByVal Parms As String)
          hs.writelog("VitaminD","Human Movement")
          hs.TriggerEvent("Cam_Entre")  'Name of Homeseer Event 
          hs.RunEx("Prowl.vb", "main", "Human in front||1", False) '
          This one send pushnotification to iphone.
          End Sub 
          'You can also trigg an action directly on HSTouch with below code.
          PHP Code:
          Dim hstplug As Object      
          hstplug 
          hs.plugin("HSTouch Server")
                  If 
          Not hstplug Is Nothing Then
                      
          ' call the method on the plugin to perform the action
                      hstplug.ClientAction(60, "", "Cam_Front", "")
                  End If 
          If you have vitamind on same machine as homeseer.

          Create a event that open your camera screen on HSTouch.
          Create a command shell script file. (Open notepad and save your file as vitamind.vbs)
          PHP Code:
          Set hs CreateObject("HomeSeer.Application")
          hs.writelog("VitaminD","Human Movement")
          hs.TriggerEvent("Cam_Entre"'Name of Homeseer Event
          hs.PlayWavFileEx hs.GetAppPath & "\wav\human.wav", 0, 50, 50, False, "*:*") '
          If you want to play a wav
          Last edited by wodin; March 11, 2012, 04:06 PM. Reason: Typo

          Comment


            #20
            Your netbook will run HS just fine. I ran on a netbook for over a year with no problems. Definitely dont load up your netbook with processor/memory intensive apps like Vitamin D. Run it on a beefy server like you stated and you'll be fine.
            HS4Pro on a Raspberry Pi4
            54 Z-Wave Nodes / 21 Zigbee Devices / 108 Events / 767 Devices
            Plugins: Z-Wave / Zigbee Plus / EasyTrigger / AK Weather / OMNI

            HSTouch Clients: 1 Android

            Comment


              #21
              Thanks for the reply, I agree, the Asus is dedicated to HS only and will remain that way.

              My problem is that I don't know how to run scripts, especially when the trigger (Vitamin D) is on a remote.

              Comment


                #22
                Really close to have it working thanks to the instructions below.
                I'm getting the error "cannot use parentheses when calling a sub vbscript" when I run the script in the command prompt. I follow the instructions exactly as below. What am I doing wrong? Using VitaminD in the same box as HS.

                The vitamind.vbs script has the following:
                Set hs = CreateObject("HomeSeer.Application")
                hs.writelog("VitaminD","Human Movement")

                Thanks,
                Aldo
                Attached Files

                Comment


                  #23
                  For any others that have the same problem that I had, this is the resolution, remove the "(" as from my previous post, the code should be as below. A special thanks to Adam that helped me with this.

                  hs.writelog "VitaminD","Human Movement"

                  Thanks to "tonlof" for his original codes.

                  Aldo

                  Comment


                    #24
                    WOO HOO! It works! And it's so simple.

                    After installing the Script Connector plugin on my HS computer and the client on my Vitamin D computer, I created a Carport_People.vb file in the C:\Program Files (x86)\HomeSeer HS2\Scripts folder, like this:

                    Public Sub Main(ByVal Parms As String)
                    hs.writelog("VitaminD","Human Movement in CarPort")
                    hs.TriggerEvent("Cam_Entre") 'Name of HomeSeer Event
                    End Sub

                    Then I created a manual event in HSPro called "Cam_Entre" that turns on the Carport lights then turns them off after 3 minutes.

                    Then I set an action in Vitamin D thusly:

                    C:\Program Files (x86)\HomeSeer HS2\HsScript.exe Carport_People.vb

                    And it BROKE!! Saying something about not being able to find the file.

                    Then I remember coolgas saying "Ahhh, I found the path error... I have to write C:\Progra~1\HomeSe~1\OpenUrl.exe to work!!!!!!
                    So, there is the DOS behind ehhh? Now i will try the hsscript.exe commands and vitamind.vbs, but i don't know the right syntax, and what to write in run command, But I will try....."

                    So I played with the 8.3 conventions a little, but couldn't find the combination, so I created a folder in the root called HS, made it executable copied everything in the HomeSeer HS2 folder to it and entered:

                    C:\HS\HsScript.exe Carport_People.vb

                    And walla! It turned on the light then turned it off in three minutes.

                    The caveat is that I played with editing the hs.writelog line to find out which script was actually running, and it turns out that it's the one in the C:\Program Files (x86)\HomeSeer HS2\Scripts folder. There must be an ini file somewhere that stipulates that, but I can't find it. Maybe it uses the path, or it's hard coded in the exe file. I'm wondering if the only thing I need in the HS folder is the HSScript.exe file. Oh well, that's an experiment for another day

                    Comment


                      #25
                      So now I'm wondering how this is going to work.

                      What will happen if someone is in the carport for more than three minutes. Is it going to turn off the lights, then turn them back on?

                      Edit: ok I figured this one out, I added an action at the top of the event to remove delayed actions when the event fires, thus preventing the light from turning off as long as there are people in the zone. The bugger shure does fill up my log file though.

                      Also I have an event to turn on the lights at sunset and another to turn them off 3 hours after sunset (I really need to combine these into a single event), but if it detects a person in the carport, it will probably fire the motion event which will turn them off prematurely (3 minutes after the motion). How can I prevent the motion event from fireing from sunset to sunset + three hours? Conditions don't seem to work for an hs.triggerevent command, I tried putting a nightime condition in the event, but it still triggers at 12:15 PM.

                      Edit: I combided the on at sunset and off 3 hrs later events, but won't be able to test it until it actually happens. And with the motion event interfering, who knows when that will be?

                      Edit 2: Well, that was pretty simple too, I just added and if-then-endif to the script like this:

                      Public Sub Main(ByVal Parms As String)
                      hs.writelog("VitaminD","Human Movement in CarPort")
                      if hs.isoff("Q2") then
                      hs.TriggerEvent("Cam_Entre") 'Name of Homeseer Event
                      end if
                      End Sub

                      Now it only fires the event if the light is off, the only trouble is that it won't remove the delayed actions in the event, so I'll have to figure out how to do it in the script instead, but still turn the light off 3 hours ofter sunset. ARRGH, it hurts the head! Maybe making light off at sunset + 3 hrs as separate event again ... hmm.

                      The motion event takes a few seconds (5 t0 10) to fire, is there any way to make this more responsive?
                      Last edited by wodin; March 25, 2012, 05:07 PM. Reason: did a little more experimanting

                      Comment


                        #26
                        I bought another camera, and installed it in my computer room. I'm using it as a motion/occupancy detector to turn on the lights when I come in there. It's working pretty well as described in my previous post, but I have two issues.



                        Comment


                          #27
                          Originally posted by wodin View Post
                          I bought another camera, and installed it in my computer room. I'm using it as a motion/occupancy detector to turn on the lights when I come in there. It's working pretty well as described in my previous post, but I have two issues.


                          I would highly recommend using a motion detector. A camera is a highly inaccurate motion sensor as it does not really detect motion, it has to compare two images (or more) to determine if there is a movement or not. It is much slower by default.
                          HSPro 3.0.0.458, Z-NET with Z-wave plugin 3.0.1.190, RFXCOM + 2x RFXtrx433E, HSTouch, Squeezebox plugin, iTach IP/WF2IR & GC-100-6 with UltraGCIR, BLDenon, NetcamStudio, Jon00s Webpage builder, Harmony Hub plugin, SCSIP (with FreePBX), Arduino plugin, IFTTT, Pushalot plugin, Device History plugin.
                          Running on Windows 10 (64) virtualized
                          on ESXi (Fujitsu Primergy TX150 S8).
                          WinSeer (for Win10) - TextSeer - FitbitSeer - HSPI_MoskusSample

                          Are you Norwegian (or Scandinavian) and getting started with HomeSeer? Read the "HomeSeer School"!

                          Comment


                            #28
                            Originally posted by Moskus View Post
                            A camera is a highly inaccurate motion sensor. . . It is much slower by default.
                            I might change 'inaccurate' to 'insensitive', but I definitely agree. As I understand it, the authors of Vitamin D have largely moved on, so it is not likely to have any new capabilities in the near future. The only sensitivity adjustments I'm aware of are the length of time an object is visible and its size in pixels.

                            Another option, use the door to the computer room as an occupancy sensor. Door open, light on, door closed, light off. (Sort of like a refrigerator. )
                            Mike____________________________________________________________ __________________
                            HS3 Pro Edition 3.0.0.548, NUC i3

                            HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

                            Comment


                              #29
                              Thanks for the replies, I agree in part, but VDV does have some advantages over "dumb" motion detectors. Those are the ability to differentiate between human and non-human motion, and the ability to graphically define hot zones. The tradeoff is the time delay between the motion and triggering the event.




                              Comment


                                #30
                                Also, keep in mind that the response time will be controlled by the slowest device, so the light may still come on with more delay than you want.

                                Assuming there is no practical way to keep the pets out when the room is not otherwise in use, you may be able to reduce the false triggers by creative placement of the motion sensor. One trick that often works is to place it about 4 feet off the floor pointed up at about 45 degrees. Another is to place it above a 'shelf' such that the shelf blocks its view of the floor.

                                I have the same problem with pets, and I finally gave up on most of my locations. I manually turn on the lights, and use the motion sensor to turn them off after a relatively long delay. That actually works pretty well, but of course requires the extra exertion to manually activate the light switch.
                                Mike____________________________________________________________ __________________
                                HS3 Pro Edition 3.0.0.548, NUC i3

                                HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

                                Comment

                                Working...
                                X