Announcement

Collapse
No announcement yet.

Z-Wave Lock Events Script - Discussion Thread

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

    #61
    Originally posted by Sireone View Post
    This worked like a champ. Didn't need to declare the Email variable.

    Thanks,

    -Devon
    Awesome. Glad my measly hack job worked for you. Don't really have much scripting experience.

    I meant the declaration was probably going to be needed if you used your addition since I didn't see it declared anywhere in the script.

    Comment


      #62
      Originally posted by sparkman View Post
      It was intended to be used in HSTouch or other interfaces and show the last 10 lock events. Most logging child devices will only show the last event.

      Cheers
      Al
      Even with your script? I know when I accidentally tested using the child device instead of the manually created one it showed the last 10 items in the text file within that child device. i ask because I don't know what it is actually for and am wondering if it can take the place of the manually created device so that HS is less cluttered without breaking anything.

      Comment


        #63
        Originally posted by doomngloom View Post
        Even with your script? I know when I accidentally tested using the child device instead of the manually created one it showed the last 10 items in the text file within that child device. i ask because I don't know what it is actually for and am wondering if it can take the place of the manually created device so that HS is less cluttered without breaking anything.
        I had not considered using the lock's actual notification device. Having thought about it, I don't see a big issue with using it, but you do run the risk of the lock sending some info that would overwrite the last 10 log. If you can live with that, then it should be fine.

        Cheers
        Al
        HS 4.2.8.0: 2134 Devices 1252 Events
        Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

        Comment


          #64
          Thanks. Was just Curious. I'm good with the way it is now. Would be nice to not have unneeded devices listed for less clutter but I'm not good enough with understanding the system fully yet to try and modify things like that. Working on a Smoke/Co sensor script currently which i hope will allow me to understand things a bit better.

          Question for you though. On the script i am working on i am using your script as a template on how it should look with notations and the format. Since i am doing that should i be putting you in as a notation that it is based off your script? I dont want to not give credit where its due but since im not a dev i dont know how this works and dont want to get yelled at down the road that im using someone elses format without giving credit.

          Comment


            #65
            Originally posted by doomngloom View Post
            Thanks. Was just Curious. I'm good with the way it is now. Would be nice to not have unneeded devices listed for less clutter but I'm not good enough with understanding the system fully yet to try and modify things like that. Working on a Smoke/Co sensor script currently which i hope will allow me to understand things a bit better.

            Question for you though. On the script i am working on i am using your script as a template on how it should look with notations and the format. Since i am doing that should i be putting you in as a notation that it is based off your script? I dont want to not give credit where its due but since im not a dev i dont know how this works and dont want to get yelled at down the road that im using someone elses format without giving credit.
            No worries, thanks for asking and no need to give me credit for just using the same format.

            Cheers
            Al

            PS I have a script for the zcombo as well if you want to take a look at it. I based it on the lock script too.
            HS 4.2.8.0: 2134 Devices 1252 Events
            Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

            Comment


              #66
              Sorry, I know this has been asked and answered in this thread already but I'm still not able to find the location of the \data\locks directory.

              I'm running HS3 on a HomeTroller SEL that I purchased just a couple of weeks ago and I'm definitely very new to HomeSeer.

              I've set up directories in the following locations but still don't find a log file being created.

              /home/homeseer/data/Locks
              /home/homeseer/Data/Locks
              /usr/local/HomeSeer/Data/Locks

              Comment


                #67
                The script uses \data\Locks\ so I think that the full path should be /usr/local/HomeSeer/data/Locks. What entry in the log do you get if you run the following immediate script command under Tools - Control Panel:

                Code:
                &hs.writelog("Test",hs.GetAppPath)
                Cheers
                Al
                HS 4.2.8.0: 2134 Devices 1252 Events
                Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                Comment


                  #68
                  Originally posted by sparkman View Post
                  The script uses \data\Locks\ so I think that the full path should be /usr/local/HomeSeer/data/Locks. What entry in the log do you get if you run the following immediate script command under Tools - Control Panel:

                  Code:
                  &hs.writelog("Test",hs.GetAppPath)
                  Cheers
                  Al
                  I get /usr/local/HomeSeer back. Thanks for that assist. I do have a directory there

                  /usr/local/HomeSeer/Data/Locks

                  and my edited version of the script includes

                  Dim DoorLogName As String = hs.GetAppPath & "\Data\Locks\" & lock & ".txt"

                  Note: Case in \Data\Locks matches directory names

                  Do I need to create the logfile too?

                  Comment


                    #69
                    Originally posted by JimiB View Post
                    I get /usr/local/HomeSeer back. Thanks for that assist. I do have a directory there

                    /usr/local/HomeSeer/Data/Locks

                    and my edited version of the script includes

                    Dim DoorLogName As String = hs.GetAppPath & "\Data\Locks\" & lock & ".txt"

                    Note: Case in \Data\Locks matches directory names

                    Do I need to create the logfile too?
                    Try creating the files manually and see if it works then. I'm working on a revamp that'll make it much easier to setup.

                    Cheers
                    Al
                    HS 4.2.8.0: 2134 Devices 1252 Events
                    Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                    Comment


                      #70
                      Originally posted by sparkman View Post
                      Try creating the files manually and see if it works then. I'm working on a revamp that'll make it much easier to setup.

                      Cheers
                      Al
                      Figured it out. Needed to change direction of \ from
                      Code:
                      Dim DoorLogName As String = hs.GetAppPath & "\Data\Locks\" & lock & ".txt"
                      to
                      Code:
                      Dim DoorLogName As String = hs.GetAppPath & "/Data/Locks/" & lock & ".txt"
                      Haven't written any code in years so I'm re-learning.

                      Sparkman,

                      This is the number one problem I need to solve. I'm considering migrating from Nexia to HomeSeer. Nexia has it's problems but the UI is very simple and geared towards end users. I program 2 - 6 new door codes daily and can easily match the codes to names, not numbers. If I can figure out a way to do that on HomeSeer I may make the switch but it has been a challenge to just get this far.

                      If you want to discuss how this feature works on Nexia I am happy to bend your ear. Anything I can do to assist your development let me know. Thanks for the quick responses and the work you've already done on this script.

                      Comment


                        #71
                        Originally posted by JimiB View Post
                        If you want to discuss how this feature works on Nexia I am happy to bend your ear. Anything I can do to assist your development let me know. Thanks for the quick responses and the work you've already done on this script.
                        Sure, if you can point me to some documentation, that would be great.

                        Cheers
                        Al
                        HS 4.2.8.0: 2134 Devices 1252 Events
                        Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                        Comment


                          #72
                          Originally posted by sparkman View Post
                          Sure, if you can point me to some documentation, that would be great.

                          Cheers
                          Al
                          There's no documentation as this is all "user-stupid" built in functionality in Nexia. Here's screenshots showing how I do this. Note, all I had to do to enable this was connect my Schlage locks to Nexia - equivalent of "Add/Include a Node" in HomeSeer. Once you do that, a single device shows up in your list with easy to manage functionality built in. This is just part of it.

                          1) To program a new door lock code associated to a guest name I log into the MyNexia web portal, select "Security & Sensors" menu, scroll down to the page until I see the status section for the lock I want - (see attached image ProgramDoorLock-0.jpg)

                          2) I click on the "Edit User Code" button, and get a list of all my existing user codes that I have already programmed for guests. Each code shows the guest name but the code is masked. I can edit the code but cannot see the existing code. There are 2 types of codes I can program. First is the list of "Always Active" codes for this lock. Bonus - when I create one of these "Always Active" codes I can select from a list of all my locks to add it to so I only have to do it once for multiple locks.

                          3) Further down this list I see my list of existing "Scheduled Codes". (see attached image ProgramDoorLock-1.jpg).

                          4) When I click on the button to "Add Scheduled Code" I get the page shown in attached image ProgramDoorLock-2.jpg with the default being to create a "Weekly Recurring Schedule".

                          5) Selecting the radio button for a "One Time Schedule" I get the page shown in ProgramDoorLock-3.jpg. Once I set the Name, Code, Start and End date/times that's it. The code will be enabled for that particular lock only on the Start date/time and then will be disabled at the End date/time.

                          6) Finally, ProgramDoorLock-5.jpg shows the Event Log. It's easy to see which guest by name used their door code to unlock a specific door.

                          Again, this is all built in functionality in Nexia. No programming required. There's no documentation because who needs it?

                          Now, I'm not expecting you would replicate this - that would be a bigger project than I'm guessing you're are up for. (Though you could probably sell quite a few copies if you did.) I'm really just giving you this so you can see where I'm coming from by considering moving from Nexia to HomeSeer.

                          The Nexia system is really nice from a user perspective - architecturally it sucks. In just 2 weeks I've found that HomeSeer has much better hardware and it's incredibly fast. Nexia only runs via web so if my internet connection goes down I'm toast. There is no backup/restore. I need to manage 3 buildings on one lot which requires 3 separate Nexia installs with 3 monthly fees = $359/year ongoing in addition to purchasing 3 Nexia bridges at $100 each. My first bridge is already almost falling apart after 2 years of very careful use so will probably need to replace it soon anyway. With no backup/restore that means when I do I have to rebuild my Zwave network from scratch. Support for new Zwave devices is slow coming. The few cameras compatible with Nexia have horrible reviews. (Nexia has been promising new ones for a while but haven't seen them yet.)

                          I could go on but I've already droned on here more than I'm sure you wanted. Hope the description above is helpful. I'm looking forward to seeing what you come up with. For now, I'm going to work with the existing scripts and try to learn my way around HomeSeer. I'll let you know if I learn anything that might be useful.
                          Attached Files

                          Comment


                            #73
                            Originally posted by JimiB View Post
                            I could go on but I've already droned on here more than I'm sure you wanted. Hope the description above is helpful. I'm looking forward to seeing what you come up with. For now, I'm going to work with the existing scripts and try to learn my way around HomeSeer. I'll let you know if I learn anything that might be useful.
                            Great, thanks for the info. I'll take some time to digest that to see what can be done in HS.

                            Cheers
                            Al
                            HS 4.2.8.0: 2134 Devices 1252 Events
                            Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                            Comment


                              #74
                              The embedded Case statements weren't working for me. For some reason I needed to convert the CS.Value from Double to Integer. Here's how I did it. Probably a better way to do this but this worked for me. Never written any VB before so I'm blindly finding my way.

                              Code:
                                    Dim CS As Object
                                    CS = hs.CAPIGetStatus(devCodeDoor)
                                    Dim CSVal as Integer = CS.Value
                                    hs.writelog(logName,CStr(CS.Value) & ":" & CS.Status)
                              
                                    Select Case lockType
                                       Case "schlage1"
                                          Select Case CSVal
                                             Case 5
                                                Alert = "No Action - test case 5"

                              Comment


                                #75
                                When the table displays on the virtual device I created for each lock, the right side of the table is truncated, even though there seems to be plenty of blank space on that section. Trying to dig into it but I cannot see any way in the code to change that, either by wrapping the table display or what.

                                I did find the following CSS settings in /css/hs.css which control this:
                                Code:
                                .device_status_box {
                                    max-height: 300px;
                                    max-width: 300px;
                                    min-width: 100px;
                                    overflow: hidden;
                                I can change either the max-width to about 400px or I can just remove the overflow: hidden setting. Either of those will make the full table display. Of course, that's an ugly hack and who knows what else it would break.

                                Have you seen this before? Any ideas on how to fix this in the script code? (Which by the way is working nicely for me otherwise - thanks.)

                                Comment

                                Working...
                                X