Git Product home page Git Product logo

esphome-wiegand-reader's Introduction

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.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.