Two Grow Fingerprint sensors

Hi guys,

I’m new in YAML. I want to use two Grow Fingerprint sensors on my ESP32.
Please, how can I declare two? If I try to do it like a list, it shows Error by the “on_finger_scan…”.

Thank you for every help/comment.

The id has to be unique for each instance. You can’t reuse id names.

You mean the row 21 - id: fingerprint_in and row 25 - id: fingerprint_out?
These are not same.

I see, you have the 2 id’s on the same sensing pin. Did you try different sensing pins for each reader?

Yes, I tried with GPIO32 now. But the error not about the sensing pin.
I’m new by YAML and I don’t know how to make two instance of the component.
Can I just make it as list with character ’ - ’ before the id?

It depends on how the integration was written. It may very well only support a single reader. You could file a feature request/bug report on github.

Ok, I made a request to update. fingerprint_grow multiple instances · Issue #1522 · esphome/feature-requests · GitHub
If somebody knows how to make two instances of the “fingerprint_grow” conponent, please let me know :wink:

Hi,

I tried to create two instances of the object without the events and it looks is working.
Just if I add the events, it says: fault. Looks like a bug in the component, or my fault by using YAML?

esphome:
  name: test_loader
  platform: ESP32
  board: esp32dev

uart:
  - id: uart_in
    tx_pin: GPIO17
    rx_pin: GPIO16
    baud_rate: 57600
  - id: uart_out
    tx_pin: GPIO23
    rx_pin: GPIO22
    baud_rate: 57600

fingerprint_grow:
  - id: fingerprint_in
    uart_id: uart_in
    sensing_pin: GPIO32
    
    
  - id: fingerprint_out
    uart_id: uart_out
    sensing_pin: GPIO12
   

Thank for help and some Idea

Oh I see what I think is the problem, all your automations were under the same entry. All actions for uart_in are under uart_out. Separate them to their respective entries.

Hi Mike,
I’m not understanding, what you mean with “Separate them to their respective entries.”
Can you write some example?

Thank you very much.


fingerprint_grow:
### this is the entry
  id: finger_in
  sensing_pin: GPIO12 ##use different pins for each sensor
  uart_id: uart_finger_in
###end of entry

###start of automations
  on_finger_scan_matched:
    - text_sensor.template.publish:
        id: fingerprint_state
        state: "Authorized finger"
    - switch.turn_on: gate
    - delay: 500ms
    - switch.turn_off: gate
  on_finger_scan_unmatched:
    - text_sensor.template.publish:
        id: fingerprint_state
        state: "Unauthorized finger"
### end of automations

### start second entry
  id: finger_out
  sensing_pin: ##use different pins for each sensor
  uart_id: uart_finger_out
###end of entry

###start of automations for second entry
  on_finger_scan_matched:
    - text_sensor.template.publish:
        id: fingerprint_state
        state: "Authorized finger"
    - switch.turn_on: gate
    - delay: 500ms
    - switch.turn_off: gate
  on_finger_scan_unmatched:
    - text_sensor.template.publish:
        id: fingerprint_state
        state: "Unauthorized finger"

Ok, it’s not working on first, but after small correction looks good. (valid by ESPHome)

fingerprint_grow:
  - id: fingerprint_in
    uart_id: uart_in
    sensing_pin: GPIO32
    on_finger_scan_matched:
      - switch.turn_on: relay_unlock
      - fingerprint_grow.aura_led_control:
          id: fingerprint_in
          state: BREATHING
          speed: 200
          color: BLUE
          count: 1
      - text_sensor.template.publish:
          id: fingerprint_out_state
          state: "Authorized finger"
      - switch.turn_on: relay_unlock
      - delay: 500ms
      - switch.turn_off: relay_unlock
    
    
  - id: fingerprint_out
    uart_id: uart_out
    sensing_pin: GPIO12
    on_finger_scan_matched:
      - switch.turn_on: relay_unlock
      - fingerprint_grow.aura_led_control:
          id: fingerprint_out
          state: BREATHING
          speed: 200
          color: BLUE
          count: 1
      - text_sensor.template.publish:
          id: fingerprint_out_state
          state: "Authorized finger"
      - delay: 500ms
      - switch.turn_off: relay_unlock

I thank you. You are great man.

3 Likes

Hello everyone

Thanks for the mentioned code. It helped me but I’ve got a little bit a different and longer yaml-code. When I tried to install this configuration. I’ve got the following warning:

 Too many candidates found for 'fingerprint_grow_id' type 'fingerprint_grow::FingerprintGrowComponent' Some are 'fingerprint_garage', 'fingerprint_tuer'.

In the editor, I can see that this error occurs by the binary sensor, sensor and the services in the api. Could anyone with yaml-experience help me out to separate them as well?

esphome:
  name: fingersensor
  friendly_name: Fingersensor

esp32:
  board: esp32-c3-devkitm-1
  framework:
    type: esp-idf

# Enable logging
logger:

ota:
  - platform: esphome
    password: "secret"

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

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

captive_portal:
    
uart:
  - id: uart_garage
    rx_pin: GPIO02
    tx_pin: GPIO03
    baud_rate: 57600
  - id: uart_tuer
    rx_pin: GPIO04
    tx_pin: GPIO05
    baud_rate: 57600

fingerprint_grow:
  - id: fingerprint_garage
    uart_id: uart_garage
    sensing_pin: GPIO01
    sensor_power_pin:
        number: GPIO00
        inverted: true
    idle_period_to_sleep: 5s
    on_finger_scan_matched:
      - homeassistant.event:
          event: esphome.test_node_finger_scan_matched
          data:
            finger_id: !lambda 'return finger_id;'
            confidence: !lambda 'return confidence;'
      - fingerprint_grow.aura_led_control:
          id: fingerprint_garage
          state: BREATHING
          speed: 200
          color: GREEN
          count: 1
      - text_sensor.template.publish:
          id: fingerprint_state_garage
          state: "Autorisiert"

    on_finger_scan_unmatched:
      - homeassistant.event:
          event: esphome.test_node_finger_scan_unmatched
      - fingerprint_grow.aura_led_control:
          id: fingerprint_garage
          state: FLASHING
          speed: 25
          color: RED
          count: 2
      - text_sensor.template.publish:
          id: fingerprint_state_garage
          state: "Unautorisiert"

    on_enrollment_scan:
      - homeassistant.event:
          event: esphome.test_node_enrollment_scan
          data:
            finger_id: !lambda 'return finger_id;'
            scan_num: !lambda 'return scan_num;'
      - fingerprint_grow.aura_led_control:
          id: fingerprint_garage
          state: FLASHING
          speed: 25
          color: BLUE
          count: 2
      - fingerprint_grow.aura_led_control:
          id: fingerprint_garage
          state: ALWAYS_ON
          speed: 0
          color: PURPLE
          count: 0
      - text_sensor.template.publish:
          id: fingerprint_state_garage
          state: "Anlernen"

    on_enrollment_done:
      - homeassistant.event:
          event: esphome.test_node_enrollment_done
          data:
            finger_id: !lambda 'return finger_id;'
      - fingerprint_grow.aura_led_control:
          id: fingerprint_garage
          state: BREATHING
          speed: 100
          color: BLUE
          count: 2
      - text_sensor.template.publish:
          id: fingerprint_state_garage
          state: "Registrieren"

    on_enrollment_failed:
      - homeassistant.event:
          event: esphome.test_node_enrollment_failed
          data:
            finger_id: !lambda 'return finger_id;'
      - fingerprint_grow.aura_led_control:
          id: fingerprint_garage
          state: FLASHING
          speed: 25
          color: RED
          count: 4
      - text_sensor.template.publish:
          id: fingerprint_state_garage
          state: "Fehler"

# Zweiter Sensor
  - id: fingerprint_tuer
    uart_id: uart_tuer
    sensing_pin: GPIO06
    sensor_power_pin:
        number: GPIO00
        inverted: true
    idle_period_to_sleep: 5s
    on_finger_scan_matched:
      - homeassistant.event:
          event: esphome.test_node_finger_scan_matched
          data:
            finger_id: !lambda 'return finger_id;'
            confidence: !lambda 'return confidence;'
      - fingerprint_grow.aura_led_control:
          id: fingerprint_tuer
          state: BREATHING
          speed: 200
          color: GREEN
          count: 1
      - text_sensor.template.publish:
          id: fingerprint_state_tuer
          state: "Autorisiert"

    on_finger_scan_unmatched:
      - homeassistant.event:
          event: esphome.test_node_finger_scan_unmatched
      - fingerprint_grow.aura_led_control:
          id: fingerprint_tuer
          state: FLASHING
          speed: 25
          color: RED
          count: 2
      - text_sensor.template.publish:
          id: fingerprint_state_tuer
          state: "Unautorisiert"

    on_enrollment_scan:
      - homeassistant.event:
          event: esphome.test_node_enrollment_scan
          data:
            finger_id: !lambda 'return finger_id;'
            scan_num: !lambda 'return scan_num;'
      - fingerprint_grow.aura_led_control:
          id: fingerprint_tuer
          state: FLASHING
          speed: 25
          color: BLUE
          count: 2
      - fingerprint_grow.aura_led_control:
          id: fingerprint_tuer
          state: ALWAYS_ON
          speed: 0
          color: PURPLE
          count: 0
      - text_sensor.template.publish:
          id: fingerprint_state_tuer
          state: "Anlernen"

    on_enrollment_done:
      - homeassistant.event:
          event: esphome.test_node_enrollment_done
          data:
            finger_id: !lambda 'return finger_id;'
      - fingerprint_grow.aura_led_control:
          id: fingerprint_tuer
          state: BREATHING
          speed: 100
          color: BLUE
          count: 2
      - text_sensor.template.publish:
          id: fingerprint_state_tuer
          state: "Registrieren"

    on_enrollment_failed:
      - homeassistant.event:
          event: esphome.test_node_enrollment_failed
          data:
            finger_id: !lambda 'return finger_id;'
      - fingerprint_grow.aura_led_control:
          id: fingerprint_tuer
          state: FLASHING
          speed: 25
          color: RED
          count: 4
      - text_sensor.template.publish:
          id: fingerprint_state_tuer
          state: "Fehler"

# Optional template text sensor for visual feedback
text_sensor:
  - platform: template
    id: fingerprint_state_garage
    name: "Fingerprint State Garage"
    lambda: |-
      return {"-"};
    update_interval: 6s
  - platform: template
    id: fingerprint_state_tuer
    name: "Fingerprint State Tür"
    lambda: |-
      return {"-"};
    update_interval: 6s

# Optional sensors
binary_sensor:
  - platform: fingerprint_grow
    id: fingerprint_enrolling
    name: "Fingerprint Enrolling"

sensor:
  - platform: fingerprint_grow
    fingerprint_count:
      name: "Abdruck Zähler"
    last_finger_id:
      name: "Letzte Abdruck ID"
    last_confidence:
      name: "Letzte Autorisation"
    status:
      name: "Abdruck Status"
    capacity:
      name: "Abdruck Menge"
    security_level:
      name: "Abdruck Sicherheitslevel"

api:
  encryption:
    key: "secret
  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: 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:

Short update.
I couldn’t figure out a solution with one ESP-Board. My shortcut was to buy a second one and have now to each sensor a separate board.
I just created a short video (in German) of how I did it.
Youtube Video