-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtagtuner-for-tagreader.yaml
140 lines (130 loc) · 3.13 KB
/
tagtuner-for-tagreader.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# These substitutions allow the end user to override certain values
substitutions:
name: "tagtuner"
friendly_name: "TagTuner"
d1_mini: d1_mini
buzpin: D7
ledpin: D8
esphome:
name: "${name}"
friendly_name: ${friendly_name}
# Automatically add the mac address to the name
# so you can use a single firmware for all devices
name_add_mac_suffix: true
# hello world
on_boot:
priority: -100
then:
- wait_until:
condition:
api.connected:
timeout: 20s
- text_sensor.template.publish:
id: status
state: "Ready"
# - light.turn_off: led1
esp8266:
board: $d1_mini
framework:
version: recommended
# To be able to get logs from the device via serial and api.
logger:
# level: VERBOSE
# level: DEBUG
# level: WARN
level: ERROR
# logs:
# light: WARN
# pn532: DEBUG
# pn532_i2c: DEBUG
packages:
core-nfc: github://luka6000/TagTuner/tagtuner-core-nfc.yaml@main
core-comms: github://luka6000/TagTuner/tagtuner-core-comms.yaml@main
# I was not able to use light with tagreader hardware and TagTuner firmware.
# My nodemcu is restarting every time I try to turn on the light.
# Please experiment on your own.
# tagreader-light: !include tagtuner-for-tagreader-light.yaml
i2c:
id: bus_i2c
scan: False
frequency: 100kHz
timeout: 13ms #to prevent pn532 timeout
output:
- platform: esp8266_pwm
pin: $buzpin
id: buzzer
rtttl:
output: buzzer
id: buz
switch:
- platform: template
name: "Buzzer Enabled"
id: buzzon
icon: mdi:volume-high
optimistic: true
restore_mode: RESTORE_DEFAULT_ON
entity_category: config
#Enable light and check if it works for you. My nodemcu keeps restarting with light enabled.
script:
- id: led_blink
then:
- if:
condition:
switch.is_on: buzzon
then:
- rtttl.play: "write:d=24,o=5,b=100:g,b"
# - if:
# condition:
# switch.is_on: ledon
# then:
# - light.turn_on:
# id: led1
# effect: blinkWhite
# - delay: 600ms
# - light.turn_off: led1
- id: led_ok
then:
- if:
condition:
switch.is_on: buzzon
then:
- rtttl.play: "success:d=24,o=5,b=100:c,g,b"
# - if:
# condition:
# switch.is_on: ledon
# then:
# - light.turn_on:
# id: led1
# effect: blinkGreen
# - delay: 600ms
# - light.turn_off: led1
- id: led_success
then:
- if:
condition:
switch.is_on: buzzon
then:
- rtttl.play: "write:d=24,o=5,b=100:b,b"
# - if:
# condition:
# switch.is_on: ledon
# then:
# - light.turn_on:
# id: led1
# effect: blinkGreen
# - delay: 600ms
# - light.turn_off: led1
- id: led_tagwrite
then:
- if:
condition:
switch.is_on: buzzon
then:
- rtttl.play: "write:d=24,o=5,b=100:b"
# - if:
# condition:
# switch.is_on: ledon
# then:
# - light.turn_on:
# id: led1
# effect: blinkRed