šŸš˜ Garage Fingerprint Sensor

Writing just to say you @parrel thank you. I have created my very first ESPhome project with your info. In my case was for disarm the alarmo entity. Now waiting for a DIN rail case to finish the enclosure.

2 Likes

Just in case is useful for anyone:

1.- Iā€™ve added ā€œaura_led_controlā€ also in services section, for ā€œenrollā€, just looking for turn on light when the enroll starts.

...
api:
  password: !secret api_password
  encryption:
    key: "*******************"
  services:
  - service: enroll
    variables:
      finger_id: int
      num_scans: int
    then:
      - text_sensor.template.publish:
          id: enrolling_state
          state: "Registra tu huella"
      - fingerprint_grow.aura_led_control:
          state: ALWAYS_ON
          speed: 0
          color: BLUE
          count: 0
      - fingerprint_grow.enroll:
          finger_id: !lambda 'return finger_id;'
          num_scans: !lambda 'return num_scans;'
          ...

2.- Also added one more text_sensor to separate fingerprint_state and enrolling_state.
fingerprint_state is updated when match or unmatch, and enrolling_state when enrollment done, scan or fail.

fingerprint_grow:
  sensing_pin: GPIO21 
  on_finger_scan_matched:
    - text_sensor.template.publish:
        id: fingerprint_state
        state: "Autorizado"
    - fingerprint_grow.aura_led_control:
        state: BREATHING
        speed: 100
        color: GREEN
        count: 2
    - delay: 3s
    - text_sensor.template.publish:
        id: fingerprint_state
        state: "Escanea tu huella"
  on_finger_scan_unmatched:
    - text_sensor.template.publish:
        id: fingerprint_state
        state: "No reconocida"
    - fingerprint_grow.aura_led_control:
        state: FLASHING
        speed: 25
        color: RED
        count: 4
    - delay: 3s
    - text_sensor.template.publish:
        id: fingerprint_state
        state: "Escanea tu huella"
  on_enrollment_scan:
    - fingerprint_grow.aura_led_control:
        state: BREATHING
        speed: 50
        color: PURPLE
        count: 1
    - fingerprint_grow.aura_led_control:
        state: ALWAYS_ON
        speed: 0
        color: BLUE
        count: 0
    - text_sensor.template.publish:
        id: enrolling_state
        state: "Registrando huella"
  on_enrollment_done:
    - fingerprint_grow.aura_led_control:
        state: BREATHING
        speed: 200
        color: YELLOW
        count: 2
    - fingerprint_grow.aura_led_control:
        state: FLASHING
        speed: 25
        color: WHITE
        count: 4
    - text_sensor.template.publish:
        id: enrolling_state
        state: "Huella registrada"
    - delay: 5s
    - text_sensor.template.publish:
        id: enrolling_state
        state: "Off"
  on_enrollment_failed:
    - fingerprint_grow.aura_led_control:
        state: FLASHING
        speed: 25
        color: RED
        count: 4
    - text_sensor.template.publish:
        id: enrolling_state
        state: "Fallo al registrar huella"
    - delay: 5s
    - text_sensor.template.publish:
        id: enrolling_state
        state: "Off"
2 Likes

thanks man for the nice Guide. But I have several questions. I#ve set up an Wemos D1 mini and its working as it should I think. The main problem I have that is that I have 8 people an 2 doors which i wont to control via the scanner and i have no idea which trigger is needed in the automations for this different scenarios. is it the ā€œfingerprint last IDā€ sensor? And the second question is, when i Called the Service to enroll new Fingerprints I cant find a solution for an Visual indikator for the enrol Action.neither it shows ā€œPlace your Fingerā€ or the scanner lights up. Where do i configure this stuff?

In : Developer Tools ,Services , esphome.finger_print_enroll , set id no. and number of scan

 is it the ā€œfingerprint last IDā€

alias: Open door with finger id 6
description: ''
mode: single
trigger:
  - platform: state
    entity_id: sensor.fingerprint_last_finger_id  #difrent sensor name for the 2 doors (2 readers)
    to: '6' # replace with your id
condition: []
action: # add actions
  - device_id: ''
    domain: ''
    entity_id: ''
1 Like

Hello all

Does anyone know why i cant make this work on a D1 mini v4.0.0 (usb-c) it does work fine on a nodemcu ,im sure that i use the right gpios but i cant make
it work ?? anyone else have a problem whit the ā€œnewā€ D1 mini ?

solved : it was the password for the sensor that was the problem
i deleted the password line and it worked, then i added it agin
whit ā€œnew_ā€ in front ,and then agin whit out the ā€œnew_ā€ then
it worked fine ???

Yeah, thats the thing i know. I Mean, is it Possible to create an input Helper where i Can input a Slot Number and Assign it to a Name?

I stumbled across this project - great work everyone - maybe somebody already asked for it and I missed it scrolling through ā€¦

Would it be an option to add a function ā€œif the fingerprint doesnā€™t match, just ring the bellā€? - I would use it for my apartment door and trigger my Nuki to open the door.
But I only have a single ā€œcavity wall boxā€ where I could build it in (replace the switch for the bell with the sensor) - so the idea was to combine the sensor and the bell - so if someone touches the sensor and it doesnā€™t match a print - it should ring the bell (itā€™s a ring bell so it can be set up in automations ā€¦).

Thanks in advance!

Yes itā€™s possible, you can use on_finger_scan_unmatched: to automate something if the finger does not match. You will also need to connect the door bell to a relay, which you can then control using the ESP

1 Like

@epictechlab - if you want, you can create a template sensor in HA that references the last finger ID.

Helpers ā†’ Template Sensor

{% if is_state('sensor.garage_fingerprint_last_finger_id', '1') %}
  Tom
{% elif is_state('sensor.garage_fingerprint_last_finger_id', '2') %}
  Dick
{% elif is_state('sensor.garage_fingerprint_last_finger_id', '3') %}
  Harry
{% elif is_state('sensor.garage_fingerprint_last_finger_id', '4') %}
  Violet
{% elif is_state('sensor.garage_fingerprint_last_finger_id', '5') %}
  Rose
{% else %}
  Unknown
{% endif %}

or in configuration.yaml

template:
    # Fingerprint Sensor
  - sensor:
      - name: "Garage Door Last User"
        state: >
            {% if is_state('sensor.garage_fingerprint_last_finger_id', '1') %}
                Tom
            {% elif is_state('sensor.garage_fingerprint_last_finger_id', '2') %}
                Dick
            {% elif is_state('sensor.garage_fingerprint_last_finger_id', '3') %}
                Harry
            {% elif is_state('sensor.garage_fingerprint_last_finger_id', '4') %}
                Violet
            {% elif is_state('sensor.garage_fingerprint_last_finger_id', '5') %}
                Rose
            {% else %}
                Unknown
            {% endif %}
1 Like

I want to try to buy another 25mm button and modify it with the sensor so I have push function for ringing.

Otherwise it would suck if it cannot match your finger and you accidentally ring the bell when someone is sleeping.

Maybe someone else tried this already?

You could disable the door bell altogether at nightā€¦?

True but still not optimal

So I am now integrating a the sensor into a button. Currently waiting for the smaller 22mm version of the fingerprint.


Hi, but how did you solve it, I wouldnā€™t want to have the same problem because I have the same components. could you tell me how you did it??? A thousand thanks

Try different pins for TX and RX? Which pins are you using and which board?

iā€™m going out of my mind, because it doesnā€™t work. the configuration is correct. the logs show that eroll starts but the sensor doesnā€™t switch on. i have two of them but nothing, tried both. is it me or do the sensors suck?
Iā€™m use the platform: ESP8266 board: d1_mini
the fingerprint is a GROW R503

what do you think it could be ? i donā€™t see the light coming on at all, shouldnā€™t it come on already by connecting to 3.3 and gnd ? can anyone help me ? this is the third sensor iā€™ve tried, could it be that they are all not working ?

this is my configuration:

uart:

tx_pin: D0

rx_pin: D1

baud_rate: 57600

fingerprint_grow:

sensing_pin: D2

on_finger_scan_matched:

- fingerprint_grow.aura_led_control:

    state: BREATHING

    speed: 200

    color: BLUE

    count: 1

- text_sensor.template.publish:

    id: fingerprint_state

    state: "Authorized finger"

on_finger_scan_unmatched:

- fingerprint_grow.aura_led_control:

    state: FLASHING

    speed: 25

    color: RED

    count: 2

- text_sensor.template.publish:

    id: fingerprint_state

    state: "Unauthorized finger"

on_enrollment_scan:

- fingerprint_grow.aura_led_control:

    state: FLASHING

    speed: 25

    color: BLUE

    count: 2

- fingerprint_grow.aura_led_control:

    state: ALWAYS_ON

    speed: 0

    color: PURPLE

    count: 0

- text_sensor.template.publish:

    id: fingerprint_state

    state: "Finger scanned"

on_enrollment_done:

- fingerprint_grow.aura_led_control:

    state: BREATHING

    speed: 100

    color: BLUE

    count: 2

- text_sensor.template.publish:

    id: fingerprint_state

    state: "Enrolled fingerprint"

on_enrollment_failed:

- fingerprint_grow.aura_led_control:

    state: FLASHING

    speed: 25

    color: RED

    count: 4

- text_sensor.template.publish:

    id: fingerprint_state

    state: "Failed to enroll fingerprint"

text_sensor:

  • platform: template

    id: fingerprint_state

    name: ā€œGarage Fingerprint Stateā€

sensor:

  • platform: fingerprint_grow

    fingerprint_count:

    name: ā€œGarage Fingerprint Countā€

    id: fingerprint_count

    last_finger_id:

    name: ā€œGarage Fingerprint Last Finger IDā€

    last_confidence:

    name: ā€œGarage Fingerprint Last Confidenceā€

    status:

    name: ā€œGarage Fingerprint Statusā€

    capacity:

    name: ā€œGarage Fingerprint Capacityā€

    security_level:

    name: ā€œGarage Fingerprint Security Levelā€

services:

  • service: enroll

    variables:

    finger_id: int

    num_scans: int

    then:

    • fingerprint_grow.enroll:

      finger_id: !lambda ā€˜return finger_id;ā€™

      num_scans: !lambda ā€˜return num_scans;ā€™

  • service: enroll_next # Idea by Ralf KlĆ¼ber (thanks!)

    variables:

    num_scans: int

    then:

    • fingerprint_grow.enroll:

      finger_id: !lambda ā€˜return id(fingerprint_count).state;ā€™

      num_scans: !lambda ā€˜return num_scans;ā€™

  • service: cancel_enroll

    then:

    • fingerprint_grow.cancel_enroll:
  • service: delete

    variables:

    finger_id: int

    then:

    • fingerprint_grow.delete:

      finger_id: !lambda ā€˜return finger_id;ā€™

  • service: delete_all

    then:

    • fingerprint_grow.delete_all:

this a log:
00:20:13][C][logger:361]: Logger:
[00:20:13][C][logger:362]: Level: DEBUG
[00:20:13][C][logger:363]: Log Baud Rate: 115200
[00:20:13][C][logger:365]: Hardware UART: UART0
[00:20:13][C][uart.arduino_esp8266:102]: UART Bus:
[00:20:13][C][uart.arduino_esp8266:103]: TX Pin: GPIO16
[00:20:13][C][uart.arduino_esp8266:104]: RX Pin: GPIO5
[00:20:13][C][uart.arduino_esp8266:106]: RX Buffer Size: 256
[00:20:13][C][uart.arduino_esp8266:108]: Baud Rate: 57600 baud
[00:20:13][C][uart.arduino_esp8266:109]: Data Bits: 8
[00:20:13][C][uart.arduino_esp8266:110]: Parity: NONE
[00:20:13][C][uart.arduino_esp8266:111]: Stop bits: 1
[00:20:13][C][uart.arduino_esp8266:115]: Using software serial
[00:20:13][C][template.text_sensor:020]: Template Sensor ā€˜Garage Fingerprint Stateā€™
[00:20:13][C][fingerprint_grow:427]: GROW_FINGERPRINT_READER:
[00:20:13][C][fingerprint_grow:428]: Update Interval: 0.5s
[00:20:13][C][fingerprint_grow:429]: Fingerprint Count ā€˜Garage Fingerprint Countā€™
[00:20:13][C][fingerprint_grow:429]: State Class: ā€˜ā€™
[00:20:13][C][fingerprint_grow:429]: Unit of Measurement: ā€˜ā€™
[00:20:13][C][fingerprint_grow:429]: Accuracy Decimals: 0
[00:20:13][C][fingerprint_grow:429]: Icon: ā€˜mdi:fingerprintā€™
[00:20:13][C][fingerprint_grow:430]: Status ā€˜Garage Fingerprint Statusā€™
[00:20:13][C][fingerprint_grow:430]: State Class: ā€˜ā€™
[00:20:13][C][fingerprint_grow:430]: Unit of Measurement: ā€˜ā€™
[00:20:13][C][fingerprint_grow:430]: Accuracy Decimals: 0
[00:20:13][C][fingerprint_grow:431]: Capacity ā€˜Garage Fingerprint Capacityā€™
[00:20:13][C][fingerprint_grow:431]: State Class: ā€˜ā€™
[00:20:13][C][fingerprint_grow:431]: Unit of Measurement: ā€˜ā€™
[00:20:13][C][fingerprint_grow:431]: Accuracy Decimals: 0
[00:20:13][C][fingerprint_grow:431]: Icon: ā€˜mdi:databaseā€™
[00:20:13][C][fingerprint_grow:432]: Security Level ā€˜Garage Fingerprint Security Levelā€™
[00:20:13][C][fingerprint_grow:432]: State Class: ā€˜ā€™
[00:20:13][C][fingerprint_grow:432]: Unit of Measurement: ā€˜ā€™
[00:20:13][C][fingerprint_grow:432]: Accuracy Decimals: 0
[00:20:13][C][fingerprint_grow:432]: Icon: ā€˜mdi:securityā€™
[00:20:13][C][fingerprint_grow:433]: Last Finger ID ā€˜Garage Fingerprint Last Finger IDā€™
[00:20:13][C][fingerprint_grow:433]: State Class: ā€˜ā€™
[00:20:13][C][fingerprint_grow:433]: Unit of Measurement: ā€˜ā€™
[00:20:13][C][fingerprint_grow:433]: Accuracy Decimals: 0
[00:20:13][C][fingerprint_grow:433]: Icon: ā€˜mdi:accountā€™
[00:20:13][C][fingerprint_grow:434]: Last Confidence ā€˜Garage Fingerprint Last Confidenceā€™
[00:20:13][C][fingerprint_grow:434]: State Class: ā€˜ā€™
[00:20:13][C][fingerprint_grow:434]: Unit of Measurement: ā€˜ā€™
[00:20:13][C][fingerprint_grow:434]: Accuracy Decimals: 0
[00:20:13][C][fingerprint_grow:434]: Icon: ā€˜mdi:account-checkā€™
[00:20:13][C][captive_portal:088]: Captive Portal:
[00:20:13][C][mdns:115]: mDNS:
[00:20:13][C][mdns:116]: Hostname: fingerprint
[00:20:13][C][ota:097]: Over-The-Air Updates:
[00:20:13][C][ota:098]: Address: fingerprint.local:8266
[00:20:13][C][ota:101]: Using Password.
[00:20:13][C][api:138]: API Server:
[00:20:13][C][api:139]: Address: fingerprint.local:6053
[00:20:13][C][api:141]: Using noise encryption: YES

Do you have a picture of your wiring from the board to the sensor?

consider that the wire you see is gray and connected to the red and white for 3.3V the black to G. I put the rest, yellow on D0, brown (formerly green) on D1 and blue on D2 (sensing pin)

into log:
[10:29:50][C][logger:361]: Logger:
[10:29:50][C][logger:362]: Level: DEBUG
[10:29:50][C][logger:363]: Log Baud Rate: 115200
[10:29:50][C][logger:365]: Hardware UART: UART0
[10:29:50][C][uart.arduino_esp8266:102]: UART Bus:
[10:29:50][C][uart.arduino_esp8266:103]: TX Pin: GPIO16
[10:29:50][C][uart.arduino_esp8266:104]: RX Pin: GPIO5
[10:29:50][C][uart.arduino_esp8266:106]: RX Buffer Size: 256
[10:29:50][C][uart.arduino_esp8266:108]: Baud Rate: 57600 baud
[10:29:50][C][uart.arduino_esp8266:109]: Data Bits: 8
[10:29:50][C][uart.arduino_esp8266:110]: Parity: NONE
[10:29:50][C][uart.arduino_esp8266:111]: Stop bits: 1
[10:29:50][C][uart.arduino_esp8266:115]: Using software serial
[10:29:50][C][template.text_sensor:020]: Template Sensor ā€˜Fingerprint Stateā€™
[10:29:50][C][fingerprint_grow:427]: GROW_FINGERPRINT_READER:
[10:29:50][C][fingerprint_grow:428]: Update Interval: 0.5s
[10:29:50][C][fingerprint_grow:429]: Fingerprint Count ā€˜Fingerprint Countā€™
[10:29:50][C][fingerprint_grow:429]: State Class: ā€˜ā€™
[10:29:50][C][fingerprint_grow:429]: Unit of Measurement: ā€˜ā€™
[10:29:50][C][fingerprint_grow:429]: Accuracy Decimals: 0
[10:29:50][C][fingerprint_grow:429]: Icon: ā€˜mdi:fingerprintā€™
[10:29:50][C][fingerprint_grow:430]: Status ā€˜Fingerprint Statusā€™
[10:29:50][C][fingerprint_grow:430]: State Class: ā€˜ā€™
[10:29:50][C][fingerprint_grow:430]: Unit of Measurement: ā€˜ā€™
[10:29:50][C][fingerprint_grow:430]: Accuracy Decimals: 0
[10:29:50][C][fingerprint_grow:431]: Capacity ā€˜Fingerprint Capacityā€™
[10:29:50][C][fingerprint_grow:431]: State Class: ā€˜ā€™
[10:29:50][C][fingerprint_grow:431]: Unit of Measurement: ā€˜ā€™
[10:29:50][C][fingerprint_grow:431]: Accuracy Decimals: 0
[10:29:50][C][fingerprint_grow:431]: Icon: ā€˜mdi:databaseā€™
[10:29:50][C][fingerprint_grow:432]: Security Level ā€˜Fingerprint Security Levelā€™
[10:29:50][C][fingerprint_grow:432]: State Class: ā€˜ā€™
[10:29:50][C][fingerprint_grow:432]: Unit of Measurement: ā€˜ā€™
[10:29:50][C][fingerprint_grow:432]: Accuracy Decimals: 0
[10:29:50][C][fingerprint_grow:432]: Icon: ā€˜mdi:securityā€™
[10:29:50][C][fingerprint_grow:433]: Last Finger ID ā€˜Fingerprint Last Finger IDā€™
[10:29:50][C][fingerprint_grow:433]: State Class: ā€˜ā€™
[10:29:50][C][fingerprint_grow:433]: Unit of Measurement: ā€˜ā€™
[10:29:50][C][fingerprint_grow:433]: Accuracy Decimals: 0
[10:29:50][C][fingerprint_grow:433]: Icon: ā€˜mdi:accountā€™
[10:29:50][C][fingerprint_grow:434]: Last Confidence ā€˜Fingerprint Last Confidenceā€™
[10:29:50][C][fingerprint_grow:434]: State Class: ā€˜ā€™
[10:29:50][C][fingerprint_grow:434]: Unit of Measurement: ā€˜ā€™
[10:29:50][C][fingerprint_grow:434]: Accuracy Decimals: 0
[10:29:50][C][fingerprint_grow:434]: Icon: ā€˜mdi:account-checkā€™
[10:29:51][C][captive_portal:088]: Captive Portal:
[10:29:51][C][mdns:115]: mDNS:
[10:29:51][C][mdns:116]: Hostname: fingerprint
[10:29:51][C][ota:097]: Over-The-Air Updates:
[10:29:51][C][ota:098]: Address: fingerprint.local:8266
[10:29:51][C][ota:101]: Using Password.
[10:29:51][C][api:138]: API Server:
[10:29:51][C][api:139]: Address: fingerprint.local:6053
[10:29:51][C][api:141]: Using noise encryption: YES
[10:32:14][I][fingerprint_grow:066]: Starting enrollment in slot 10
[10:32:21][D][fingerprint_grow:307]: Setting Aura LED ->> no led on!
[10:32:22][E][fingerprint_grow:421]: No response received from reader
[10:32:22][D][text_sensor:064]: ā€˜Fingerprint Stateā€™: Sending state ā€˜Failed to enroll fingerprintā€™
[10:32:22][I][fingerprint_grow:089]: Finished enrollment
[10:32:22][W][component:214]: Component api took a long time for an operation (1.05 s).
[10:32:22][W][component:215]: Components should block for at most 20-30ms.



You switched the RX and TX pins. Yellow should be on D1

yes I just tried but the reader does not respond.
yet they confirm to me that it has been tested and is working.
uart:
tx_pin: D0 ā†’ on esp at D1
rx_pin: D1 ā†’ on the esp at D0
baud_rate: 57600

fingerprint_grow:
sensing_pin: D2

can you think of what it could be? i am now sending the photo of the esp because it also has tx and rx pins