[BUG] DT resends last mqtt message after reconnecting
Mikescotland opened this issue · 6 comments
Describe the bug
After losing connection and reconnecting to mqtt, double take seems to send again the last mqtt message with person recognised.
At 00:05 recognised me with 98.5%.
At 3:05 lost connection with mqtt server and immediately after reconnected. Received the notification from HA with exactly the same parameters as at 00:05
After reconnecting the sensor.person.dounble-take changes from unavailable to person, exactly like a person was recognised by DT.
This is a very dangerous behaviour as automation worked and unlocked my entry door (as all other conditions in HA were also satisfied).
Here is from the log:
24-01-19 03:05:23 error: MQTT: offline
24-01-19 03:05:33 warn: MQTT: reconnecting
24-01-19 03:05:33 info: MQTT: connected
Version of Double Take
1.13.11.9rc2
Expected behavior
MQTT message should not fire again after reconnecting.
Sensor person should not change from unavailable to person but stay at unavailable
Screenshots
If applicable, add screenshots to help explain your problem.
Hardware
- Architecture or platform: [amd64,
- OS: [e.g. Ubuntu
- Browser (if applicable) [e.g. Chrome, Safari]
- Docker image (if applicable) [e.g. skrashevich/double-take:latest]
Configuration
You configuration files, related to problem
Additional context
Add any other context about the problem here.
This is not a bug, this is the expected behavior: when connecting to the MQTT server, double-take sends a message to availability_topic and the sensor goes from the "unavailable" state to the last saved one.
To avoid this, you can set the setting
mqtt:
expire_after: 0
(link to doc: https://github.com/skrashevich/double-take/tree/beta#mqtt-1)
Also, I must make your attention to the fact that neither double-take nor any of the supported facial recognition services are intended for use in security systems. For example, a malicious can simply show your photo to the camera and the door will open.
Yes, that is why I have a bunch of other conditions including Bluetooth beacons and WiFi connection. All of them must be satisfied before lock takes into account face recognised.
I'm using it for a good few months, just noticed this mqtt problem because happened that all conditions were satisfied for the first time when this happened.
I will add a few more conditions.
This is not a bug, this is the expected behavior: when connecting to the MQTT server, double-take sends a message to availability_topic and the sensor goes from the "unavailable" state to the last saved one. To avoid this, you can set the setting
mqtt: expire_after: 0(link to doc: https://github.com/skrashevich/double-take/tree/beta#mqtt-1)
The option mqtt expire after did not change the behaviour.
Sensor.doubletake.person still stays on for 10 min.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue was closed because it has been stalled for 5 days with no activity.