🚘 Garage Fingerprint Sensor

Does your D1 mini show the D-numbers? If so use these pins. Check if you wired them correctly, sometimes people flip the TX and RX pins. TX of the sensor should be connected to the defined RX on the board.

1 Like

Thanks again @nickrout for the reference; looks like in some situations if aliases are defined then they can be used in place of the GPIO numbers.

@Parrel yes my board has the D-numbers on the board. Maybe I am still not fully understanding … should I be connecting to the D0, D1, D2 in your original post? Or should I be connecting to what the pinout diagram says they are?

For example, Yellow (TX) from Scanner is going to D0 (which is GPIO16) and is not going to the RX (which is GPIO3). The pinout being from the photo in the original post.

I’m going to take a second to point out that manufactures can arrange boards anyway they see fit. They don’t conform to a standard. You should try to get the pinout from the board manufacturer whenever possible.

Both of these schematics are for an esp32 wroom. Notice the location of the power and ground pins. This one works for my board not the second.

If I use this pinout my board will not boot

This is how you should connect the sensor then. And change nothing in the ESPHome code.

If it does not work, post your ESPHome logs here.

Edit:

Like shown above, yellow should connect to D1 not D0.

oops, goofed on the D numbers, everything seems to be up and running now that I have the headers properly soldered and connected to the right positions, but still a bit confused by the pinouts. Will have to look into this some more to understand how this all works. Now just need to figure out all the enrolling/configuring.

Thanks!

It’s okay! The TX and RX pins on the board are for flashing the actual ESP, and they did not work when I tried to use them.

Good to hear everything is working. For enrolling, you can call the service from Home Assistant. For testing, call it from developer tools.

And thanks to @FredTheFrog @nickrout @Mikefila for helping as well :slight_smile:

1 Like

In all of this … the enrolling was the easiest part! Enrolled a bunch of fingerprints without issues.

Thanks everyone for all the help!

1 Like
alias: Fingerprint Opens Garage Door
description: ''
trigger:
  - platform: state
    to: Authorized finger
    from: Scan your finger
    entity_id: sensor.garage_fingerprint_state
condition: []
action:
  - device_id: # my garage door device ID 
    domain: cover
    entity_id: # my garage door entity ID
    type: open
mode: single

I mad this automation to open my garage door.
I want to specify which finger_id to respond to .
when I use “sensor.garage_fingerprint_last_finger_id” instead of “sensor.garage_fingerprint_state” it works once then when I scan the same finger it won’t work since there is no change in the last finger_id

As you suggested I added the 4 lines mentioned above with delay and Ready to scan message.
Thanks, great stuff.

I was just thinking about your idea … is it possible to enroll fingerprints without going in order starting from 0?

Let’s say if person A enrolls all 10 fingers starting from id 10 to 19, person B enrolls 10 fingers from 20 to 29, etc.

Then in your text sensor you can check to see if the id scanned is within the 10s, 20s, 30s, etc. Each tens would be associated with a person.

I believe the driver is issuing id number values in sequential fashion. I agree, fives or tens would be nice, but alas, this is new code, and it’s not that mature just yet.

When enrolling a fingerprint you specify the finger_id It doesn’t need to be sequential.

Another very useful service definition to add (if you use a single relay in a momentary switch fashion):

  - service: tap
    then:
      - switch.turn_on:  garage_door_relay
      - delay:           300ms
      - switch.turn_off: garage_door_relay

This service can then be called from Home Assistant cover or automation items.

ESPHome.garagescan_tap

Thanks, I tried the idea and it works just the way it was expected with the following under sensors:

  - platform: template
    sensors:
      fingerprint_last_finger_name:
        value_template: >-
          {% set person = (states('sensor.fingerprint_last_finger_id') | int / 10) | round(0) %}

          {% if person == 1 %}
            {{ state_attr('person.him','friendly_name') }}
          {% elif person == 2 %}
            {{ state_attr('person.her','friendly_name') }}
          {% elif person == 3 %}
            You scanned your toes?
          {% else %}
            Unknown
          {% endif %} 
 
4 Likes

LOL very good

Hi,
I have a problem with the configuration of this sensor on the wemos d1 pro board. I changed the configuration of the board, even pins to GPIO but it still does not work. To check if it works I connected the sensor to the wemos d1 mini and everything works fine. Any ideas?

Thanks!

Edit: It’s just stupid but I’ve changed from d1_mini_pro to that:

  platform: ESP8266
  board: esp01_1m

…and it works!

Edit: fully prepared for din rail mount, tested with 10m UTP, 12V DC, also integrated with relay for lock control.

1 Like

@_piter I bought some supposed d1 mini pros which had the external antenna connector but only 4MB of flash. Once I used board: d1_mini instead of board: d1_mini_pro it worked fine.

Hi @parrel . This is my first post here so hopefully I follow the rules. I just got around to connecting my Grow 503 to a d1 mini pro on the same ports you used.
I copied over your config in ESPhome in home assistant and added these few lines at the beginning :

esphome:
  name: fingerprint_grow
  platform: ESP8266
  board: d1_mini

# Enable logging
logger:

ota:
  password: "**************************"

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Garage-Fingerprint"
    password: "************"

The upload of the code went fine, the sensor shows online in ESPHome.
When I check the logs while holding my finger on the scanner, it shows me that the fingerprint is not recognized. So that seems to confirm that the system as such is working.

However, in Home assistant, when going to the developers tools, Services tab, I can’t find any of those newly created services to enroll my fingerprints. It’s like they were never created but I cant find any reason why this is not working as expected ?

thanks for helping out !
Tom

Hi Tom! You forgot these lines under api: :slight_smile:


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:

Hi @parrel,

Thank you for your swift feedback ! I appreciate it very much. but I actually don’t think I forgot code after the API, but I might have confused you by not giving the entire code, so please find below the entire code I uploaded to the Wemos :

esphome:
  name: fingerprint_grow
  platform: ESP8266
  board: d1_mini

# Enable logging
logger:

ota:
  password: "**************************"

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Garage-Fingerprint"
    password: "************"

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"
    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"

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:

I also removed that empty line after API, but again, the result seems to be the same.

Hopefully you can spot what’s wrong here ?

Thanks already in advance !
Tom

Hmm that’s strange. Are you sure you added the device to home assistant in the integrations tab? Can you see the defined sensors in home assistant?