How to connect two specific pins with NodeMCU + NFC reader RC-522?

I am working on adding a NFC reader and used a NodeMCU coupled with a RC-522 reader. I followed the RC-522 and NodeMCU documentation, as well as a detailed description of the RC-522 pinout. The inspiration was the answer in a French community.
This is coupled with the following ESPHome configuration:

esphome:
  name: badge
esp8266:
  board: nodemcuv2
logger:
api:
  password: ""
ota:
  password: ""
wifi:
  ssid: "XXX"
  password: "XXX"
    ssid: "Badge Fallback Hotspot"
    password: "XXX"
  domain: .XXX
captive_portal:
mqtt:
  broker: 192.168.10.2
spi:
  clk_pin: D5
  mosi_pin: D2
  miso_pin: D1
rc522_spi:
  cs_pin: D6
  update_interval: 1s
  on_tag:
    then:
      - homeassistant.tag_scanned: !lambda "return x;"
      - mqtt.publish:
          topic: rc522/tag
          payload: !lambda "return x;"
switch:
  - platform: gpio
    name: "LedBleu2RFIDPF"
    pin: 2

This solution works great (connects to HA, sends the scanned tag to MQTT, the blue LED is driven), except for one point: how should I use and configure the following pins of the RC-522:

  • pin 2 (RST), I guess that the NodeMCU will send a reset signal on its own, where should pin2 of the badge reader connected to the NodeMCU?
  • pin 4 (IRQ), apparently the badge reader (?) can go in deep sleep and the NodeMCU wakes it up (or maybe this is the other way round). What si the expected connection?

As a side/minor problem, with the configuration above, the blue LED starts on and is seen as off by HA. Switching it “on” in HA switches it off on the NodeMCU. The reality is flipped with how HA sees that LED.

tells us :point_down:

  • reset_pin (Optional, Pin Schema): The pin connected to the RST line. Some tests shows the RC522 working okay without this.

…so simply not needed

just set inverted to true that it is in sync with ha :bulb:

And @adonno’s tagreader github got you covered with a good amount of documentation :point_down: