-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgosund-sp111-no-led.yaml
110 lines (95 loc) · 2.01 KB
/
gosund-sp111-no-led.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
#
# gosund sp111 smart plug with power sensor
#
dashboard_import:
package_import_url: github://wonsky007/cust-esphome-yamls/gosund-sp111-no-led.yaml@main
import_full_config: true
substitutions:
name: "gosund-sp111"
esphome:
name: "${name}"
name_add_mac_suffix: true
platform: ESP8266
board: esp8285
project:
name: "esphome.gosund-sp111"
version: "1.0.0"
# WiFi connection
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
#failback ap
ap:
ssid: "gosund-sp111"
password: "12345678"
captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
# Enable over-the-air updates
ota:
# TIME
time:
- platform: homeassistant
id: homeassistant_time
# Enable Web server
web_server:
port: 80
sensor:
- platform: total_daily_energy
name: "Daily Power Usage"
power_id: "sp111_power"
filters:
# Multiplication factor from W to kW is 0.001
- multiply: 0.001
unit_of_measurement: kWh
icon: mdi:calendar-clock
accuracy_decimals: 3
# Power sensor
- platform: hlw8012
voltage_divider: 765 # Calibration value
current_resistor: 0.001
sel_pin:
number: GPIO12
inverted: true
cf_pin: GPIO05
cf1_pin: GPIO04
change_mode_every: 3
update_interval: 5s
# Current sensor
current:
id: sp111_current
name: Current
unit_of_measurement: A
accuracy_decimals: 3
# Voltage sensor
voltage:
id: sp111_voltage
name: Voltage
unit_of_measurement: V
accuracy_decimals: 1
# Power sensor
power:
id: sp111_power
name: Power consumption
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
restore_mode: ALWAYS_ON