šŸš˜ Garage Fingerprint Sensor

Anybody had any success either
a) using a centralised store of fingerprints (unlikely!!)
or
b) exporting the fingerprints to use on multiple devices?

Also, has anyone ever had the fingerprint reader start fail to recognise fingerprints despite the fact theyā€™re still stored in one of the slots? This has happened to me twice and I canā€™t figure out why, yet.

Hello
I have a esp8266 d1mini with 503r working without any problem, but I am stuck with the card ā€¦ tried what @burg93 shared above doesnā€™t work, and i am sure the reason is my very poor knowledgeā€¦
I create the helpers:

input_number.fingerprint_learning_id
input_text.fingerprint_learning_name

And the scripts

  - service: esphome.fingerprint_reader_enroll
    data:
      num_scans: 2
      finger_id: "{{states('input_number.fingerprint_learning_id') | int}}"
  - service: saver.set_variable
    data:
      name: "{{states('input_number.fingerprint_learning_id') | int}}"
      value: "{{states('input_text.fingerprint_learning_name')}}"


  - service: saver.delete_variable
    data:
      name: "{{states('input_number.fingerprint_learning_id') | int}}"
  - service: esphome.fingerprint_reader_delete
    data:
      finger_id: "{{states('input_number.fingerprint_learning_id') | int}}"

The only working way to enroll a new fingerprint is calling the service from the developer tool, calling the service by a button card or calling the script doesnā€™t work and I get an error message saying the data required by the service (enroll) is missing (finger_id)
I hope someone would like to give me a hand to help me :slight_smile:
Below my esp config

esphome:
  name: fingerprint
  friendly_name: fingerprint

esp8266:
  board: d1_mini

# Enable logging
logger:

ota:
  password: "mypassword"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Test Fallback Hotspot"
    password: "mypassword"

web_server:
  port: 80


uart:
  rx_pin: D6
  tx_pin: D5
  baud_rate: 57600

fingerprint_grow:
  sensing_pin: D7
  on_finger_scan_matched:
    - text_sensor.template.publish:
        id: fingerprint_state
        state: "Impronta autorizzata"
    - delay: 300ms
    - text_sensor.template.publish:
        id: fingerprint_state
        state: "Attesa"
    - fingerprint_grow.aura_led_control:
        state: BREATHING
        speed: 200
        color: BLUE
        count: 1
  on_finger_scan_unmatched:
    - text_sensor.template.publish:
        id: fingerprint_state
        state: "Impronta non autorizzata"
    - fingerprint_grow.aura_led_control:
        state: FLASHING
        speed: 25
        color: RED
        count: 2
  on_enrollment_scan:
    - text_sensor.template.publish:
        id: fingerprint_state
        state: "Impronta acquisita"
    - text_sensor.template.publish:
        id: fingerprint_state
        state: "Impronta acquisita"
    - 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
  on_enrollment_failed:
    - text_sensor.template.publish:
        id: fingerprint_state
        state: "Acquisizione impronta fallita"
    - fingerprint_grow.aura_led_control:
        state: FLASHING
        speed: 25
        color: RED
        count: 4


# Optional template text sensor for visual feedback
text_sensor:
  - platform: template
    id: fingerprint_state
    name: "Stato Impronta"
binary_sensor:
  - platform: status
    id: fingerprint_status
    name: "EspHome Node Status"

  - platform: template
    name: "Enroll Fingerprint Sensor"
    id: enroll_sensor
    lambda: "return true;"


# Optional sensors
  - platform: fingerprint_grow
    id: fingerprint_enrolling
    name: "Acquisendo impronta"
switch:
  - platform: restart
    id: fingerprint_restart
    name: "EspHome Node Restart"
sensor:
  - platform: fingerprint_grow
    fingerprint_count:
      name: "Numero Impronte"
      id: fingerprint_count
    last_finger_id:
      name: "Ultimo ID impronta"
    last_confidence:
      name: "AffidabilitĆ  ultima impronta"
    status:
      name: "Stato impronta"
    capacity:
      name: "CapacitĆ  impronta"
    security_level:
      name: "Livello di sicurezza"






# Enable Home Assistant API
api:
  encryption:
    key: "mykey"
  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;'
      - fingerprint_grow.aura_led_control:
          state: ALWAYS_ON
          speed: 0
          color: PURPLE
          count: 0
  #- service: saver.set_variable
   # data:
    # name: "{{states('input_number.learning_id') | int}}"
     #value: "{{states('input_text.learning_name')}}"
  - 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:

I followed your instructions and got everything up and running. Thanks, that bit with the saver integration was awesome!
Now I would love to be able to see not only Last Fingerprint ID, which is of course an entity of the reader, but the associated name from the saver variable. How would I put that next to the fingerprint_state entity in a glance card for example?
This way I wouldnā€™t have to manually look up the name to the corresponding ID in my markdown card and would be able to just see it at a glace.

I created a sensor based on _last_finger_id as such:

    garage_fingerprint_person:
      friendly_name: "Garage Fingerprint Person"
      value_template: >-
        {% if is_state('sensor.garage_fingerprint_last_finger_id', '1') %}
          XXX
        {% elif is_state('sensor.garage_fingerprint_last_finger_id', '11') %}
          XXX
        {% elif is_state('sensor.garage_fingerprint_last_finger_id', '21') %}
          XXX
        {% elif is_state('sensor.garage_fingerprint_last_finger_id', '2') %}
          YYY
        {% elif is_state('sensor.garage_fingerprint_last_finger_id', '12') %}
          YYY
        {% elif is_state('sensor.garage_fingerprint_last_finger_id', '22') %}
          YYY
        {% elif is_state('sensor.garage_fingerprint_last_finger_id', '3') %}
          ZZZ
        {% elif is_state('sensor.garage_fingerprint_last_finger_id', '13') %}
          ZZZ
        {% elif is_state('sensor.garage_fingerprint_last_finger_id', '23') %}
          ZZZ
        {% elif is_state('sensor.garage_fingerprint_last_finger_id', '4') %}
          WWW
        {% elif is_state('sensor.garage_fingerprint_last_finger_id', '14') %}
          WWW
        {% elif is_state('sensor.garage_fingerprint_last_finger_id', '24') %}
          WWW
        {% elif states('sensor.garage_fingerprint_last_finger_id') | int(0) > 1 %}
          {{states('sensor.garage_fingerprint_last_finger_id') | int(0)}} Not Coded
        {% elif is_state('sensor.garage_fingerprint_last_finger_id', 'Unknown') %}
          Not matched
        {% elif is_state('sensor.garage_fingerprint_state', 'Scan your finger') %}
          Waiting
        {% elif is_state('sensor.garage_fingerprint_state', 'Unauthorized finger') %}
          Not matched
        {% endif %}
      icon_template: >-
        {% if is_state('sensor.fingerprint', 'Waiting') %}
          mdi:human-male
        {% elif is_state('sensor.fingerprint', 'Matched') %}
          mdi:human-greeting
        {% elif is_state('sensor.fingerprint', 'Not matched') %}
          mdi:police-badge
        {% endif %}

Further FWIW, I have an automation trigger on ā€˜Authorized Fingerā€™ state that writes who opened the door at what time to an input_text entity. Hereā€™s that part of the automation:

  - service: input_text.set_value
    target:
      entity_id: input_text.garage_fingerprint_1
    data:
      value: '{{ states(''sensor.garage_fingerprint_person'') }} {{ ''opened'' if
        is_state(''cover.garage_door_east_zw'',''closed'') else ''closed'' }} at {{
        states(''sensor.pretty_time'') }} {{ states(''sensor.pretty_day'') }}'

Which displays like this:
image

1 Like

Iā€™m really new to all of this, so Iā€™m not sure that Iā€™m completely getting it, but you put that sensor in the ESPHome YAML Code, right? Or is that something that would go in the Config?
And it looks like you have to put the Name of the person to the corresponding ID manually in the code, right? Thats the XXX and YYY in your code? The nice thing about the way @burg93 did it, is that I have a text helper and a numbers helper in lovelace, so I can put names to the IDs while learning the print. Also makes it really easy to rename or delete.

Although I know that realistically Iā€™ll train the reader once on everybody whoā€™s really gonna use it and then probably never touch it again. :sweat_smile:

I bought from official ā€œgrow tech storeā€ on AliExpress. R503 wire colour has changed green wire is now purple/brownish it works perfectly. So not knock-off in this case.

Initially i accidentally ordered 5v version i realised contacted seller, cancelled and reordered 3.3v. the seller was great about this. They also sent me links to manuals and sdk, and included business card for help in the package.

I worked out mine is adafruit, not grow. It works straight away with the adafruit library but doesnā€™t work with the grow library.
Thanks! :smiley:

Iā€™m struggling with mine.

It works if I donā€™t connect the TCH pin to GPIO05, I get a constant scrolling of ā€¦

[22:01:30][D][fingerprint_grow:123]: Getting image 1
[22:01:30][D][fingerprint_grow:133]: No finger

then when I touch the screen, it will read my fingerprint and do what it should, however ā€¦
If I connect the TCH pin, then it scrolls the same but when I touch the screen the scrolling stops and it struggles to get a fingerprint.

I have a suspicion that the pin is inverted as it would make more sense to me that it would be quiet until I touched the screen and then it would check for fingerprints.

I get a good 3.3v from the TCH pin when touched.

Any Ideas?

Try to invert the pin by replacing

sensing_pin: D2

with

sensing_pin:
      number: D2
      inverted: true
1 Like

Thanks @parrel , you know when youā€™ve been trying to work something out for hours and it just wonā€™t come to you? :wink:

I also changed it back to GPIO05

BTW, works a treat. Itā€™s a AS608 fyi

1 Like

Hi,
Iā€™d like to use this for my 2 door garage even when the wlan is down, without HA automations. So is it somehow possible to use these two relays in my config with different fingers in esp only?

...
# Relays

switch:

  - platform: gpio

    pin: 18

    inverted: true

    name: garage_door_relay

    id: garage_door_relay

  - platform: gpio

    pin: 19

    inverted: true

    name: garage_door2_relay

    id: garage_door2_relay    

# Finger print sensor R503 3V3

uart:

  tx_pin: GPIO17

  rx_pin: GPIO16

  baud_rate: 57600

fingerprint_grow:

  sensing_pin: GPIO04

  on_finger_scan_matched:

    - switch.turn_on: garage_door_relay

    - delay: 500ms

    - switch.turn_off: garage_door_relay    

    - fingerprint_grow.aura_led_control:

        state: BREATHING

        speed: 200

        color: GREEN

        count: 1

    - text_sensor.template.publish:

        id: fingerprint_state

        state: "Authorized finger"

    - lambda: |-

        if (finger_id == 0) {

          id(fingerprint_username).publish_state("1");

        } else if (finger_id == 1) {

          id(fingerprint_username).publish_state("2");

        } else {

          id(fingerprint_username).publish_state("Unknown");

        };
...

Yes, just add

    - switch.turn_on: garage_door_relay
    - delay: 500ms
    - switch.turn_off: garage_door_relay

into an yaml if block which looks like

- if:
        condition:
          ...
        then:
          ...

Thanks @parrel
I managed to solve two door system like this, not sure if itā€™s good way, but itā€™s working:

- lambda: |-
        if (finger_id == 10) {
          id(garage_door_relay).turn_on();
          delay(500);
          id(garage_door_relay).turn_off();
          id(fingerprint_username).publish_state("Me");
        } else if (finger_id == 13) {
          id(garage_door2_relay).turn_on();
          delay(500);
          id(garage_door2_relay).turn_off();
          id(fingerprint_username).publish_state("Me");
        } else {
          id(fingerprint_username).publish_state("Unknown");
        };
1 Like

how to wiring esp32, fingerprint and doorlock or relay, in this tutorial only wiring fingerprint to esp32.thanks

I am also looking into making a fingerprint garage opener. But the best place to place it is (with cableing and stuf), next to the frond door. So i was thinking of making it my doorbell. When i press my doorbell it opens the garage and when the fingerprint is incorrect, my doorbell rings.

my biggest concern with this is the ā€œknock knock gingerā€ or ā€œknock down gingerā€ (dutch: belletje trekkers) Went someone is constantly pressing my doorbell i am afraid to have a false positive and that my garage door opens.

So my question is, Did you have any false positives? and do you get any knock knock gingers?
or is the doorbell idea not relay possible because of the latency of the sensor?

I have never had false positives or ā€œbelletje trekkersā€ :wink:
Good idea tho!

The delay shouldnā€™t be a problem, but you need to touch the sensor in the right way for a finger to register. It does not make a clicking sound so Iā€™m not sure if someone will understand if it worked or not. You could do something with the LED ofcourcr.

Hi @burg93. Love the idea. Wanted to try it but I get an error for enroll service as on the image below. Any idea how to fix it?

It clearly wants an integer for finger_id and does not accept what I feed it with instead
The helperā€™s name is correct.

Thanks in advance

I have no idea there Iā€™m afraid. As youā€™ve said thereā€™s nothing much to itā€¦ Just rechecked mine and no error shown in the script.


service: esphome.fingerprint_reader_enroll
data:
  num_scans: 2
  finger_id: "{{states('input_number.fingerprint_learning_id') | int}}"

Shouldnā€™t it be states().state?

Edit: nevermind. @HoGo I would check what value that jinja2 template gives in the Template thing in Developer tools.

Hi everyone
I configured my GROW R503 sensor with esphome:

uart:
  rx_pin: GPIO13
  tx_pin: GPIO14
  baud_rate: 57600

fingerprint_grow:
  sensing_pin: GPIO12
  on_finger_scan_matched:
    - text_sensor.template.publish:
        id: fingerprint_state
        state: "Impronta autorizzata"
    - delay: 3000ms
    - lambda: |-
        if (finger_id == 0) {
          id(fingerprint_username).publish_state("Fred");
        } else if (finger_id == 1) {
          id(fingerprint_username).publish_state("Gianni");
        } else {
          id(fingerprint_username).publish_state("Unknown");
        };
    - text_sensor.template.publish:
        id: fingerprint_state
        state: "Attesa"
    - fingerprint_grow.aura_led_control:
        state: BREATHING
        speed: 200
        color: BLUE
        count: 1
  on_finger_scan_unmatched:
    - text_sensor.template.publish:
        id: fingerprint_state
        state: "Impronta non autorizzata"
    - fingerprint_grow.aura_led_control:
        state: FLASHING
        speed: 25
        color: RED
        count: 2
  on_enrollment_scan:
    - text_sensor.template.publish:
        id: fingerprint_state
        state: "Impronta acquisita"
    - text_sensor.template.publish:
        id: fingerprint_state
        state: "Impronta acquisita"
    - 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
  on_enrollment_failed:
    - text_sensor.template.publish:
        id: fingerprint_state
        state: "Acquisizione impronta fallita"
    - fingerprint_grow.aura_led_control:
        state: FLASHING
        speed: 25
        color: RED
        count: 4

api:
  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: 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:

# Optional template text sensor for visual feedback
text_sensor:
  - platform: template
    id: fingerprint_state
    name: "Stato impronta"

  - platform: template
    id:       fingerprint_username
    name:     "Ultima scansione"
    update_interval: 30s

# Optional sensors
binary_sensor:
  - platform: fingerprint_grow
    id: fingerprint_enrolling
    name: "Acquisendo impronta"

sensor:
  - platform: fingerprint_grow
    fingerprint_count:
      name: "Conta impronte"
    last_finger_id:
      name: "Ultimo ID impronta"
    last_confidence:
      name: "AffidabilitĆ  ultima impronta"
    status:
      name: "Stato impronta"
    capacity:
      name: "CapacitĆ  impronta"
    security_level:
      name: "Livello di sicurezza"

i want pass to service call esphome.esphome_fingerprint_ingresso_enroll, finger_id the value of input_number_id_impronta for adding or delete a fingerprint using finger_id.

I write the value

image

this is lovelace card

show_name: true
show_icon: true
type: button
tap_action:
  action: call-service
  service: esphome.esphome_fingerprint_ingresso_enroll
  target: {}
  data:
    finger_id: '{{ states(''input_number.id_impronta'') }}'
    num_scans: 2
name: Registra Impronta
icon: mdi:fingerprint
icon_height: 50px

help pleaseā€¦
Thank you :slight_smile: