Closed carlos-leopoly closed 2 weeks ago
Hi!
Thanks for the suggestion, however, this is beyond scope given the context of ESPHome as this is already achievable through ESPHome’s own pn532 component and the same pn532 components present here are from the ESPHome repo just with some small changes to fit the homekey.
That being said, I don’t see a reason to integrate those things like that other than to just mangle them but I would be glad to be proved wrong.
Afaik the modified components should still work about the same but there could be bugs introduced by the patches, let me know if that is the case.
Hi rednblkx, Thanks for paying attention to my request. I'm quite new to ESPHome so probably that's why I have not considered your suggestion to simply use the pn532 component in a standalone way. I would like to combine your project with the tagreader project of adonno. So probably I'll just copy the config entries from that project.
So you should be right, that's out of the scope of your project. Thank you anyway and thank you for your current project as well!
Alright, great! Let me know if you have any issues.
Hi, first of all thank you for your work! This project is great, especially the way I can now use Homekey for my automations.
I had the same idea and wanted to use the ESPHome pn532 binary_sensor for normal NFC Tags.
The ESPHome code looks like:
binary_sensor:
- platform: pn532
uid: 12-34-56-78
name: "PN532 NFC Tag"
When compiling it fails with the error:
binary_sensor.pn532: [source /config/homekey.yaml:82]
Platform not found: 'binary_sensor.pn532'.
In a separate device without the HAP-ESPHome component it works fine. I am not a programmer, so this is the only input I can provide for now.
Best regards
Hi @ss83,
This approach does work for me:
spi:
clk_pin: 18
miso_pin: 19
mosi_pin: 23
pn532_spi:
id: pn532_board
cs_pin: 5
update_interval: 100ms
on_tag:
- if:
condition:
lambda: 'return ( id(source)=="uid" );'
then:
- homeassistant.tag_scanned: !lambda |-
ESP_LOGD("tagreader", "No HA NDEF, using UID");
return x;
else:
- if:
condition:
lambda: 'return ( id(source)=="hass" );'
then:
- homeassistant.tag_scanned: !lambda 'return id(info);'
else:
- homeassistant.event:
event: esphome.music_tag
data:
reader: !lambda |-
return App.get_name().c_str();
source: !lambda |-
return id(source);
url: !lambda |-
return id(url);
info: !lambda |-
return id(info);
all got from project tagreader project of adonno.
Could you expose to lambda the data of a traditional tags as well? Like Endpoint ID and Issuer ID. It would be nice to also read/authenticate with tradtional NFC cards.
I could use to some additional attributes like:
Thanks!