Gedra Lock V3 / Danalock V3 - I'm stuck on SECURITY "starting secure inclusion"

Begonnen von TomekWaw, 13 Juni 2020, 02:55:20

Vorheriges Thema - Nächstes Thema

TomekWaw

Hello,

I have Gerda Lock V3 z-wave lock. This is pretty much Danalock V3 resold under license by leading Polish lock company.

I have read all threads on Danalock here and I have already done:

1) apt-get install libcrypt-rijndael-perl
2) att ZWDongle_0 networkKey XXXXXXXXXXXXXXX <--- my 32-bit HEX key
3) set ZWDongle_0 addNode onSec

and after pressing inclusion button on the lock it includes fine:

2020-06-13 02:30:19 ZWDongle ZWDongle_0 addNode onSec
2020-06-13 02:30:19 ZWDongle ZWDongle_0 ZW_ADD_NODE_TO_NETWORK learnReady
2020-06-13 02:30:31 ZWDongle ZWDongle_0 ZW_ADD_NODE_TO_NETWORK nodeFound
2020-06-13 02:30:31 Global global UNDEFINED ZWave_ENTRY_CONTROL_32 ZWave f1cfdf8a 32 5e989f5572
2020-06-13 02:30:31 Global global DEFINED ZWave_ENTRY_CONTROL_32
2020-06-13 02:30:31 Global global DEFINED FileLog_ZWave_ENTRY_CONTROL_32
2020-06-13 02:30:31 ZWDongle ZWDongle_0 addNode off
2020-06-13 02:30:31 ZWave ZWave_ENTRY_CONTROL_32 CMD: ZW_APPLICATION_UPDATE
2020-06-13 02:30:32 ZWDongle ZWDongle_0 ZW_ADD_NODE_TO_NETWORK done


But it seems it is stuck on: SECURITY INITIALIZING (starting secure inclusion):

defmod Gerda_Lock_v3 ZWave f1cfdf8a 32
attr Gerda_Lock_v3 IODev ZWDongle_0
attr Gerda_Lock_v3 classes ZWAVEPLUS_INFO SECURITY SECURITY_S2 TRANSPORT_SERVICE MANUFACTURER_SPECIFIC
attr Gerda_Lock_v3 room ZWave

setstate Gerda_Lock_v3 2020-06-13 02:44:17 CMD ZW_APPLICATION_UPDATE
setstate Gerda_Lock_v3 2020-06-13 02:44:17 SECURITY INITIALIZING (starting secure inclusion)
setstate Gerda_Lock_v3 2020-06-13 02:44:19 timeToAck 2.192
setstate Gerda_Lock_v3 2020-06-13 02:44:19 transmit OK


I'm lost here. What next shall I do to have it working / controllable in FHEM?
Any help would be appreciated.

rudolfkoenig

Can you please attach a FHEM-log of the inclusion with "attr global verbose 5" set?

Note: the FHEM ZWave Module does not support the SECURITY_V2 Class, you have to make sure that your device is accepting the SECURITY (without _V2) initialization.

TomekWaw

Sure. Pretty much the same:

attr global userattr cmdIcon devStateIcon devStateIcon:textField-long devStateStyle icon mqttAlias:textField-long mqttDefaults:textField-long mqttDisable:both,incoming,outgoing mqttForward:all,none mqttPublish:textField-long mqttSubscribe:textField-long sortby webCmd webCmdLabel:textField-long widgetOverride
attr global autoload_undefined_devices 1
attr global autosave 0
attr global logfile /opt/loxberry/log/plugins/fhem/fhem.log
attr global modpath .
attr global motd none
attr global statefile /opt/loxberry/data/plugins/fhem/fhem.save
attr global updateInBackground 1
attr global verbose 5
setstate global no definition


Made even shutdown restart after this.
Inclusion log:

2020-06-13 12:50:30 ZWDongle ZWDongle_0 addNode onSec
2020-06-13 12:50:30 ZWDongle ZWDongle_0 ZW_ADD_NODE_TO_NETWORK learnReady
2020-06-13 12:50:46 ZWDongle ZWDongle_0 ZW_ADD_NODE_TO_NETWORK nodeFound
2020-06-13 12:50:46 Global global UNDEFINED ZWave_ENTRY_CONTROL_32 ZWave f1cfdf8a 32 5e989f5572
2020-06-13 12:50:46 Global global DEFINED ZWave_ENTRY_CONTROL_32
2020-06-13 12:50:46 Global global DEFINED FileLog_ZWave_ENTRY_CONTROL_32
2020-06-13 12:50:46 ZWDongle ZWDongle_0 addNode off
2020-06-13 12:50:46 ZWave ZWave_ENTRY_CONTROL_32 CMD: ZW_APPLICATION_UPDATE
2020-06-13 12:50:47 ZWDongle ZWDongle_0 ZW_ADD_NODE_TO_NETWORK done


Raw after this:


defmod ZWave_ENTRY_CONTROL_32 ZWave f1cfdf8a 32
attr ZWave_ENTRY_CONTROL_32 IODev ZWDongle_0
attr ZWave_ENTRY_CONTROL_32 classes ZWAVEPLUS_INFO SECURITY SECURITY_S2 TRANSPORT_SERVICE MANUFACTURER_SPECIFIC
attr ZWave_ENTRY_CONTROL_32 room ZWave

setstate ZWave_ENTRY_CONTROL_32 2020-06-13 12:50:46 CMD ZW_APPLICATION_UPDATE
setstate ZWave_ENTRY_CONTROL_32 2020-06-13 12:50:46 SECURITY INITIALIZING (starting secure inclusion)
setstate ZWave_ENTRY_CONTROL_32 2020-06-13 12:50:49 timeToAck 2.274
setstate ZWave_ENTRY_CONTROL_32 2020-06-13 12:50:49 transmit OK


This lock is no different than Danalock V3 and Danalock it is known here to be working under FHEM control.
I also know this lock works under Z-stick Gen5 with other software people are using in Poland.

krikan

Zitat von: TomekWaw am 13 Juni 2020, 12:58:29
Inclusion log:
Please post excerpt from global logfile /opt/loxberry/log/plugins/fhem/fhem.log with "attr global verbose 5".
You have posted something else.  :)

TomekWaw

I'm not sure if you think of this, but I found something related in /opt/loxberry/log/plugins/fhem/fhem.log.gz file (no fhem.log to my surprise).

2020.06.13 12:50:46 5: ZWDongle_0: dispatch 004a010220080440035e989f5572
2020.06.13 12:50:46 4: CMD:ZW_ADD_NODE_TO_NETWORK ID:02 ARG:20080440035e989f5572 CB:01
2020.06.13 12:50:46 5: Starting notify loop for ZWDongle_0, 1 event(s), first is ZW_ADD_NODE_TO_NETWORK nodeFound
2020.06.13 12:50:46 5: MQTT_GENERIC_BRIDGE:DEBUG:> [mqttGeneric] publish: fhem/ZWDongle_0/state => ZW_ADD_NODE_TO_NETWORK nodeFound (qos: 0, retain: 1)
2020.06.13 12:50:46 5: MQTT lb_mosquitto message sent: Publish/at-most-once,retain fhem/ZWDongle_0/state
2020.06.13 12:50:46 5: SW: 313700156668656d2f5a57446f6e676c655f302f73746174655a575f4144445f4e4f44455f544f5f4e4554574f524b206e6f6465466f756e64
2020.06.13 12:50:46 5: End notify loop for ZWDongle_0
2020.06.13 12:50:46 4: ZWDongle_0 ZW_ADD_NODE_TO_NETWORK nodeFound
2020.06.13 12:50:46 4: ZWDongle_Read ZWDongle_0: rcvd 004a010320080440035e989f5572 (request ZW_ADD_NODE_TO_NETWORK), sending ACK
2020.06.13 12:50:46 5: SW: 06
2020.06.13 12:50:46 5: ZWDongle_0: dispatch 004a010320080440035e989f5572
2020.06.13 12:50:46 4: CMD:ZW_ADD_NODE_TO_NETWORK ID:03 ARG:20080440035e989f5572 CB:01
2020.06.13 12:50:46 5: Starting notify loop for global, 1 event(s), first is UNDEFINED ZWave_ENTRY_CONTROL_32 ZWave f1cfdf8a 32 5e989f5572
2020.06.13 12:50:46 5: UniFi (Unifi_Notify) - executed.
2020.06.13 12:50:46 2: autocreate: define ZWave_ENTRY_CONTROL_32 ZWave f1cfdf8a 32 5e989f5572
2020.06.13 12:50:46 2: autocreate: define FileLog_ZWave_ENTRY_CONTROL_32 FileLog /opt/loxberry/log/plugins/fhem/ZWave_ENTRY_CONTROL_32.log ZWave_ENTRY_CONTROL_32
2020.06.13 12:50:46 4: Skipping save, as autosave is disabled
2020.06.13 12:50:46 5: End notify loop for global
2020.06.13 12:50:46 4: ZWDongle_Read ZWDongle_0: rcvd 004a010520080440035e989f5572 (request ZW_ADD_NODE_TO_NETWORK), sending ACK
2020.06.13 12:50:46 5: SW: 06
2020.06.13 12:50:46 5: ZWDongle_0: dispatch 004a010520080440035e989f5572
2020.06.13 12:50:46 4: CMD:ZW_ADD_NODE_TO_NETWORK ID:05 ARG:20080440035e989f5572 CB:01
2020.06.13 12:50:46 5: Cmd: >set ZWDongle_0 addNode off<
2020.06.13 12:50:46 4: ZWDongle *** set ZWDongle_0 addNode off
2020.06.13 12:50:46 5: ZWDongle_Write 004a0502 ()
2020.06.13 12:50:46 5: SW: 0105004a0502b7
2020.06.13 12:50:46 5: Starting notify loop for ZWDongle_0, 1 event(s), first is addNode off
2020.06.13 12:50:46 5: createNotifyHash
2020.06.13 12:50:46 5: MQTT_GENERIC_BRIDGE:DEBUG:> [mqttGeneric] publish: fhem/ZWDongle_0/state => addNode off (qos: 0, retain: 1)
2020.06.13 12:50:46 5: MQTT lb_mosquitto message sent: Publish/at-most-once,retain fhem/ZWDongle_0/state
2020.06.13 12:50:46 5: SW: 312200156668656d2f5a57446f6e676c655f302f73746174656164644e6f6465206f6666
2020.06.13 12:50:46 5: End notify loop for ZWDongle_0
2020.06.13 12:50:46 2: ZWAVE Starting secure init for ZWave_ENTRY_CONTROL_32
2020.06.13 12:50:46 5: ZWDongle_Write 001320039804002501 (f1cfdf8a)
2020.06.13 12:50:46 4: ZWDongle_Read ZWDongle_0: rcvd 00498420080440035e989f5572 (request ZW_APPLICATION_UPDATE), sending ACK
2020.06.13 12:50:46 5: SW: 06
2020.06.13 12:50:46 5: ZWDongle_0: dispatch 00498420080440035e989f5572
2020.06.13 12:50:46 4: CMD:ZW_APPLICATION_UPDATE ID:20 ARG:080440035e989f5572 CB:84
2020.06.13 12:50:46 5: Starting notify loop for ZWave_ENTRY_CONTROL_32, 1 event(s), first is CMD: ZW_APPLICATION_UPDATE
2020.06.13 12:50:46 5: MQTT_GENERIC_BRIDGE:DEBUG:> [mqttGeneric] publish: fhem/ZWave_ENTRY_CONTROL_32/CMD => ZW_APPLICATION_UPDATE (qos: 0, retain: 1)
2020.06.13 12:50:46 5: MQTT lb_mosquitto message sent: Publish/at-most-once,retain fhem/ZWave_ENTRY_CONTROL_32/CMD
2020.06.13 12:50:46 5: SW: 3136001f6668656d2f5a576176655f454e5452595f434f4e54524f4c5f33322f434d445a575f4150504c49434154494f4e5f555044415445
2020.06.13 12:50:46 5: Starting notify loop for mqttGeneric, 5 event(s), first is transmission-state: outgoing publish sent
2020.06.13 12:50:46 5: End notify loop for mqttGeneric
2020.06.13 12:50:46 5: Starting notify loop for mqttGeneric, 1 event(s), first is outgoing-count: 672
2020.06.13 12:50:46 5: End notify loop for mqttGeneric
2020.06.13 12:50:46 5: End notify loop for ZWave_ENTRY_CONTROL_32
2020.06.13 12:50:46 4: ZWDongle_Read ZWDongle_0: CAN received
2020.06.13 12:50:47 5: Sending 'GET VAR ups ups.status'...
2020.06.13 12:50:47 5: SW: 4745542056415220757073207570732e7374617475730a
2020.06.13 12:50:47 5: NUT RX: VAR ups ups.status "OL"
2020.06.13 12:50:47 2: ZWDongle_ProcessSendStack: no ACK, resending message 0105004a0502b7
2020.06.13 12:50:47 5: SW: 0105004a0502b7
2020.06.13 12:50:47 5: ACK received, removing 0105004a0502b7 from dongle sendstack
2020.06.13 12:50:47 5: SW: 010a0013200398040025017d
2020.06.13 12:50:47 5: ACK received, WaitForAck=>2 for 010a0013200398040025017d
2020.06.13 12:50:47 4: ZWDongle_Read ZWDongle_0: rcvd 011301 (answer ZW_SEND_DATA), sending ACK
2020.06.13 12:50:47 5: SW: 06
2020.06.13 12:50:47 5: ZWDongle_0: dispatch 011301
2020.06.13 12:50:47 4: ZWDongle_Read ZWDongle_0: rcvd 004a02062000 (request ZW_ADD_NODE_TO_NETWORK), sending ACK
2020.06.13 12:50:47 5: SW: 06
2020.06.13 12:50:47 5: ZWDongle_0: dispatch 004a02062000
2020.06.13 12:50:47 4: CMD:ZW_ADD_NODE_TO_NETWORK ID:06 ARG:2000 CB:02
2020.06.13 12:50:47 5: Starting notify loop for ZWDongle_0, 1 event(s), first is ZW_ADD_NODE_TO_NETWORK done
2020.06.13 12:50:47 5: MQTT_GENERIC_BRIDGE:DEBUG:> [mqttGeneric] publish: fhem/ZWDongle_0/state => ZW_ADD_NODE_TO_NETWORK done (qos: 0, retain: 1)
2020.06.13 12:50:47 5: MQTT lb_mosquitto message sent: Publish/at-most-once,retain fhem/ZWDongle_0/state
2020.06.13 12:50:47 5: SW: 313200156668656d2f5a57446f6e676c655f302f73746174655a575f4144445f4e4f44455f544f5f4e4554574f524b20646f6e65
2020.06.13 12:50:47 5: End notify loop for ZWDongle_0
2020.06.13 12:50:47 4: ZWDongle_0 ZW_ADD_NODE_TO_NETWORK done
2020.06.13 12:50:49 4: ZWDongle_Read ZWDongle_0: rcvd 00040013028407 (request APPLICATION_COMMAND_HANDLER), sending ACK
2020.06.13 12:50:49 5: SW: 06
2020.06.13 12:50:49 5: ZWDongle_0: dispatch 00040013028407
2020.06.13 12:50:49 4: CMD:APPLICATION_COMMAND_HANDLER ID:13 ARG:028407 CB:00
2020.06.13 12:50:49 5: Starting notify loop for Fibaro_Motion_Sensor_1, 1 event(s), first is wakeup: notification
2020.06.13 12:50:49 5: MQTT_GENERIC_BRIDGE:DEBUG:> [mqttGeneric] publish: fhem/Fibaro_Motion_Sensor_1/wakeup => notification (qos: 0, retain: 1)
2020.06.13 12:50:49 5: MQTT lb_mosquitto message sent: Publish/at-most-once,retain fhem/Fibaro_Motion_Sensor_1/wakeup
2020.06.13 12:50:49 5: SW: 313000226668656d2f46696261726f5f4d6f74696f6e5f53656e736f725f312f77616b6575706e6f74696669636174696f6e
2020.06.13 12:50:49 5: Starting notify loop for mqttGeneric, 3 event(s), first is transmission-state: outgoing publish sent
2020.06.13 12:50:49 5: End notify loop for mqttGeneric
2020.06.13 12:50:49 5: Starting notify loop for mqttGeneric, 1 event(s), first is outgoing-count: 674
2020.06.13 12:50:49 5: End notify loop for mqttGeneric
2020.06.13 12:50:49 5: End notify loop for Fibaro_Motion_Sensor_1
2020.06.13 12:50:49 4: ZWDongle_Read ZWDongle_0: rcvd 001301000076 (request ZW_SEND_DATA), sending ACK
2020.06.13 12:50:49 5: SW: 06
2020.06.13 12:50:49 5: device ack reveived, removing 010a0013200398040025017d from dongle sendstack
2020.06.13 12:50:49 5: ZWDongle_0: dispatch 001301000076
2020.06.13 12:50:49 4: CMD:ZW_SEND_DATA ID:00 ARG:0076 CB:01

rudolfkoenig

Yes, I/we were looking for this file.

- the ZWave module is initiating a secure inclusion (see th text: Starting secure init for ZWave_ENTRY_CONTROL_32), and sends ...9804...
- it expects a message containing ...9805... (SchemeReport)
- this message is not sent by your device, instead a "ZW_APPLICATION_UPDATE ID:20 ARG:080440035e989f5572" is sent as an answer.

=> I am not the ZWave Security specialist, and I might err, but I can imagine, that this is the normal reply if the device is not wanting to connect via SECURITY (V1) but insists on SECURITY_V2, which is not impemented in the FHEM ZWave module.

TomekWaw

Thanks for your support, Rudolfkoenig.
That's a sad news to me, seems that I need to move from FHEM to another software, at least with Z-stick.. :|

TomekWaw

I HACKED IT  :) :) :) and staying with FHEM for now.

This is what I did.

1) As this Gerda Lock V3 is in hardware exactly the same as Danalock V3, I installed Danalock app Android. Just a curiosity.
2) To my surprise I couldn't sign in with my email as it was used... Clearly Gerda lock app is just a clone app to Danalock app, backed with the same Danalock infrastructure!
3) So I've successfully logged in with my Gerda credentials 8)
4) I was able to add my lock to the app and.... upgrade firmware to Danalock latest ;D. It was from 0.9.6 to 0.15.0.
5) Danalock app together with this new firmware gave me some additional features such as Twist Assist.
6) There was also this new Z-wave include app option....
7) So I did a reset to default and tried again adding lock to FHEM....

AND IT HAS FINALLY INCLUDED!  8)

defmod ZWave_ENTRY_CONTROL_33 ZWave f1cfdf8a 33
attr ZWave_ENTRY_CONTROL_33 IODev ZWDongle_0
attr ZWave_ENTRY_CONTROL_33 classes ZWAVEPLUS_INFO SECURITY SECURITY_S2 TRANSPORT_SERVICE MANUFACTURER_SPECIFIC TIME DOOR_LOCK VERSION ALARM ASSOCIATION ASSOCIATION_GRP_INFO SUPERVISION POWERLEVEL DEVICE_RESET_LOCALLY BATTERY FIRMWARE_UPDATE_MD CONFIGURATION USER_CODE TIME_PARAMETERS SCHEDULE_ENTRY_LOCK
attr ZWave_ENTRY_CONTROL_33 room ZWave
attr ZWave_ENTRY_CONTROL_33 secure_classes DOOR_LOCK VERSION ALARM ASSOCIATION ASSOCIATION_GRP_INFO SUPERVISION POWERLEVEL DEVICE_RESET_LOCALLY BATTERY FIRMWARE_UPDATE_MD CONFIGURATION USER_CODE TIME_PARAMETERS SCHEDULE_ENTRY_LOCK
attr ZWave_ENTRY_CONTROL_33 vclasses ALARM:8 ASSOCIATION:2 ASSOCIATION_GRP_INFO:1 BATTERY:1 CONFIGURATION:4 DEVICE_RESET_LOCALLY:1 DOOR_LOCK:2 FIRMWARE_UPDATE_MD:4 MANUFACTURER_SPECIFIC:2 POWERLEVEL:1 SCHEDULE_ENTRY_LOCK:3 SECURITY:1 SECURITY_S2:1 SUPERVISION:1 TIME:1 TRANSPORT_SERVICE:2 USER_CODE:1 VERSION:2 ZWAVEPLUS_INFO:2

setstate ZWave_ENTRY_CONTROL_33 associationAdd 1 1
setstate ZWave_ENTRY_CONTROL_33 2020-06-14 01:49:26 SECURITY ENABLED
setstate ZWave_ENTRY_CONTROL_33 2020-06-14 01:52:25 alarm AccessControl: RF Unlock Operation
setstate ZWave_ENTRY_CONTROL_33 2020-06-14 01:52:25 doorLockOperation mode: unsecured outsideHandles: 0001 insideHandles: 0001 door: open bolt: unlocked latch: open timeoutSeconds: not_supported
setstate ZWave_ENTRY_CONTROL_33 2020-06-14 01:49:27 model Poly-control Danalock V3 BTZE
setstate ZWave_ENTRY_CONTROL_33 2020-06-14 01:49:27 modelConfig polycontrol/doorlockv3.xml
setstate ZWave_ENTRY_CONTROL_33 2020-06-14 01:49:27 modelId 010e-0009-0001
setstate ZWave_ENTRY_CONTROL_33 2020-06-14 01:49:32 state associationAdd 1 1
setstate ZWave_ENTRY_CONTROL_33 2020-06-14 01:52:25 timeToAck 0.035
setstate ZWave_ENTRY_CONTROL_33 2020-06-14 01:52:25 transmit OK
setstate ZWave_ENTRY_CONTROL_33 2020-06-14 01:49:32 zwavePlusInfo  version:01 role:SleepingListeningSlave node:Z-Wave+Node installerIcon:0300 userIcon:0300

rudolfkoenig