-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNodeMCU-code
More file actions
125 lines (113 loc) · 2.8 KB
/
Copy pathNodeMCU-code
File metadata and controls
125 lines (113 loc) · 2.8 KB
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
esphome:
name: smartswitch
friendly_name: SmartSwitch
esp8266:
board: nodemcuv2
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "LC7R3n3Y7QuWIF3HbxLR6bqhaah33v4YgpvDMMXyf3I="
ota:
- platform: esphome
password: "70dc608e95566662d60e00e9f3284a16"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Smartswitch Fallback Hotspot"
password: "KzX5Cm9kNAOx"
captive_portal:
switch:
- platform: gpio
pin: D3 #Enter pin for Relay 1
name: Relay1
id: relay1
inverted: true
- platform: gpio
pin: D2 #Enter pin for Relay 2
name: Relay2
id: relay2
inverted: true
- platform: gpio
pin: D1 #Enter pin for Relay 3
name: relay3
id: relay
inverted: true
- platform: gpio
pin: GPIO10 #Enter pin for Relay 4
name: Relay4
id: relay4
inverted: true
binary_sensor:
- platform: gpio
pin: D5 # Enter Touch Sensor 1 pin
name: touch_1
device_class: window
on_press:
- switch.toggle: relay1
- platform: gpio
pin: D6 # Enter Touch Sensor 2 pin
name: touch_2
on_press:
- switch.toggle: relay2
device_class: window
- platform: gpio
pin: D7 # Enter Touch Sensor 3 pin
name: touch_3
device_class: window
on_press:
- switch.toggle: relay
- platform: gpio
pin: D8 # Enter Touch Sensor 4 pin
name: touch_4
device_class: window
on_press:
- switch.toggle: relay4
light:
- platform: neopixelbus
type: GRB
variant: ws2811
pin: D0 #Enter LedStrips pin
num_leds: 16
name: "NeoPixel Light"
effects:
- pulse:
- pulse:
name: "Fast Pulse"
transition_length: 0.5s
update_interval: 0.5s
min_brightness: 0%
max_brightness: 100%
- addressable_rainbow:
- addressable_rainbow:
name: Rainbow Effect (Cv)
speed: 10
width: 50
- addressable_fireworks:
- addressable_fireworks:
name: Fireworks Effect (Random Color)
update_interval: 32ms
spark_probability: 10%
use_random_color: True
fade_out_rate: 120
- addressable_scan:
name: Scan Effect (cV)
move_interval: 100ms
scan_width: 1
- addressable_color_wipe:
- addressable_color_wipe:
name: Color Wipe Effect (CV)
colors:
- red: 100%
green: 100%
blue: 100%
num_leds: 1
- red: 0%
green: 0%
blue: 0%
num_leds: 1
add_led_interval: 100ms
reverse: false