Code Monkey home page Code Monkey logo

Comments (11)

ardevd avatar ardevd commented on September 15, 2024 2

Same issue here with the Danalock. I can lock/unlock it with Siri just
fine, but using a HomeKit app I have to toggle the target state a few times
before it actually does anything.

Edvard;

On Sat, Jul 30, 2016 at 5:36 AM, moosebert [email protected] wrote:

Have a couple Kiwkset locks successfully linked-up with Z-Way, but when
presented to Homebridge as accessories they’re constantly showing
“unlocking” (in iOS 10’s new Home app), and in a “Lock Mechanism Target
State” of “Unsecured” constantly (despite being locked).

I’m able to lock/unlock them (with a valid state update) via Z-Way without
issue. It’s only via Homebridge that this funky “always unlocking” state
appears.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#44, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAWZB2ShMQM9xxUredH8HqrPSywFWzdWks5qasa-gaJpZM4JYtxX
.

from homebridge-zway.

jadedeane avatar jadedeane commented on September 15, 2024

Think I'm onto something here.

So on line 1142 of index.js val is declared with a default value of "0". If vdev.metrics.level returns "open", it should be set to "0" and conversely if "closed" is returned set to "1". Did a little debugging, and at least with Z-Way 2.2.3 (only version I've ever used) if a lock is secured (e.g. "closed") vdev.metrics.level actually returns "close", ergo no match so val is never changed from "0".

Changed the code around simply like this and things are working as expected now:

    if(cx instanceof Characteristic.LockTargetState){
        cx.zway_getValueFromVDev = function(vdev){
            var val = Characteristic.LockTargetState.UNSECURED;
            if(vdev.metrics.level === "open"){
                val = Characteristic.LockTargetState.UNSECURED;
            } else if(vdev.metrics.level === "closed") {
                val = Characteristic.LockTargetState.SECURED;
            } else if(vdev.metrics.level === "close") {
                val = Characteristic.LockTargetState.SECURED;
            }
            debug("Returning LockTargetState of \"" + val + "\" because vdev.metrics.level returned \"" + vdev.metrics.level + "\"");
            return val;
        };

Will submit a commit eventually on the above once I've researched more and validated it's the right approach.

Last issue is the status never changes within homekit after a successful lock/unlock (with the above issue resolved). Not sure if homebridge-zway should be kicking Z-Way server to update, or if Z-Way server should be querying the device for the update on its own, but started a thread over on Z-Way forum https://forum.z-wave.me/viewtopic.php?f=3419&t=23601.

from homebridge-zway.

jadedeane avatar jadedeane commented on September 15, 2024

Resolved the "last issue" which has nothing to do with homebridge-zway. Details at https://forum.z-wave.me/viewtopic.php?f=3419&t=23601 (use https://github.com/jensmoes/Niffler app).

With submitted commit this should be resolved.

@ZYG0TE take a look at the aforementioned commit, and app. Combo of these should solve your issues too I hope!

from homebridge-zway.

ardevd avatar ardevd commented on September 15, 2024

@moosebert Thanks for looking into this. I have no experience with npm packages. How can I try out your commit exactly?

from homebridge-zway.

jadedeane avatar jadedeane commented on September 15, 2024

@archpoint you can simply alter /usr/lib/node_modules/homebridge-zway/index.js on your box as described in this thread. Alternatively, replace aforementioned file with https://github.com/moosebert/homebridge-zway/blob/master/index.js.

from homebridge-zway.

ardevd avatar ardevd commented on September 15, 2024

@moosebert Gave it a go now. Works perfectly. Thank you.

from homebridge-zway.

SphtKr avatar SphtKr commented on September 15, 2024

@moosebert , Great! Thanks... I got my DanaLock but haven't installed it yet so couldn't test (finally ordered the right cylinder so it's on its way now). Can you submit this as a pull request?

from homebridge-zway.

jadedeane avatar jadedeane commented on September 15, 2024

@SphtKr my pleasure dude, thanks for all the hard work. Aforementioned "fix" can be found in pull req. #45

from homebridge-zway.

Fingerz avatar Fingerz commented on September 15, 2024

Have these changes been rolled into the latest v0.5 alpha (3)? From a cursory glance it seems to be but the code is not exactly the same as what's described above. I've also setup Niffler in my ZWay server but I'm not sure it's updating status correctly for my Danalock v2 BTZE. Home app on my iPhone always shows "Unlocking..." except for a few seconds after I try to lock the door, then it switches back. How can I verify that the ZWay + Niffler combination is working before I start debugging homebridge-zway?

from homebridge-zway.

gijoecool avatar gijoecool commented on September 15, 2024

No, these changes were added after 0.5.0-alpha3. Try updating to the latest (0.5.0-alpha4).

from homebridge-zway.

Fingerz avatar Fingerz commented on September 15, 2024

That did the trick (upgrading to 0.5.0-alpha4)! The status of my Danalock is now correctly updated in HomeKit.

from homebridge-zway.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.