-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhaumtagreader.yaml
111 lines (96 loc) · 2.03 KB
/
haumtagreader.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
substitutions:
devicename: haumtagreader
upper_devicename: HaumTagReader
esphome:
name: $devicename
friendly_name: $upper_devicename
esp8266:
board: d1_mini
# Enable logging
logger:
# Enable over-the-air updates.
ota:
- platform: esphome
mqtt:
broker: !secret mqtt_broker
username: !secret mqtt_user
password: !secret mqtt_password
#blue flash on mqtt connection
on_connect:
- light.turn_on:
id: activity_led
brightness: 100%
red: 0%
green: 0%
blue: 100%
flash_length: 500ms
on_message:
topic: haum/gachaum/strike
payload: "open"
then:
#green led on message
- light.turn_on:
id: activity_led
brightness: 100%
red: 0%
green: 100%
blue: 0%
# flash_length: 500ms
- switch.turn_on: gache
- rtttl.play: "success:d=24,o=5,b=100:c,g,b"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Haumtagreader Fallback Hotspot"
captive_portal:
# Enable web server
web_server:
port: 80
i2c:
scan: False
frequency: 400kHz
pn532_i2c:
id: pn532_board
on_tag:
then:
# orange flash on tag
- light.turn_on:
id: activity_led
brightness: 100%
red: 75%
green: 25%
blue: 0%
flash_length: 500ms
- rtttl.play: "beep:d=16,o=5,b=100:b"
- mqtt.publish:
topic: haum/gachaum/tag/uid
payload: !lambda 'return x;'
light:
- platform: neopixelbus
variant: WS2812
pin: D8
num_leds: 1
flash_transition_length: 200ms
type: GRB
id: activity_led
name: "$upper_devicename LED"
restore_mode: ALWAYS_OFF
switch:
- platform: gpio
pin: D4
id: gache
name: "Porte"
on_turn_on:
- delay: 2s
- switch.turn_off: gache
- light.turn_off: activity_led
# Define the buzzer output
output:
- platform: esp8266_pwm
pin: D7
id: buzzer
# Define buzzer as output for RTTTL
rtttl:
output: buzzer