Demo: Using two RDM6300 RFID readers on one ESP32

Hi folks. I’d like to share this in the hope that it helps someone.
I found bits and pieces online in this forum, the ESPHome Discord and even the GitHub PR where multiple device support for RDM6300 devices was added, but no complete examples. Here is mine.

I am still very new to ESPHome, so if you spot anything I can improve, please reply to let me know how. If it helps you, that’s great.

1 x ESP32
2 x RDM6300 RFID readers - one on pin 16, one on pin 17

ESPHome code - the relevant parts:

# Define two UARTs with different IDs
uart:
  - id: uart_1
    rx_pin: 16
    baud_rate: 9600
  - id: uart_2
    rx_pin: 17
    baud_rate: 9600

rdm6300:
  # Refer to UART IDs in list items
  - id: reader_1
    uart_id: uart_1
    on_tag:
      then:
        - text_sensor.template.publish:
            id: last_tag_id_1
            state: !lambda 'return to_string(x);'  
        - binary_sensor.template.publish:
            id: "tag_scanned_1"
            state: On
        - delay: 100ms  
        - binary_sensor.template.publish:
            id: "tag_scanned_1"
            state: Off

  # Here is the second reader (uses RX pin 17)
  - id: reader_2
    uart_id: uart_2
    on_tag:
      then:
        - text_sensor.template.publish:
            id: last_tag_id_2
            state: !lambda 'return to_string(x);'  
        - binary_sensor.template.publish:
            id: "tag_scanned_2"
            state: On
        - delay: 100ms  
        - binary_sensor.template.publish:
            id: "tag_scanned_2"
            state: Off

# Define two text and two binary sensors so you have one for each reader
text_sensor:
  - platform: template
    name: Last Tag ID 1
    id: last_tag_id_1
  - platform: template
    name: Last Tag ID 2
    id: last_tag_id_2

binary_sensor:
  - platform: template
    name: "Tag Scanned 1"
    id: "tag_scanned_1"
    filters:
      - delayed_off: 1000ms
    on_press:
      then:
        homeassistant.tag_scanned: !lambda 'return id(last_tag_id_1).state;'
  - platform: template
    name: "Tag Scanned 2"
    id: "tag_scanned_2"
    filters:
      - delayed_off: 1000ms
    on_press:
      then:
        homeassistant.tag_scanned: !lambda 'return id(last_tag_id_2).state;'

For the Home Assistant and delay on/off, thanks to RDM6300 - delay between actions - #8 by miholobolo :clap:
Screenshot of sensors in Home Assistant dashboard

1 Like