-
Notifications
You must be signed in to change notification settings - Fork 0
/
SPP04G-wifi.yaml
136 lines (116 loc) · 2.61 KB
/
SPP04G-wifi.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
## MERCATOR SPP04G-WIFI https://www.ikuu.com.au/?attachment_id=22698
## NOTE : WT-01N From wireless-tag MUST be transplanted for this to work, new units come with a BK Chip (UNRUCKY!)
## Compiled by Rodgrech - Vers 1.0
substitutions:
device_name: "SPP04G GPO1"
friendly_name: "SPP04G GPO1"
esphome:
name: spp04g-wifi-esp2
esp8266:
board: esp01_1m
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "<removed>"
ota:
password: "<removed>"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Spp04G-Wifi-Esp1"
password: "lolno"
captive_portal:
web_server:
port: 80
sensor:
- platform: uptime
name: ${device_name} Uptime
- platform: wifi_signal
name: ${device_name} Wifi Signal
update_interval: 60s
# - platform: hlw8012
# sel_pin: 5
# cf_pin: 14
# cf1_pin: 13
# current:
# name: "${device_name} Current"
# voltage:
# name: "${device_name} Voltage"
# power:
# name: "${device_name} Power"
# energy:
# name: "${device_name} Energy"
# update_interval: 60s
text_sensor:
- platform: version
name: ${device_name} ESPhome Version
- platform: wifi_info
ip_address:
name: ${device_name} IP
#################################
status_led:
pin:
number: GPIO05
inverted: false
binary_sensor:
- platform: gpio
pin:
number: GPIO04
inverted: True
id: button1
name: "${device_name} Button 1"
on_click:
- min_length: 300ms
max_length: 1000ms
then:
- switch.toggle: relay_template1
internal: True
- platform: gpio
pin:
number: GPIO12
inverted: True
id: button2
name: "${device_name} Button 2"
on_click:
- min_length: 300ms
max_length: 1000ms
then:
- switch.toggle: relay_template2
internal: True
switch:
- platform: gpio
pin: GPIO13
id: relay1
- platform: gpio
pin: GPIO14
id: relay2
- platform: template
name: ${device_name} Socket A
id: relay_template1
lambda: |-
if (id(relay1).state) {
return true;
} else {
return false;
}
turn_on_action:
- switch.turn_on: relay1
turn_off_action:
- switch.turn_off: relay1
- platform: template
name: ${device_name} Socket B
id: relay_template2
lambda: |-
if (id(relay2).state) {
return true;
} else {
return false;
}
turn_on_action:
- switch.turn_on: relay2
turn_off_action:
- switch.turn_off: relay2