EverythingSmartHome / fingerprint-mqtt

Fingerprint sensor with MQTT support based on Adafruit Fingerprint Sensor Library
GNU General Public License v3.0
24 stars 14 forks source link

Fingerprint matched but unavailable name #17

Closed alinm4 closed 1 year ago

alinm4 commented 1 year ago

Hi, I am using Home assistant in a virtual environment with the following:

Home Assistant 2022.10.3 Supervisor 2022.10.0 Operating System 9.2 Frontend 20221010.0 - latest.

I've used your code to set fingerprint and I recorded 3 of my fingers with different names but only the last one has a name available. The other 2 are unavaillable but matched. I've used scripts.yaml and configuration.yaml but splited with sensors.yaml. This is in configuration.yaml:

The rest is in sensors.yaml

What am I missing?

unseemlycoder commented 1 year ago

This may not be the issue but is worth trying. After you set the fields 'ID' and 'Name' on Home assistant, click elsewhere to remove focus on the text fields and then click on "Learn". I had issues with names being mismatched with the ID. Do check the min and max length of ID in HA frontend.

If you're using mosquitto mqtt, debug the messages sent from HA and your microcontroller to get a better idea:

mosquitto_sub -h localhost -t /fingerprint/mode/status -u <user> -P <pwd>

image

unseemlycoder commented 1 year ago

Other topics include:

#define STATE_TOPIC                   "/fingerprint/mode/status"
#define MODE_LEARNING                 "/fingerprint/mode/learning"
#define MODE_READING                  "/fingerprint/mode/reading"
#define MODE_DELETE                   "/fingerprint/mode/delete"
#define AVAILABILITY_TOPIC            "/fingerprint/available"
alinm4 commented 1 year ago

Thanks, I'll check it out.

Alin

On Tue, 25 Oct 2022, 12:12 unseemlycoder, @.***> wrote:

This may not be the issue but is worth trying. After you set the fields 'ID' and 'Name' on Home assistant, click elsewhere to remove focus on the text fields and then click on "Learn". I had issues with names being mismatched with the ID. Do check the min and max length of ID in HA frontend.

If you're using mosquitto mqtt, debug the messages sent from HA and your microcontroller to get a better idea:

mosquitto_sub -h localhost -t /fingerprint/mode/status -u -P

[image: image] https://user-images.githubusercontent.com/56648438/197732032-6b5ee9c8-34c1-4fbf-a7e3-dc486d9e7a8b.png

— Reply to this email directly, view it on GitHub https://github.com/EverythingSmartHome/fingerprint-mqtt/issues/17#issuecomment-1290236705, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANME6SV4JRZ4K6MUHP6QRUTWE6P6TANCNFSM6AAAAAARCTIFLU . You are receiving this because you authored the thread.Message ID: @.***>

alinm4 commented 1 year ago

I've tried with click elsewere but no luck. My fingerprint data seems to store only 1 ID-NAME pair. If I write a new ID-NAME pair it is ok until I delete one. After I learned 3 of my fingerprints, I have wrote 3 ID_NAME pairs as bellow [{"id": 1, "name": "Alin1"},{"id": 2, "name": "Alin2"},{"id": 3, "name": "Alin3"}] and it works ok until I record a new fingerprint that deletes all 3 previous fingerprints recorded. Where is fingerprint data stored? Can I check it or edit it?

https://user-images.githubusercontent.com/56119114/198126414-f46add7b-202e-4a07-8b88-2caee8848e57.mp4

One more question: I have Mosquitto broker installed so where do I have to use mosquitto_sub -h localhost -t /fingerprint/mode/status -u -P to check?

This is my sensor.yaml file:

sensor.txt

Alin

unseemlycoder commented 1 year ago

Hey Alin,

It looks like your helper entity input_text.fingerprint_data is getting overwritten on learning a new finger.

Can you check the min and max length defined for this? I have it set as min=1 and max=512 Similarly, for ID and Name helpers I have it set as min=1 max=127.

image

I don't think you can edit the value of fingerprint_data. When I tried to do it through developer options, it would go back to the old value.

image

Your sensor.yaml is in line with my config for fingerprint. No issues there; do check your configuration.yaml for mqtt platform block and the scripts.yaml.

That command is to be run on the terminal. If you're using Home assistant OS, get the terminal add-on; or just ssh in to your host system that's running mosquitto mqtt. If no user or password is set for mosquitto, you can drop the -u and -P flags

mosquitto_sub -h localhost -t /fingerprint/mode/status

image

When I set this system up, I just followed OP's youtube video and guide; went through without hiccups. Have you checked out his video?

Akash

alinm4 commented 1 year ago

Hi Akash, My max length for fingerprint_data was 500, as in tutorial. I set it to 512 as yours. Fingerprint_ID was 1 to 127. Last night I have modified the fingerprint data circle in red and is still there until I record a new fingerprint. Fingerprint settings In scripts.yaml I have copied text from here (fingerprint-mqtt/Home Assistant/scripts.yaml): scripts.txt and my configuration.yaml has a few lines from here too (fingerprint-mqtt/Home Assistant/configuration.yaml): configuration-mqtt.txt because I have splitted it between sensor.yaml and configuration.yaml

Thank you for help. I will try out the command in teminal and see if i get something when I get home.

alinm4 commented 1 year ago

I rechecked the helpers and, from some unknown reason, all 3 helpers (id, data and name) were starting from 0 to 127/512. I updated them from 1 to 127/512 and now everything is OK. Thank you for your help Akash.

unseemlycoder commented 1 year ago

Glad to see your issue resolved :D Can we move to close #17 ?

alinm4 commented 1 year ago

It looks that helpers had some issues with min/max limits and needs to reset limits from min=1 to max=127 for fingerprint_id and min=1 to max=512 for fingerprint_data/fingerprint_person.