Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop usage of custom component #7

Merged
merged 3 commits into from
Sep 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ To build your own tag reader, you need the following components:
The 3D models for the case are [here](https://github.com/adonno/tagreader/tree/master/STLs).

### Connecting the components

![Photo of schematics](https://github.com/adonno/tagreader/blob/master/Schematics/tag_reader_schematics_v1.png)

There are not too many components to connect, but it does require soldering. You will need the following:
Expand All @@ -32,15 +33,15 @@ To flash the reader firmware to your D1 Mini you point ESPHome at [tagreader.yam

## Configuring for use with Home Assistant

If the tag reader is unable to connect to a wifi network, it will start a WiFi access point with a captive portal to allow you to enter your WiFi credentials.
The tag reader requires [Home Assistant](https://www.home-assistant.io) 0.115 or later.

The tag reader will be automatically found by Home Assistant once the tag reader is connected to the same network. You can follow the instructions in the UI to set it up.
If the tag reader is unable to connect to a wifi network, it will start a WiFi access point with a captive portal to allow you to enter your WiFi credentials.

A custom component is required for Home Assistant at this time to link the tag reader to the tag integration in Home Assistant. Copy [this file](https://raw.githubusercontent.com/adonno/tagreader/master/custom_components/esphome_tag.py) to `<config>/custom_components/esphome_tag.py` and add `esphome_tag:` to your `configuration.yaml` file.
The tag reader will be automatically discovered by Home Assistant once the tag reader is connected to the same network. You can follow the instructions in the UI to set it up.

## Usage

Each tag that is scanned will result in a `tag_scanned` event in Home Assistant. You can manage your tags and automate them in the Home Assistant UI under config -> tags.
Scanned tags can be managed from the tags interface in Home Assistant. You can find it under config -> tags.

![Screenshot of the Home Assistant tag UI](https://raw.githubusercontent.com/adonno/tagreader/master/docs/tag-ui.gif)

Expand Down
62 changes: 0 additions & 62 deletions custom_components/esphome_tag.py

This file was deleted.

24 changes: 9 additions & 15 deletions tagreader.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ esphome:
id: buzzer
level: 50%
- delay: 100ms
- output.turn_off: buzzer
- output.turn_off: buzzer
- globals.set:
id: connecting
value: 'false'
value: 'false'
globals:
- id: beep_sound_state
type: bool
Expand Down Expand Up @@ -90,8 +90,8 @@ switch:
- globals.set:
id: led_enable
value: 'false'
#wifi insert your SSID and Your PWD once connected

#wifi insert your SSID and Your PWD once connected
wifi:
ap:
ssid: rfidreader
Expand Down Expand Up @@ -123,7 +123,7 @@ api:
id: buzzer
level: 50%
- delay: 250ms
- output.turn_off: buzzer
- output.turn_off: buzzer

ota:
password: !secret ESP_OTA_PWD
Expand All @@ -139,13 +139,10 @@ pn532:
#TODO #3 - Add condition to read only once every 5 seconds
then:
- homeassistant.event:
event: esphome.rfid_read
event: esphome.tag_scanned
data:
device_id: $devicename
data_template:
tag_id: !lambda 'return x;'

- if:
- if:
condition:
lambda: "return id(led_enable);"
then:
Expand All @@ -158,7 +155,7 @@ pn532:
- delay: 500ms
- light.turn_off:
id: activity_led
- if:
- if:
condition:
lambda: "return id(beep_sound_state);"
then:
Expand Down Expand Up @@ -186,9 +183,6 @@ pn532:
- output.turn_off: buzzer





output:
- platform: esp8266_pwm
pin: D8
Expand All @@ -198,7 +192,7 @@ output:
text_sensor:

- platform: template
id: connected
id: connected


light:
Expand Down