Esp8266 Rc522

Tested ESP8266 with RC522 NFC/RFID Reader

RC522 is NFC/RFID reader, and it can be integrated into ESPHOME

  • esphome configuration
    # Example configuration entry
    spi:
      clk_pin: 14
      mosi_pin: 13
      miso_pin: 12
    
    rc522_spi:
      cs_pin: 15 # D8
      # reset_pin: 16
    
    binary_sensor:
      - platform: rc522
        uid: !secret my_room_card
        name: "My Room Card"
    

Home automation

  • Security on
    alias: my-room-card-tagged-securityon
    description: ""
    trigger:
      - platform: state
        entity_id:
          - binary_sensor.my_room_card
        from: "off"
        to: "on"
    condition:
      - condition: state
        entity_id: automation.body_detected
        state: "off"
    action:
      - service: automation.turn_on
        target:
          entity_id:
            - automation.body_detected
        data: {}
      - service: tts.google_translate_say
        data:
          cache: false
          entity_id: media_player.living_room_speaker
          message: Turned on security
    mode: single
    
  • Security off
    alias: my-room-card-tagged-securityoff
    description: ""
    trigger:
      - platform: state
        entity_id:
          - binary_sensor.my_room_card
        from: "off"
        to: "on"
    condition:
      - condition: state
        entity_id: automation.body_detected
        state: "on"
    action:
      - service: automation.turn_off
        target:
          entity_id:
            - automation.body_detected
        data:
          stop_actions: true
      - service: tts.google_translate_say
        data:
          cache: false
          entity_id: media_player.living_room_speaker
          message: Turned off security
    mode: single
    

Look

D1 Mini Pro and RC522 Sensor

Reference