It’s a very long automation, but the gist of it is that I have a variable that is mapping finger ids to person entity ids. I then have a choose
section based on whether that person is home.
Ah I get it now, you’re correct.
Though not a noob, this code makes me feel like I am one!
I read through the code and compared it to the one for the sensor on the esphome web page and feel I understand what is happening.
I loaded the code and got errors when I went to validate. I was able to fix most of them but a few are still popping up. Maybe some one can tell me what I am doing wrong.
This is the code I put in
fingerprint_grow:
sensing_pin: D2
on_finger_scan_matched:
- switch.turn_on: trigger_relay
- fingerprint_grow.aura_led_control:
state: BREATHING
speed: 200
color: BLUE
count: 1
- text_sensor.template.publish:
id: fingerprint_state
state: "Authorized finger"
I get an error of
Unable to find action with the name 'switch.turn_on'. switch.turn_on: trigger_relay
The second code section with errors is
services:
- service: enroll
variables:
finger_id: int
num_scans: int
The error is
Component not found: services.
I sort of understand what is going on but do not know how to solve.
Thanks for any help you can provide.
For the first error, if you control the garage using the same ESP, for example using a relay, you can fill in the id of the relay to open the garage/door etc. If you control it using another device you can remove the action and create an automation in HA.
The second error, services:
should go under api:
Sensor works and automation as well, but there is one think I can’t solve.
The automation is set on trigger “last fingerprint ID 6” and if I scan the next time the same finger (ID6) the automation won’t trigger beacuse there is alreadly last fingerprint ID 6 in state of sensor. If I want to trigger automation I have to scan any other finger (successfully) and then again finger ID6. Is there any other solution possible - apart from changing dedicated finger ID for lock and other for unlock?
After any scan add the last 4 lines starting from delay. This will clear the last scan
on_finger_scan_unmatched:
- fingerprint_grow.aura_led_control:
state: FLASHING
speed: 20
color: RED
count: 3
- text_sensor.template.publish:
id: fingerprint_state
state: "Unauthorized finger"
- delay: 3s
- text_sensor.template.publish:
id: fingerprint_state
state: "Scan your finger"
Thank you very very much! It works now!!!
Thank you for the response. I got the second error fixed, but I am still confused about the first error.
I use a sonoff basic to control the garage door it uses an entity_id called cover.garage_door.
Is that what I need in the id field?
Thanks
No, in that case you can remove that line of code. Instead you should create an automation in HA itself, that toggles cover.garage_door when one of the fingerprint sensors changes state.
Great, got the bin file uploaded and all seems well.
My next problem is how to do the following…
When that’s done, you can enroll your fingerprint in the sensor by calling the service esphome.X_enroll where X is the device name, with the parameters finger_id and num_scans.
Where/how do I do this.
Again thank you for being patient.
In developer tools under the services tab enter esphome.(your.nodes.name)_enroll
then in data
add
{ "finger_id": 0, "num_scans": 2 }
Where finger_id
is the slot it’s saved in.
Then call the service. Its helpful to go split screen to lovelace to see what the sensor is doing.
Thank you worked perfectly.
I did not think to look in services at esphome.(your.nodes.name)_enroll.
I was looking for the sensor itself.
Appreciated very much
Ever the troublesome frog, I’m trying to do this with a Wemos D1 mini (clone) and an AS608 optical fingerprint reader from DIYmall through Amazon.com.
Wire/signal descriptions from DIYmall are:
Communication Interface: USB /UART
Baud rate: 57600(default)
Storage capacity: 300
Interface:
Red Wire: VCC (Power 3.3V, can't connect 5V, it will be burned)
Yellow Wire: TXD (Connect RXD of the AVR or TTL converter board)
White Wire: RXD (Connect TXD of the AVR or TTL converter board)
Black Wire: GND
Yaml is shown here:
esphome:
name: fingerprint-reader
platform: ESP8266
board: d1_mini
# Enable logging
logger:
baud_rate: 0
level: DEBUG
# Enable Home Assistant API
api:
password: "password"
# Enable over-the-air updates
ota:
password: "password"
wifi:
fast_connect: false
power_save_mode: NONE
domain: .local
use_address: fingerprint_reader.local
reboot_timeout: 5min
networks:
ssid: "NoNoNo"
password: "topsecretpw"
uart:
baud_rate: 57600
rx_pin: D1
tx_pin: D2
# Declare Grow Fingerprint Reader
fingerprint_grow:
new_password: 0x12345678
sensing_pin: D0
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"
on_enrollment_scan:
- text_sensor.template.publish:
id: fingerprint_state
state: "Finger scanned"
on_enrollment_done:
- text_sensor.template.publish:
id: fingerprint_state
state: "Enrolled fingerprint"
on_enrollment_failed:
- text_sensor.template.publish:
id: fingerprint_state
state: "Failed to enroll fingerprint"
#
# Optional template text sensor for visual feedback
#
text_sensor:
- platform: template
id: fingerprint_state
name: "Fingerprint State"
#
# Optional component (GPIO switch, lock etc.) to control in on_finger_scan_matched trigger
#
switch:
- platform: gpio
pin: GPIO14
id: gate
#
# Optional sensors
#
binary_sensor:
- platform: fingerprint_grow
id: fingerprint_enrolling
name: "Fingerprint Enrolling"
sensor:
- platform: fingerprint_grow
fingerprint_count:
name: "Fingerprint Count"
last_finger_id:
name: "Fingerprint Last Finger ID"
last_confidence:
name: "Fingerprint Last Confidence"
status:
name: "Fingerprint Status"
capacity:
name: "Fingerprint Capacity"
security_level:
name: "Fingerprint Security Level"
Despite many attempts, it fails to initialize the sensor properly.
Log files showing the connection failure are here:
Showing logs:
[20:23:22][I][app:029]: Running through setup()...
[20:23:22][C][uart_esp8266:046]: Setting up UART bus...
[20:23:22][C][switch.gpio:011]: Setting up GPIO Switch 'gate'...
[20:23:22][D][switch:025]: 'gate' Turning OFF.
[20:23:22][D][switch:045]: 'gate': Sending state OFF
[20:23:22][D][switch:025]: 'gate' Turning OFF.
[20:23:22][C][fingerprint_grow:052]: Setting up Grow Fingerprint Reader...
[20:23:22][D][fingerprint_grow:190]: Checking password
[20:23:23][E][fingerprint_grow:418]: No response received from reader
[20:23:23][E][component:094]: Component was marked as failed.
[20:23:23][C][wifi:037]: Setting up WiFi...
[20:23:23][D][wifi:365]: Starting scan...
Change new_password
to password
, recomplile and upload.
I tried several variations of password
, including leaving out password
(for the default initial value of 0x00) or explicitly saying password: 0x00
. I wanted to be extra careful not to set any password until I had things operational. None of them seemed to work. I suspect the password check requirements for this sensor may be different, somehow?
That’s beginning to be my thought. I have the R503 coming from AliExpress in a few weeks, just wanted to try this similar model in the interim, to get code and wiring figured out. Will review that list later this morning. I tried checking the chip on this reader, but even with a magnifying glass the etching was far too small to read.
Yup, got that. Thank you. The device never initialized at all, nor made it to any of the password set/validation code. I was looking at the source code on Github this morning, precisely to see what I should expect if it validates/initializes correctly.
Passwords are optional. If you believe you’ve never set one, just leave out password
all together and see if it will initialize.