Skip to content
This repository has been archived by the owner on Jul 15, 2021. It is now read-only.

Siri No Longer Works ("Sorry, I didn't hear back") #126

Closed
walksonair opened this issue Dec 21, 2016 · 7 comments
Closed

Siri No Longer Works ("Sorry, I didn't hear back") #126

walksonair opened this issue Dec 21, 2016 · 7 comments

Comments

@walksonair
Copy link

walksonair commented Dec 21, 2016

@pdlove , I have been working on why Siri will not control my locks and had opened an issue on the HomeBridge github page (homebridge/homebridge#1000 (comment)

Can the developer of homebridge-smartthings help in resolving what was found to be a new iOS 10.2 update to Siri where Siri sends the true/false commands to the lock but it's expecting an integer? I can paste the logs but it's in the link pasted above. Let me know how I can help resolve this...

@gijoecool
Copy link
Contributor

@walksonair, I believe the issue is in lines 195-206 of smartthings.js

        thisCharacteristic.on('set', function(value, callback) {
                switch (value) {
                    case Characteristic.LockTargetState.SECURED:
                        that.platform.api.runCommand(callback, that.deviceid, "lock");
                        that.device.attributes.lock = "locked";
                        break;
                    case Characteristic.LockTargetState.UNSECURED:
                        that.platform.api.runCommand(callback, that.deviceid, "unlock");
                        that.device.attributes.lock = "unlocked";
                        break;
                } });
		that.platform.addAttributeUsage("lock", this.deviceid, thisCharacteristic);

value is being passed as true/false and the switch statement cannot handle that...

I think if you change the code to the following, then it should work. But you will need to test it for me. :)

        thisCharacteristic.on('set', function(value, callback) {
                if (value === false) {
                    value = Characteristic.LockTargetState.UNSECURED;
                } else if (value === true) {
                    value = Characteristic.LockTargetState.SECURED;
                }  
                switch (value) {
                    case Characteristic.LockTargetState.SECURED:
                        that.platform.api.runCommand(callback, that.deviceid, "lock");
                        that.device.attributes.lock = "locked";
                        break;
                    case Characteristic.LockTargetState.UNSECURED:
                        that.platform.api.runCommand(callback, that.deviceid, "unlock");
                        that.device.attributes.lock = "unlocked";
                        break;
                } });
		that.platform.addAttributeUsage("lock", this.deviceid, thisCharacteristic);

@walksonair
Copy link
Author

@gijoecool, much appreciated! I just now have to find that file in my system...let me work on that.

@walksonair
Copy link
Author

@gijoecool, yes, that did it! It is now working with Siri quite well. Thank you very much! Let me know how I can send you a cheery beverage!

christmas-beer

@gijoecool
Copy link
Contributor

If you're ever near Richmond, VA (USA), then let me know and you can buy me a drink! ;)

@walksonair
Copy link
Author

I will definitely do that and add you to my list of folks to thank on my USA tour. Cheers from Seattle, WA!

@gijoecool
Copy link
Contributor

See #127.

@walksonair
Copy link
Author

walksonair commented Dec 21, 2016 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants