You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 25, 2022. It is now read-only.
I am using your great project in an docker container on a Synology NAS. I have a Dahua VTO4202 with two Lockes, second lock connected to the DEE1010B.
When starting the container lock #1 is always automatically unlocked, didn´t know why and how to prevent:
Fortunately there is nothing connected to lock#1, just to lock#2. But I have a voice announcement that the door gets open.
Log at startup:
2021-08-24 13:20:27,856 INFO main Connecting
2021-08-24 13:20:27,867 INFO main Initializing MQTT Broker
2021-08-24 13:20:27,868 INFO main MQTT Broker is trying to connect...
2021-08-24 13:20:27,873 INFO main MQTT Broker connected with result code 0
2021-08-24 13:20:27,922 INFO main Get access control configuration
2021-08-24 13:20:27,923 INFO main Get version
2021-08-24 13:20:27,924 INFO main Get serial number
2021-08-24 13:20:27,924 INFO main Get device type
2021-08-24 13:20:27,925 INFO main Attach event manager
2021-08-24 13:20:27,944 INFO main Version: 4.500.0000001.0.R, Build Date: 2021-07-13
2021-08-24 13:20:27,996 INFO main Hold time: 3
2021-08-24 13:20:28,076 INFO main Access Control - Unlocked magnetic lock #1
2021-08-24 13:20:29,883 INFO main Access Control - Door #1 is already unlocked, ignoring request
2021-08-24 13:20:31,158 INFO main Access Control - Locked magnetic lock #1
After some time, often at night I seems to have disconnects to my MQTT Broker, at every disconnect its starting again unlocking Lock#1:
2021-08-24 04:25:55,357 INFO main MQTT Broker got disconnected, trying to reconnect...
2021-08-24 04:25:55,361 INFO main MQTT Broker connected with result code 0
2021-08-24 04:25:55,564 INFO main Access Control - Unlocked magnetic lock #1
2021-08-24 04:25:57,371 INFO main Access Control - Door #1 is already unlocked, ignoring request
2021-08-24 04:25:58,654 INFO main Access Control - Locked magnetic lock #1
2021-08-24 04:27:41,242 INFO main MQTT Broker got disconnected, trying to reconnect...
2021-08-24 04:27:41,247 INFO main MQTT Broker connected with result code 0
2021-08-24 04:27:41,452 INFO main Access Control - Unlocked magnetic lock #1
2021-08-24 04:27:43,256 INFO main Access Control - Door #1 is already unlocked, ignoring request
2021-08-24 04:27:44,580 INFO main Access Control - Locked magnetic lock #1
2021-08-24 04:28:57,822 INFO main MQTT Broker got disconnected, trying to reconnect...
2021-08-24 04:28:57,826 INFO main MQTT Broker connected with result code 0
2021-08-24 04:28:58,030 INFO main Access Control - Unlocked magnetic lock #1
2021-08-24 04:28:59,837 INFO main Access Control - Door #1 is already unlocked, ignoring request
2021-08-24 04:29:01,128 INFO main Access Control - Locked magnetic lock #1
[...]
On Debug mode I can see MQTT Message DahuaVTO/Command/Open, but its not getting from my Broker (tried with fresh installed mosquitto with any publishing)
2021-08-24 13:28:34,334 DEBUG main MQTT Message DahuaVTO/Command/Open:
2021-08-24 13:28:34,335 INFO main Access Control - Unlocked magnetic lock #1
Any Idea whats wrong? Before I had used your Scripts as Addons inside HomeAssistant VM, there wasn´t any output about unlocking lock#1.
Thanks in advanced!
The text was updated successfully, but these errors were encountered:
i had the same issue when using this script.
The solution was to make some changes to the on_mqtt_message function
replace
if msg.topic == userdata.mqtt_open_door_topic:
data = {}
if payload is not None and len(payload) > 0:
data = json.loads(payload)
door_id = data.get("Door", 1)
userdata.access_control_open_door(door_id)
with
if msg.topic == userdata.mqtt_open_door_topic:
data = {}
messageOk = False
if payload is not None and len(payload) > 0:
try:
data = json.loads(payload)
except ValueError as e:
data = {}
if "Door" in data:
door_id = data.get("Door", 1)
if door_id.isnumeric() == True and door_id > 0:
userdata.access_control_open_door(door_id)
messageOk = True
if messageOk == False:
_LOGGER.error("Door is not numeric - please use following format {\"Door\":1}")
_LOGGER.debug(f"Publishing MQTT message {userdata.mqtt_open_door_topic}")
client.publish(userdata.mqtt_open_door_topic, "")
@bazidibavaria, it seems the last line of code will repeat itself one there is an issue,
you are publishing an empty payload event, catch the exception and re-publish it.
one the messageOk is false, it should be aborted, unless you have meant it to work with default.
Anyway, will add the concept of the code and release an new version
Hi,
I am using your great project in an docker container on a Synology NAS. I have a Dahua VTO4202 with two Lockes, second lock connected to the DEE1010B.
When starting the container lock #1 is always automatically unlocked, didn´t know why and how to prevent:
Fortunately there is nothing connected to lock#1, just to lock#2. But I have a voice announcement that the door gets open.
Log at startup:
2021-08-24 13:20:27,856 INFO main Connecting
2021-08-24 13:20:27,867 INFO main Initializing MQTT Broker
2021-08-24 13:20:27,868 INFO main MQTT Broker is trying to connect...
2021-08-24 13:20:27,873 INFO main MQTT Broker connected with result code 0
2021-08-24 13:20:27,922 INFO main Get access control configuration
2021-08-24 13:20:27,923 INFO main Get version
2021-08-24 13:20:27,924 INFO main Get serial number
2021-08-24 13:20:27,924 INFO main Get device type
2021-08-24 13:20:27,925 INFO main Attach event manager
2021-08-24 13:20:27,944 INFO main Version: 4.500.0000001.0.R, Build Date: 2021-07-13
2021-08-24 13:20:27,996 INFO main Hold time: 3
2021-08-24 13:20:28,076 INFO main Access Control - Unlocked magnetic lock #1
2021-08-24 13:20:29,883 INFO main Access Control - Door #1 is already unlocked, ignoring request
2021-08-24 13:20:31,158 INFO main Access Control - Locked magnetic lock #1
After some time, often at night I seems to have disconnects to my MQTT Broker, at every disconnect its starting again unlocking Lock#1:
2021-08-24 04:25:55,357 INFO main MQTT Broker got disconnected, trying to reconnect...
2021-08-24 04:25:55,361 INFO main MQTT Broker connected with result code 0
2021-08-24 04:25:55,564 INFO main Access Control - Unlocked magnetic lock #1
2021-08-24 04:25:57,371 INFO main Access Control - Door #1 is already unlocked, ignoring request
2021-08-24 04:25:58,654 INFO main Access Control - Locked magnetic lock #1
2021-08-24 04:27:41,242 INFO main MQTT Broker got disconnected, trying to reconnect...
2021-08-24 04:27:41,247 INFO main MQTT Broker connected with result code 0
2021-08-24 04:27:41,452 INFO main Access Control - Unlocked magnetic lock #1
2021-08-24 04:27:43,256 INFO main Access Control - Door #1 is already unlocked, ignoring request
2021-08-24 04:27:44,580 INFO main Access Control - Locked magnetic lock #1
2021-08-24 04:28:57,822 INFO main MQTT Broker got disconnected, trying to reconnect...
2021-08-24 04:28:57,826 INFO main MQTT Broker connected with result code 0
2021-08-24 04:28:58,030 INFO main Access Control - Unlocked magnetic lock #1
2021-08-24 04:28:59,837 INFO main Access Control - Door #1 is already unlocked, ignoring request
2021-08-24 04:29:01,128 INFO main Access Control - Locked magnetic lock #1
[...]
On Debug mode I can see MQTT Message DahuaVTO/Command/Open, but its not getting from my Broker (tried with fresh installed mosquitto with any publishing)
2021-08-24 13:28:34,334 DEBUG main MQTT Message DahuaVTO/Command/Open:
2021-08-24 13:28:34,335 INFO main Access Control - Unlocked magnetic lock #1
Any Idea whats wrong? Before I had used your Scripts as Addons inside HomeAssistant VM, there wasn´t any output about unlocking lock#1.
Thanks in advanced!
The text was updated successfully, but these errors were encountered: