-
Notifications
You must be signed in to change notification settings - Fork 5
/
gosund-sp111.yaml
106 lines (94 loc) · 1.78 KB
/
gosund-sp111.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
#
# gosund sp111 smart plug with power sensor
#
esphome:
name: gosundsp111
platform: ESP8266
board: esp8285
# WiFi connection
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# reboot_timeout: 0s
# ssid: "abc"
# password: "12345678"
ap:
ssid: "gosund-sp111"
# password: "12345678"
captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
# Enable over-the-air updates
ota:
# Enable Web server
web_server:
port: 80
sensor:
# Power sensor
- platform: hlw8012
voltage_divider: 771
# current_resistor: 0.001
current_resistor: 0.0012
sel_pin:
number: GPIO12
inverted: true
cf_pin: GPIO05
cf1_pin: GPIO04
change_mode_every: 3
update_interval: 5s
# Current sensor
current:
name: current
unit_of_measurement: A
accuracy_decimals: 3
# Voltage sensor
voltage:
name: voltage
unit_of_measurement: V
accuracy_decimals: 1
# Power sensor
power:
id: power
name: power
unit_of_measurement: W
accuracy_decimals: 0
filters:
- multiply: 0.5
binary_sensor:
# Binary sensor for the button press
- platform: gpio
name: button
pin:
number: GPIO13
inverted: true
on_press:
- switch.toggle: relay
switch:
# Switch to toggle the relay
- platform: gpio
id: relay
name: relay
pin: GPIO15
on_turn_on:
- light.turn_on: led
on_turn_off:
- light.turn_off: led
output:
# Relay state led
- platform: esp8266_pwm
id: state_led
pin:
number: GPIO2
inverted: true
light:
# Relay state light
- platform: monochromatic
output: state_led
id: led
# Uses the red LED as a ESPhome status indicator
status_led:
pin:
number: GPIO0
inverted: true