lukasroegner / homebridge-nuki

Plugin for using the Nuki devices in homebridge.
MIT License
28 stars 3 forks source link

Problems after configuration #13

Closed marcelismus closed 5 years ago

marcelismus commented 5 years ago

The plugin is set up and shows me the devices and the IDs. Devices in the HomeKit are displayed. My Config:

{ "platform": "NukiPlatform", "hostNameOrIpAddress": "SERVER_IP", "hostCallbackApiPort": 40506, "bridgeIpAddress": "BRIDGE_IP", "bridgeApiPort": 8080, "bridgeApiToken": "TOKEN", "bridgeRebootSwitch": false, "devices": [ { "nukiId": OpenerID, "isRingToOpenEnabled": true, "isContinuousModeEnabled": false, "unlatchFromLockedToUnlocked": false, "unlatchFromUnlockedToUnlocked": false, "unlatchLock": false }, { "nukiId": SmartLockID, "isRingToOpenEnabled": false, "isContinuousModeEnabled": false, "unlatchFromLockedToUnlocked": false, "unlatchFromUnlockedToUnlocked": false, "unlatchLock": false } ] }

Problem 1: If the Smart Lock device is removed, nothing works anymore - message "No config for device".

Problem 2: I don't see a second button for "Ring to Open".

Problem 3: Nothing happens when you press a button in HomeKit. Neither with the Opener nor with the SmartLock. Message in the terminal:

[NukiPlatform] OpenerID - Unlock                                                  
[10/5/2019, 3:28:20 PM] [NukiPlatform] Error while communicating with the Nuki Bridge. Status Code: 404 

Nuki Bridge is available and "online". App and native SmartLock integration work fine.

lukasroegner commented 5 years ago

Problem 1: If the Smart Lock device is removed, nothing works anymore - message "No config for device".

Can you explain what is meant with "device is removed"? Are you removing the device from the Nuki Bridge, the config.json or physically?

Problem 2: I don't see a second button for "Ring to Open".

Configuration (RTO and continuous mode) are exposed as a separate switch.

Problem 3: Nothing happens when you press a button in HomeKit. Neither with the Opener nor with the SmartLock. Message in the terminal

Do you have the latest firmware on the Nuki Bridge?

marcelismus commented 5 years ago

Can you explain what is meant with "device is removed"? Are you removing the device from the Nuki Bridge, the config.json or physically?

I have removed it from the config.json, so I have only one array element (the Opener).

Configuration (RTO and continuous mode) are exposed as a separate switch.

The separate switches are only shown if I add the Opener AND the Smart Lock to the array of devices in the config.json. And the behavior's a little weird. For example:

 "devices": [
                {
                    "nukiId": OPENERID,
                    "isRingToOpenEnabled": true,
                    "isContinuousModeEnabled": false,
                    "unlatchFromLockedToUnlocked": false,
                    "unlatchFromUnlockedToUnlocked": false,
                    "unlatchLock": false
                }
            ]

=> No button for RTO.

 "devices": [
                {
                    "nukiId": OPENERID,
                    "isRingToOpenEnabled": true,
                    "isContinuousModeEnabled": false,
                    "unlatchFromLockedToUnlocked": false,
                    "unlatchFromUnlockedToUnlocked": false,
                    "unlatchLock": false
                },
{
                    "nukiId": SMARTLOCKID,
                    "isRingToOpenEnabled": false,
                    "isContinuousModeEnabled": false,
                    "unlatchFromLockedToUnlocked": false,
                    "unlatchFromUnlockedToUnlocked": false,
                    "unlatchLock": false
                }
            ]

=> No button for RTO.

 "devices": [
                {
                    "nukiId": OPENERID,
                    "isRingToOpenEnabled": false,
                    "isContinuousModeEnabled": false,
                    "unlatchFromLockedToUnlocked": false,
                    "unlatchFromUnlockedToUnlocked": false,
                    "unlatchLock": false
                },
{
                    "nukiId": SMARTLOCKID,
                    "isRingToOpenEnabled": true,
                    "isContinuousModeEnabled": false,
                    "unlatchFromLockedToUnlocked": false,
                    "unlatchFromUnlockedToUnlocked": false,
                    "unlatchLock": false
                }
            ]

=> Button for RTO visible.

Do you have the latest firmware on the Nuki Bridge?

Yes.

lukasroegner commented 5 years ago

Can you please double-check whether you have mapped the IDs to the correct devices? Maybe you have switched the Opener ID and the SmartLock ID?

lukasroegner commented 5 years ago

Ok, I found the bug in the code, I accidentally used the wrong index when loading the configuration. Fixed with #14, new version 0.5.2 is on NPM.

marcelismus commented 5 years ago

Now everything works fine. :-) 👍

//Edit: Not quite. Strangely enough, I still get the Smart Lock even though I didn't list the device in config.json anymore (and rebooted homebridge). But I think I'll have to look somewhere else. :-/

lukasroegner commented 5 years ago

You can remove all devices from the config (I.e. empty array for devices), restart homebridge (which should remove the devices from HomeKit), then re-add the Opener to the config.

marcelismus commented 5 years ago

Homebridge hiccups. I've cleared the device cache, now it's running.

One thing: The change from Unlocked to Locked at the Opener could be a bit faster. Locked -> Tap -> Opener opens -> Unlocked -> 10-15 seconds wait -> Locked. If it is not dependent on iOS or the HTTP API...

lukasroegner commented 5 years ago

I'm waiting for the callback from the Nuki Bridge that signals that the opener is "locked" again, it is not a timeout set by me. We should wait for the new Nuki Bridge update in Q4, which should enhance the liability and speed. If that does not help, feel free to open a new issue.