『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
查看: 971|回复: 2

[硬件DIY] 跟大神学习指纹解锁电脑

[复制链接]

1

主题

15

帖子

660

积分

高级会员

Rank: 4

积分
660
金钱
645
HASS币
0
发表于 2023-3-5 21:02:14 | 显示全部楼层 |阅读模式
原帖https://bbs.hassbian.com/thread-15904-1-1.html
主要是我太笨了,没有弄成,所以用esphome搞了。
用ch9329模块,CFGO加跳帽,发送数据用ASCII码,用十六进制   比如0x0D是回车键
switch:
  - platform: uart
    id: switch1
    uart_id: uart_2
    name: "UART"
    data: [0x78,0x32]
  - platform: uart
    id: switch2
    uart_id: uart_2
    name: "UART"
    data: [0x0D] 
    
uart:
 - id: uart_1
   rx_pin: GPIO3
   tx_pin: GPIO1
   baud_rate: 9600
 - id: uart_2
   tx_pin: GPIO2
   baud_rate: 9600
 

# Declare Grow Fingerprint Reader

 
fingerprint_grow:
  uart_id: uart_1
  sensing_pin: GPIO5
  on_finger_scan_matched:
    - text_sensor.template.publish:
        id: fingerprint_state
        state: "Authorized finger"
    - switch.turn_on: switch2
    - delay: 2s
    - switch.turn_on: switch1
  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"

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"
#hass服务调用,用于注册新指纹。
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:
回复

使用道具 举报

4

主题

15

帖子

125

积分

注册会员

Rank: 2

积分
125
金钱
110
HASS币
10
发表于 2023-3-20 17:27:45 | 显示全部楼层
用 hass 主机可以试试下面的插件
https://bbs.hassbian.com/thread-17479-1-1.html
回复

使用道具 举报

0

主题

1

帖子

16

积分

新手上路

Rank: 1

积分
16
金钱
15
HASS币
0
发表于 2023-9-22 10:40:43 | 显示全部楼层
顶顶顶,大佬优秀,虽然不懂,
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-11-26 18:28 , Processed in 0.057988 second(s), 25 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表