Page 2 of 2

Re: Python Plugin: NUKI locks

Posted: Thursday 23 May 2019 9:22
by heggink
Also just noticed that giejay forked the plugin with a bunch of fixes. Adopted these just now. Still rather new to this whole github thing so bear with me ;-).
Hope it's all OK now.

Re: Python Plugin: NUKI locks

Posted: Thursday 23 May 2019 12:35
by Bidibulle
Hi

it's Ok with last update :D

Merci ;) :mrgreen:

Re: Python Plugin: NUKI locks

Posted: Thursday 23 May 2019 12:43
by BartdaMan
Well, in my case I can unlock via Domoticz fine, but locking gives an error.

Re: Python Plugin: NUKI locks

Posted: Friday 24 May 2019 0:37
by BartdaMan
Well, it only gives an error if you switch the lock again within ±20 s after the previous switch action. And that normally does not happen. So for me this version is fine now! Thanks a lot, Herman! :D

Re: Python Plugin: NUKI locks

Posted: Sunday 01 September 2019 16:10
by StephaneM60
Hi,

I'm having one issue with this plugin : it fails at some time and never recover.

Here is the type of error I receive :
2019-09-01 12:05:36.961 Error: (Nuki) 'onStart' failed 'RemoteDisconnected'.
2019-09-01 12:05:36.961 Error: (Nuki) ----> Line 345 in 'C:\Program Files (x86)\Domoticz\plugins\domoticz-nuki\plugin.py'
2019-09-01 12:05:36.961 Error: (Nuki) ----> Line 161 in 'C:\Program Files (x86)\Domoticz\plugins\domoticz-nuki\plugin.py'
2019-09-01 12:05:36.961 Error: (Nuki) ----> Line 222 in 'C:\Program Files (x86)\Python37-32\Lib\urllib\request.py'
2019-09-01 12:05:36.961 Error: (Nuki) ----> Line 525 in 'C:\Program Files (x86)\Python37-32\Lib\urllib\request.py'
2019-09-01 12:05:36.961 Error: (Nuki) ----> Line 543 in 'C:\Program Files (x86)\Python37-32\Lib\urllib\request.py'
2019-09-01 12:05:36.961 Error: (Nuki) ----> Line 503 in 'C:\Program Files (x86)\Python37-32\Lib\urllib\request.py'
2019-09-01 12:05:36.961 Error: (Nuki) ----> Line 1345 in 'C:\Program Files (x86)\Python37-32\Lib\urllib\request.py'
2019-09-01 12:05:36.961 Error: (Nuki) ----> Line 1323 in 'C:\Program Files (x86)\Python37-32\Lib\urllib\request.py'
2019-09-01 12:05:36.961 Error: (Nuki) ----> Line 1353 in 'C:\Program Files (x86)\Python37-32\Lib\http\client.py'
2019-09-01 12:05:36.965 Error: (Nuki) ----> Line 306 in 'C:\Program Files (x86)\Python37-32\Lib\http\client.py'
2019-09-01 12:05:36.965 Error: (Nuki) ----> Line 275 in 'C:\Program Files (x86)\Python37-32\Lib\http\client.py'

It seems the error occurs when the plugin hit the refresh interval (60 min for me) though I'm not sure. It may be because the plugin fail to contact the bridge (like a temporary network error).

I'm currently running Domoticz on a Windows 10 PC.

Otherwise the plugin works fine : it does see the brige, the lock, update the lock status and can lock / unlock the lock.

I turned debug to see if I can pinpoint the moment it fails, will let you know if I notice something obvious.

Re: Python Plugin: NUKI locks

Posted: Sunday 01 September 2019 23:52
by heggink
Please do. I can't test under Windows as I only run on rpi and have no spare locks to test.


Sent from phone.


Re: Python Plugin: NUKI locks

Posted: Monday 02 September 2019 11:12
by StephaneM60
It does have failed this night, same error.

2019-09-02 02:49:52.288 Error: Nuki hardware (18) thread seems to have ended unexpectedly
2019-09-02 02:50:06.742 Error: Nuki hardware (18) thread seems to have ended unexpectedly
2019-09-02 02:50:12.092 Error: (Nuki) 'onHeartbeat' failed 'RemoteDisconnected'.
2019-09-02 02:50:12.092 Error: (Nuki) ----> Line 368 in 'C:\Program Files (x86)\Domoticz\plugins\domoticz-nuki\plugin.py'
2019-09-02 02:50:12.092 Error: (Nuki) ----> Line 308 in 'C:\Program Files (x86)\Domoticz\plugins\domoticz-nuki\plugin.py'
2019-09-02 02:50:12.092 Error: (Nuki) ----> Line 222 in 'C:\Program Files (x86)\Python37-32\Lib\urllib\request.py'
2019-09-02 02:50:12.092 Error: (Nuki) ----> Line 525 in 'C:\Program Files (x86)\Python37-32\Lib\urllib\request.py'
2019-09-02 02:50:12.092 Error: (Nuki) ----> Line 543 in 'C:\Program Files (x86)\Python37-32\Lib\urllib\request.py'
2019-09-02 02:50:12.096 Error: (Nuki) ----> Line 503 in 'C:\Program Files (x86)\Python37-32\Lib\urllib\request.py'
2019-09-02 02:50:12.096 Error: (Nuki) ----> Line 1345 in 'C:\Program Files (x86)\Python37-32\Lib\urllib\request.py'
2019-09-02 02:50:12.096 Error: (Nuki) ----> Line 1323 in 'C:\Program Files (x86)\Python37-32\Lib\urllib\request.py'
2019-09-02 02:50:12.096 Error: (Nuki) ----> Line 1353 in 'C:\Program Files (x86)\Python37-32\Lib\http\client.py'
2019-09-02 02:50:12.096 Error: (Nuki) ----> Line 306 in 'C:\Program Files (x86)\Python37-32\Lib\http\client.py'
2019-09-02 02:50:12.096 Error: (Nuki) ----> Line 275 in 'C:\Program Files (x86)\Python37-32\Lib\http\client.py'
2019-09-02 02:50:20.849 Error: Nuki hardware (18) thread seems to have ended unexpectedly

There is one thing taht I fail to understand, the way I see it, it does fail trying to open the bridge URL urlib.request.urlopen(req).read(), but the log file locate the error in the catch block for URLError in Domoticz.Error('NUKI HTTPError code:' + str(e.reason)). So it means that the real URLError is masked by the RemoteDisconnected in the Domoticz.Error function...?

Re: Python Plugin: NUKI locks

Posted: Friday 01 May 2020 22:57
by Antori91
Hello Heggink,

I'm currently looking for a door smart lock. I've just found this Nuki Smart Lock product and your plugin.
I've a simple question. Is there any way to connect this Nuki Smart Lock product to a home automation system like Domoticz without using the Nuki Cloud, I mean Domoticz talking directly to the Nuki bridge.

Re: Python Plugin: NUKI locks

Posted: Saturday 02 May 2020 9:18
by heggink
Hi Antori91,
This is exactly what the plugin does. It uses the published http api to communicate directly to the bridge. It does not need an internet connection. Please note that connecting the locks to Domoticz is always a security risk so make sure your system is well protected.
Herman

Sent from phone.


Re: Python Plugin: NUKI locks

Posted: Saturday 02 May 2020 12:54
by Antori91
By the way about security, how secure is this HTTP NUKI Bridge API? Is it plain HTTP or HTTPS with client authentication?

Re: Python Plugin: NUKI locks

Posted: Saturday 02 May 2020 13:27
by heggink
It's simple http calls but since it's inside my network, I don't mind. I use MAC authentication for wireless access so someone would have to gain access through my internet connection. External access is through VPN.

Just google for nuki bridge http api and you can find it.

Sent from phone.


Re: Python Plugin: NUKI locks

Posted: Monday 04 May 2020 19:06
by Antori91
Hello Heggink,

I've downloaded the Nuki Web API V1.3.0 whitepaper. The chapter 1.Introduction mentions:
The Nuki Web API offers various ways to interact with a Nuki Smart Lock. The API transmits all commands directly through a permanent HTTPS/TLS connection to the corresponding Nuki bridge, which forwards it via Bluetooth to the Smart Lock for execution. Responses are directly fed back into Nuki Web.All commands are performed with the server-stored Nuki Web Authentication Key which was created when Nuki Web has been initially activated by the Smart Lock administrator. Because of having its own Authentication Key, Nuki Web acts independently of other clients (e.g. Nuki iOS or Android App).
???

Anyway, I don't go further with NUKI because my door lock is not compatible.

Re: Python Plugin: NUKI locks

Posted: Tuesday 05 May 2020 9:13
by heggink
That's the web api that uses the nuki cloud. I use the local bridge api. Different one. I don't like all those web services. When the internet is down, nothing works...

Sent from phone.


Re: Python Plugin: NUKI locks

Posted: Tuesday 05 May 2020 10:00
by Antori91
heggink wrote: Tuesday 05 May 2020 9:13 That's the web api that uses the nuki cloud. I use the local bridge api. Different one. I don't like all those web services. When the internet is down, nothing works...
Ah OK, I see. I will not like too using the cloud to open my main door (it was my first question) !
Thank you for your answers. Have a nice day

Re: Python Plugin: NUKI locks

Posted: Sunday 27 September 2020 11:54
by heggink
There is a new (testing) version of the plugin adding support for the door sensor for the V2 lock (thanks to StephaneM60). Please note that the device numbers in domoticz have been renumbered so installing this will create new devices and you need to delete the old ones. In order to test, you need to switch to the feature-unlatch branch on github.

At some point, I will move that to master.

Re: Python Plugin: NUKI locks

Posted: Sunday 27 September 2020 12:49
by salopette
Thank you very much! It all seems to be working!