Announcement

Collapse
No announcement yet.

Toggle Status of Schlage Lock

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

    Toggle Status of Schlage Lock

    I see the status of my Schlage lock (469), i.e. locked or unlocked. I am trying to toggle the status from HSTouch. However, I only see the command lock and unlock but not toggle. How can I toggle the lock/unlock status of the lock?

    #2
    Ok, I was looking into this again. It seems the only way to do this is with a script. It can be done directly in HStouch with a single script statement. In ActionsWhenPressed or ActionsWhenReleased create an action "HomeSeer: Run a HomeSeer script with values from elements(s)". For Script enter the string below. ScriptProcedure will be automatically set to "Main". Just ignore that. Replace [Insert Reference ID] with the reference ID of the lock which you can find under the advanced tab of the device.

    hs.CAPIControlHandler(hs.CAPIGetSingleControl([Insert Reference ID], true, (hs.DeviceValue([Insert Reference ID again]) == 255) ? "Unlock" : "Lock", false, false));

    For more control you can write an actual script that goes into the script folder. For the parameter pass it the reference ID of the device.

    using System;

    public void Main(string id)
    {
    string LogID = "Lock Control"; //This will be displayed in the log file under column "Type/Error".
    int nLockStatus;
    int nLockRef;

    if ((nLockRef = Convert.ToInt32(id)) == 0)
    {
    hs.WriteLog(LogID, "Invalide input parameter " + id + "Please provide a single input parameter that is the device's reference ID which can be found under the Advanced tab of the device");
    return;
    }

    nLockStatus = hs.DeviceValue(nLockRef);
    if (nLockStatus == 255)
    {
    //Device was locked. Unlock it.
    hs.CAPIControlHandler(hs.CAPIGetSingleControl(nLockRef, true, "Unlock", false, false));
    }
    else if(nLockStatus == 0)
    {
    //Device was unlocked. Lock it.
    hs.CAPIControlHandler(hs.CAPIGetSingleControl(nLockRef, true, "Lock", false, false));
    //hs.CAPIControlHandler(hs.CAPIGetSingleControl(hs.GetDeviceRe fByName("Downstairs Entrance Door Lock"), True, "Lock", False, False))
    }
    else
    {
    //Unknown status. Just try to lock it.
    //Note for Schlage Camelot
    // 1 = Unlocked with timeout
    // 16 = Unlocked from inside handle
    // 17 = Unlocked from inside handle with timeout
    // 32 = Unlocked from outside handle
    // 33 = Unlocked from outside handle with timeout
    // 254 = Unknown status
    hs.CAPIControlHandler(hs.CAPIGetSingleControl(nLockRef, true, "Lock", false, false));
    }
    }

    Comment


      #3
      Did you try adding 9000 to status. Thats what tells hstouch to add a toggle.
      Attached Files
      https://forums.homeseer.com/forum/de...plifier-plugin

      Comment


        #4
        9000 not working

        Just FYI...tried the "9000" for toggle on my Schlage and it does not work regardless of multiple changes in that setting...any other ideas?

        Comment


          #5
          Also...script does not work for me

          Really would like this feature for my Schlage locks...tried the script in HSTouch Designer and cannot get this to successfully toggle the locks either. Any assistance would be greatly appreciated.
          Attached Files

          Comment


            #6
            Create 3 events. See the images below.
            Then ins HSTouch designer add an image that shows the status of your lock.
            Add an Action When Released that runs the Event "Toggle" that calls the other 2 events.
            You can then click the lock image and the lock will toggle between Lock and Unlock.
            Attached Files
            --
            Jeff Farmer
            HS 3, HSPhone
            My HS3 Plugins: CFHSExtras, Random, Restart, Tracker, WeatherXML, PanaBluRay
            Other Plugins In Use: APCUPSD, BLOnkyo, Device History, EasyTrigger, HSTouch Server, PHLocation2, Pushover, RFXCom, UltraGCIR3, UltraMon3, UltraPioneerAVR3, X10, Z-Wave

            Hardware: GoControl Irrigation Controler, Schlage Lever Lock, Schlage Deadbolt, Way2Call Hi-Phone, RFXCom RFXrec433 Receiver, WGL 800, TI-103, Z-Net, Pioneer 1120, Pioneer 1021, Pioneer LX302, Panasonic BDT-110, Panasonic BDT-210 x2

            Comment


              #7
              THANK YOU!!!

              Genius! This worked perfectly, cant thank you enough as this is just what I needed. Hope to be able to return the favor somewhere somehow. The abilities of HS3 are vast...but difficult to uncover so users like you are truly the ones that extol the value of this system!

              I am doing well on graphics and navigation, so if I can assist you in any way in this area, please let me know.

              Regards,
              John

              Comment


                #8
                I struggled with this as well and posted a reply to an older thread https://forums.homeseer.com/showthre...13#post1325113

                While the aforementioned Events are an elegant solution, the conditional "Other Events are True" wasn't obvious to me, so I went with a vb script. Which was a great learning experience.

                ...
                1) create 3 manually triggered events (Script, Front Door Lock, Front Door Unlock)
                2) Lock and Unlock are simply setting node to lock or unlock
                3) Script has the following code
                This goes in the program files/homeseer/script folder
                Code:
                ''Lockscript.vb 
                Sub Main(parms as Object)     
                Dim devStatus = hs.DeviceValueByName("Vestibule Door Lock")     
                     Select Case devStatus     
                     Case 255         
                          hs.TriggerEvent("Front Door Unlock")         
                          hs.Speak("Unlocking the Front Door")     
                     Case 0         
                          hs.TriggerEvent("Front Door Lock")         
                          hs.Speak("Locking the Front Door")     
                     end Select 
                end Sub
                The HomeSeer documentation states DeviceValueByName requires Location & Name. This can be confusing because by location they mean Room. So in my case the Device: Door Lock is in the Room: Vestibule.

                Finally,
                4) Create a button in HSTouch Designer. I like to give it status tracking of the door lock. And Action when pressed is the Front Door Lock Script.

                Comment


                  #9
                  Scripting next

                  Thanks for the idea...I am (currently) intimidated by scripting, but hope to dive in soon as these can really open up new functionality!

                  Comment


                    #10
                    Thank you Jeff for the events!

                    Comment


                      #11
                      FYI

                      Spud's EasyTrigger plugin has a toggle action built in, plus a veritable treasure trove of other features that greatly simplify complex event building and schedules.
                      cheeryfool

                      Comment


                        #12
                        Originally posted by Tomadoggy View Post
                        Just FYI...tried the "9000" for toggle on my Schlage and it does not work regardless of multiple changes in that setting...any other ideas?
                        This used to work but an update somewhere along the line has broken it. Here is an old link where Rich explains it: https://forums.homeseer.com/showthre...=165052&page=2

                        Dec-09 10:51:18 AM Z-Wave Error Z-Wave Exception processing Z-Wave command type COMMAND_CLASS_DOOR_LOCK_V2. Error=Arithmetic operation resulted in an overflow.
                        Dec-09 10:51:18 AM Device Control Device: 1st Floor Main Door Lock to Toggle (9000) by/from: CAPI Control Handler
                        https://forums.homeseer.com/forum/de...plifier-plugin

                        Comment


                          #13
                          Originally posted by happnatious1 View Post
                          Did you try adding 9000 to status. Thats what tells hstouch to add a toggle.
                          I have verified that this method works from a homeseer touch client. However clicking toggle on the web interface generates the arithmetic error.
                          https://forums.homeseer.com/forum/de...plifier-plugin

                          Comment


                            #14
                            Originally posted by morrisdl View Post
                            Thank you Jeff for the events!





                            Which program did you use to create your floor plan? Looks great!


                            Sent from my iPad using Tapatalk
                            HS4 4.2.6.0 &HSTouch Designer 3.0.80
                            Plugin's:
                            BLBackup, BLOccupied, BLShutdown, EasyTrigger, Ecobee, Nest, AK Bond
                            EnvisaLink DSC, PHLocation, Pushover, SONOS, Blue Iris, UltraRachio3,
                            weatherXML, Jon00 Alexa Helper, Network Monitor, MyQ, Z-Wave

                            Comment


                              #15
                              Originally posted by The Profit View Post
                              Which program did you use to create your floor plan? Looks great!


                              Sent from my iPad using Tapatalk
                              Does anyone know, is this floor plan made using Sweethome 3D or something else?
                              Thanks
                              HS4 4.2.6.0 &HSTouch Designer 3.0.80
                              Plugin's:
                              BLBackup, BLOccupied, BLShutdown, EasyTrigger, Ecobee, Nest, AK Bond
                              EnvisaLink DSC, PHLocation, Pushover, SONOS, Blue Iris, UltraRachio3,
                              weatherXML, Jon00 Alexa Helper, Network Monitor, MyQ, Z-Wave

                              Comment

                              Working...
                              X