I have a Wiegand reader connected to EspHome. I’m trying to figure how to read if a RFID card is allowed in a MySQL table. What I want to achieve is to scan the RFID and execute some sort of procedure that performs a SELECT i n a MySQL table to check if the card is allowed or not.
Does anyone know how to do this?
P.S.: This forum is AWESOME, I always get the response before even creating a topic, in 3 years this is my second topic. You rock!
Don’t know how you would do it to check the MySQL but if you in ESPHome can trigger tag_scanned with the scanned ID you can handle it inside home assistant.
Maybe this can point you in the correct direction?
# In some trigger
on_...:
# Simple
- homeassistant.tag_scanned: some-tag
Yes, it’s correct. EspHome would send the tag to HomeAssistant ant there I would like to perform a query to see if the tag is present in the DB. I can write an REST API for the DB search, but the main problem is how to perform the search (or REST call and get the response).
Ok, so the link I provided earlier is to be used in ESPHome to get the tag over to Home assistant.
Then at home assistant you can add the tags under Settings → tags, then you can add automations when tags are sent into home assistant.
What you will need for REST calls is to use the { REST } integration in home assistant.