Skip to content

gio-dot/Esphome-Wiegand-reader

Repository files navigation

Esphome-Wiegand-reader

I use Esphome to integrate many devices in my Homeassistant hub. Some time ago i was looking to an alternative to pn532-rc522 especially because they haven't a case. I discovered Wiegand readers: Wiegand is a specific protocol for this purpose (access control etc.) and there are a lot of cheap but very good readers on the market specifically made to be used even on the outside (IP68). Unfortunately there is no support for Wiegand in Esphome (there is an old support request on Github: esphome/feature-requests#211). I'm an electronic engineer and i'm not an expert software programmer, so i have not enough skills to create an esphome custom component. Combining an Arduino nano, that read Wiegand code from the reader (using one of many Arduino Wiegand libraries) with a Wemos D1 with Esphome, i was able to easily integrate Wiegand reader in Homeassistant. In Home assistant i create automations to unlock my entrance door (and even to disable alarm) when a known tag is read.

Arduino code: wiegand-esphome.ino.

This is the arduino library to use: https://github.com/monkeyboard/Wiegand-Protocol-Library-for-Arduino

Use this yaml code to create your ESPHome firmware: wemos_d1_wiegand_ingresso.yaml.

Remember to put this file in your esphome folder: UartReadLineStateComponent.h.

Resultant integration in Homeassistant:

Homeassistant basic configuration: home_assistant_wiegand.yaml

How it works

When tag is read, Arduino device sent it through serial to Esphome device (only TX is needed because communication is unidirectional). In Esphome i used uart text sensor component to read the code and send it to Homeassistant. In Home assistant i create binary sensors (one for each tag code that i'm using); then i use these binary sensors to fire various automations (door, alarm, external light, Wiegand reader led, Wiegand reader beep etc.)

Releases

No releases published

Packages

No packages published

Languages