[Solved] Danalock Z-wave lock MQTT controlled opening always after FHEM restart

Begonnen von TomekWaw, 19 November 2020, 03:07:31

Vorheriges Thema - Nächstes Thema

TomekWaw

Hi,
I've been using Danalock Z-wave smart lock with FHEM successfully for some time, but since I veeeeeeeery rarely need to restart my RPIi with FHEM, I haven't noticed this strange issue.
My lock opens every FHEM start.
I'm not sure what causes this.

I control my lock via MQTT commands to topic: loxone/Danalock_V3/state
with messages: doorLockOperation open or doorLockOperation close
then are then put into "state" value

But during FHEM restart no new MQTT messages are published and the lock is being opened.
I have no idea why.. :/

Please find my full config (besides HomeId) below.


attr Danalock_V3 IODev ZWDongle_0
attr Danalock_V3 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 Danalock_V3 devStateIcon closed:status_locked@green open:status_open@red
attr Danalock_V3 icon building_security
attr Danalock_V3 mqttSubscribe state:stopic=loxone/Danalock_V3/state
attr Danalock_V3 room ZWave
attr Danalock_V3 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 Danalock_V3 stateFormat {(ReadingsVal($name,"doorLockOperation","") =~ /^mode: unsecured .*$/ ) ? ("open") : (ReadingsVal($name,"doorLockOperation","") =~ /^mode: secured .*$/ ) ? ("closed") : ("UNDEFINED") }
attr Danalock_V3 userReadings doorLockState:doorLockOperation.* {(ReadingsVal($name,"doorLockOperation","") =~ /^mode: unsecured .*$/ ) ? ("open") : (ReadingsVal($name,"doorLockOperation","") =~ /^mode: secured .*$/ ) ? ("closed") : ("UNDEFINED") }
attr Danalock_V3 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 Danalock_V3 closed
setstate Danalock_V3 2020-06-14 01:49:26 SECURITY ENABLED
setstate Danalock_V3 2020-11-18 15:20:54 SEND_DATA failed:00
setstate Danalock_V3 2020-11-19 02:48:15 alarm AccessControl: RF Lock Operation
setstate Danalock_V3 2020-06-14 03:02:31 battery 79 %
setstate Danalock_V3 2020-06-14 03:02:31 batteryPercent 79
setstate Danalock_V3 2020-06-14 03:02:31 batteryState ok
setstate Danalock_V3 2020-06-14 03:04:46 configAutolock 0
setstate Danalock_V3 2020-06-14 03:04:46 configBLEAlwaysAllowed Disable
setstate Danalock_V3 2020-06-14 03:04:46 configBLETemporaryAllowed 0
setstate Danalock_V3 2020-06-14 03:04:47 configBlockToBlock Disable
setstate Danalock_V3 2020-06-14 03:04:47 configHoldAndRelease 1
setstate Danalock_V3 2020-06-14 03:04:47 configTwistAssist Enabled
setstate Danalock_V3 2020-06-14 03:03:41 doorLockConfiguration mode: constant outsideHandles: 0001 insideHandles: 0001 timeoutSeconds: not_supported
setstate Danalock_V3 2020-11-19 02:48:15 doorLockOperation mode: secured outsideHandles: 0001 insideHandles: 0001 door: closed bolt: locked latch: closed timeoutSeconds: not_supported
setstate Danalock_V3 2020-11-19 02:48:15 doorLockState closed
setstate Danalock_V3 2020-06-14 01:49:27 model Poly-control Danalock V3 BTZE
setstate Danalock_V3 2020-06-14 01:49:27 modelConfig polycontrol/doorlockv3.xml
setstate Danalock_V3 2020-06-14 01:49:27 modelId 010e-0009-0001
setstate Danalock_V3 2020-06-14 03:03:58 powerlvl current 0 remain 0
setstate Danalock_V3 2020-11-19 02:48:11 state doorLockOperation close
setstate Danalock_V3 2020-11-19 02:48:15 timeToAck 0.061
setstate Danalock_V3 2020-11-19 02:48:15 transmit OK
setstate Danalock_V3 2020-06-14 03:04:11 version Lib 3 Prot 5.03 App 1.3 HW 4 FWCounter 1 FW 0.15
setstate Danalock_V3 2020-06-14 01:49:32 zwavePlusInfo version:01 role:SleepingListeningSlave node:Z-Wave+Node installerIcon:0300 userIcon:0300

Beta-User

May be caused by retained messages on your MQTT Server?
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

TomekWaw

But the last message that would be received by FHEM during start would be "DoorOperation close" (loxone/Danalock_V3/state) isn't it?
That should not open the lock.
If I publish multiple times such message to that topic when the lock is closed, it does not get unlocked.

Beta-User

Not sure about that.

Imo it depends, which way you've chosen last to open or close. If last action via MQTT had been "open", this message is stored on the MQTT Server and thus resend on FHEM reconnection to it in case if the message was marked as "retain".
So please doublecheck first if all your clients sending to the Server/Broker do NOT use the retain flag or make sure you ALWAYS choose the MQTT way to lock or unlock the door.
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

TomekWaw

Thanks a lot for your ideas!
Seems that you were right.
I've been testing Alexa/Homebridge integration with that lock and I've accidentally added retain flag with Node-RED test flow.
After I've removed the retain flag from that topic its all OK now.

Thank you very much!

Beta-User

You're welcome!

Please mark the thread as solved, and additionaly, I'd suggest to add a "MQTT" keyword in the thread title - this kind of problem isn't Z-Wave related at all ;) ...
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

TomekWaw