Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Receiving a second incorrect Mqtt message #61

Open
PregLizZz opened this issue Jan 9, 2023 · 2 comments
Open

Receiving a second incorrect Mqtt message #61

PregLizZz opened this issue Jan 9, 2023 · 2 comments

Comments

@PregLizZz
Copy link

Hi,
first of all, thanks a lot for this amazing project. I have the following problem:
When the finger is placed on the sensor and removed I always receive a the correct mqtt messages, with
lastLogMessages, ring, matchId, matchName, matchConfidence
always filled with the correct values.
3 seconds later I always receive another set of messages always not recognized and always without lastLogMessages so only:
ring, matchId, matchName, matchConfidence
In the grey div of http://fingerprintdoorbell/ I only see the correct message not the unrecognized one 3 seconds later. The problem seems to be only in mqtt.
I've already tried to factory reset but no luck. Maybe I'm overlooking something and someone can help me out.
Thanks for your help.

@frickelzeugs
Copy link
Owner

frickelzeugs commented Jan 13, 2023

Hi,

thats the designed behaviour and also mentioned in the documentation:

MQTT Topic Action Values
fingerprintDoorbell/ring publish "off" by default, on a ring event switching to "on" for 1s
fingerprintDoorbell/matchId publish "-1" by default, if a match was found the value holds the matching id (e.g. "27") for 3s
fingerprintDoorbell/matchName publish "" by default, if a match was found the value holds the matching name for 3s
fingerprintDoorbell/matchConfidence publish "" by default, if a match was found the value holds the conficence (number between "1" and "400", 1=low, 400=very high) for 3s
fingerprintDoorbell/ignoreTouchRing subscribe read by FingerprintDoorbell and enables/disables the touch ring (see FAQ below for details)

You have to evaluate the payload of the mqtt topic, not only do stuff when the topic was sent.

@joBr99
Copy link

joBr99 commented Jan 31, 2023

As mqtt is usally more event based and it's easier to work with if you just have all values available I've personally added a new topic /match which is going to send all information as json in one message.

        mqttClient.publish((String(mqttRootTopic) + "/match").c_str(), String("{\"matchId\": " + String(match.matchId) + ",\"matchName\": \"" + match.matchName + "\",\"matchConfidence\": " + String(match.matchConfidence) + "}").c_str());

This way I can do easily things like if matchConfidence > 10 and matchName == "xyz" than open door

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants