Skip to content

[st25r] Add ST25R3916 NFC reader documentation#6428

Draft
JohnMcLear wants to merge 1 commit intoesphome:currentfrom
JohnMcLear:st25r-docs-pr1
Draft

[st25r] Add ST25R3916 NFC reader documentation#6428
JohnMcLear wants to merge 1 commit intoesphome:currentfrom
JohnMcLear:st25r-docs-pr1

Conversation

@JohnMcLear
Copy link
Copy Markdown

Summary

  • Add documentation for the new ST25R3916 NFC reader component
  • SPI interface, ISO 14443A (NFC-A) tag detection with multi-tag anticollision
  • Component index entry added under NFC/RFID section

Matches component PR: esphome/esphome#15608

Test plan

  • Docs build and render correctly
  • All links resolve
  • Code examples match actual component schema

🤖 Generated with Claude Code

Documentation for the new ST25R3916 NFC reader component (SPI, ISO14443A).
Matches esphome/esphome#15608.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ImgTable blocks are not in alphabetical order

Found 1 ImgTable block(s) with incorrect ordering below Network Protocols.
Each table has at most one Core item (matching the section name, e.g. "Sensor Core" for the Sensor section), pinned first, followed by Template items (names starting with "Template "), then all remaining items sorted alphabetically.

You can fix this automatically by running:

node script/check_component_index.mjs --fix

The unsorted blocks are outside this PR's diff. Try merging the latest base branch first, or run the fix command above.

Copy link
Copy Markdown

@esphome esphome bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this is a feature matched with a PR in https://github.com/esphome/esphome, please target your PR to the next branch and rebase.

@esphome
Copy link
Copy Markdown

esphome bot commented Apr 9, 2026

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@esphome esphome bot marked this pull request as draft April 9, 2026 19:56
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 9, 2026

Deploy Preview for esphome ready!

Name Link
🔨 Latest commit edaf51c
🔍 Latest deploy log https://app.netlify.com/projects/esphome/deploys/69d80471e7608e0008478314
😎 Deploy Preview https://deploy-preview-6428--esphome.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 9, 2026

Walkthrough

Added documentation for the ESPHome ST25R NFC reader component, a global hub supporting ISO 14443A detection via SPI interface. Includes configuration examples, variable definitions, tag detection automations, and hardware compatibility guidance. Updated the components index to reference the new documentation page.

Changes

Cohort / File(s) Summary
ST25R Documentation
src/content/docs/components/binary_sensor/st25r.mdx, src/content/docs/components/index.mdx
New documentation page for ST25R NFC reader component with full configuration examples, variable descriptions, trigger sections, and hardware references. Updated components index table with ST25R entry under NFC/RFID section.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Suggested labels

has-parent, current

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding documentation for the ST25R3916 NFC reader component, which matches the changeset.
Description check ✅ Passed The description is directly related to the changeset, clearly explaining the addition of ST25R3916 NFC reader documentation, SPI configuration, and index entry.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/content/docs/components/binary_sensor/st25r.mdx`:
- Around line 99-104: The doc currently tells users to set the logger to DEBUG
but shows an example log with an INFO level; update the doc so the levels match
by either changing the instruction from "DEBUG" to "INFO" or changing the sample
log prefix from "[st25r:INFO]" to "[st25r:DEBUG]"; ensure the text around the
"Tag selected: 0410A7675F6180 (SAK=0x00)" sample and the instruction mentioning
logger level use the same level term so users know what to expect.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: dbe43103-03e0-45c4-8ee4-2f65b39053f4

📥 Commits

Reviewing files that changed from the base of the PR and between 1b005da and edaf51c.

📒 Files selected for processing (2)
  • src/content/docs/components/binary_sensor/st25r.mdx
  • src/content/docs/components/index.mdx

Comment on lines +99 to +104
To find your tags' UIDs, set up the component with the logger at DEBUG level. When you hold a tag
near the reader, you will see a log message like:

```log
[st25r:INFO] Tag selected: 0410A7675F6180 (SAK=0x00)
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Logger level guidance conflicts with the sample output

Line 99 asks for DEBUG, but the sample shown is an INFO log. Please align the instruction and sample level so users know what to expect.

Suggested doc tweak
-To find your tags' UIDs, set up the component with the logger at DEBUG level. When you hold a tag
+To find your tags' UIDs, set up the component with the logger at INFO level (or lower). When you hold a tag
 near the reader, you will see a log message like:
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/content/docs/components/binary_sensor/st25r.mdx` around lines 99 - 104,
The doc currently tells users to set the logger to DEBUG but shows an example
log with an INFO level; update the doc so the levels match by either changing
the instruction from "DEBUG" to "INFO" or changing the sample log prefix from
"[st25r:INFO]" to "[st25r:DEBUG]"; ensure the text around the "Tag selected:
0410A7675F6180 (SAK=0x00)" sample and the instruction mentioning logger level
use the same level term so users know what to expect.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds documentation for the new ST25R3916-based NFC reader so users can configure it in ESPHome and discover tags, plus exposes it in the component index under the NFC/RFID category.

Changes:

  • Added a new documentation page for the ST25R NFC reader (SPI setup, configuration options, and tag triggers).
  • Added ST25R to the NFC/RFID list in the components index.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
src/content/docs/components/index.mdx Adds the ST25R entry to the NFC/RFID ImgTable for discoverability.
src/content/docs/components/binary_sensor/st25r.mdx New ST25R NFC reader documentation including example config and triggers.

Comment on lines +12 to +16
The `st25r` component allows you to use STMicroelectronics ST25R3916 family NFC readers
([datasheet](https://www.st.com/resource/en/datasheet/st25r3916.pdf))
with ESPHome. This component is a global hub that establishes the connection to the ST25R3916 via
[SPI](/components/spi) and detects ISO 14443A (NFC-A) tags with multi-tag anticollision support
for 4-byte, 7-byte, and 10-byte UIDs.
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The intro describes this as the st25r component, but the configuration examples use st25r_spi:. To avoid confusing users, please align the wording and examples (similar to PN532/RC522 docs, which explicitly describe the *_spi hub component name used in YAML).

Suggested change
The `st25r` component allows you to use STMicroelectronics ST25R3916 family NFC readers
([datasheet](https://www.st.com/resource/en/datasheet/st25r3916.pdf))
with ESPHome. This component is a global hub that establishes the connection to the ST25R3916 via
[SPI](/components/spi) and detects ISO 14443A (NFC-A) tags with multi-tag anticollision support
for 4-byte, 7-byte, and 10-byte UIDs.
The `st25r_spi` component allows you to use STMicroelectronics ST25R3916 family NFC readers
([datasheet](https://www.st.com/resource/en/datasheet/st25r3916.pdf))
with ESPHome. This SPI hub component is configured in YAML under `st25r_spi:` and establishes the
connection to the ST25R3916 via [SPI](/components/spi). It detects ISO 14443A (NFC-A) tags with
multi-tag anticollision support for 4-byte, 7-byte, and 10-byte UIDs.

Copilot uses AI. Check for mistakes.
Comment on lines +22 to +28
clk_pin: GPIO19
miso_pin: GPIO10
mosi_pin: GPIO18

st25r_spi:
cs_pin: GPIO6
irq_pin: GPIO7
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SPI example uses ESP32 flash/PSRAM pins (e.g., GPIO10 for MISO). These pins are not generally usable on common ESP32 dev boards and can cause boot failures; consider using GPIOXX placeholders or example pins that are safe/commonly available.

Suggested change
clk_pin: GPIO19
miso_pin: GPIO10
mosi_pin: GPIO18
st25r_spi:
cs_pin: GPIO6
irq_pin: GPIO7
clk_pin: GPIO18
miso_pin: GPIO19
mosi_pin: GPIO23
st25r_spi:
cs_pin: GPIO5
irq_pin: GPIO4

Copilot uses AI. Check for mistakes.
Comment on lines +27 to +28
cs_pin: GPIO6
irq_pin: GPIO7
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example uses GPIO6/GPIO7 for cs_pin/irq_pin, which are typically reserved for SPI flash on many ESP32 boards. Consider switching to GPIOXX placeholders or known-safe pins to prevent users copy/pasting a non-working configuration.

Suggested change
cs_pin: GPIO6
irq_pin: GPIO7
cs_pin: GPIOXX
irq_pin: GPIOYY

Copilot uses AI. Check for mistakes.
- **reset_pin** (*Optional*, [Pin Schema](/guides/configuration-types#pin-schema)): Hardware reset GPIO pin.
Optional but recommended for reliable recovery.

- **rf_power** (*Optional*, int): TX driver strength 0--15 (15 = maximum range). Defaults to `15`.
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rf_power range is written as 0--15, which reads like a typo. Consider changing to 0-15 (or 0..15) to avoid confusion.

Suggested change
- **rf_power** (*Optional*, int): TX driver strength 0--15 (15 = maximum range). Defaults to `15`.
- **rf_power** (*Optional*, int): TX driver strength 0-15 (15 = maximum range). Defaults to `15`.

Copilot uses AI. Check for mistakes.
Comment on lines +99 to +104
To find your tags' UIDs, set up the component with the logger at DEBUG level. When you hold a tag
near the reader, you will see a log message like:

```log
[st25r:INFO] Tag selected: 0410A7675F6180 (SAK=0x00)
```
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section says to set the logger to DEBUG to find UIDs, but the example log line shown is at INFO level ([st25r:INFO] ...). Please reconcile these (either adjust the recommended logger level or update the example) so readers know which level is actually required.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants