forked from CloudFreeShop/esphome-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sonoff-s31.yaml
92 lines (77 loc) · 1.62 KB
/
sonoff-s31.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
substitutions:
name: "sonoff-s31"
friendly_name: "Sonoff S31"
dashboard_import:
package_import_url: github://CloudFreeShop/esphome-templates/sonoff-s31.yaml
import_full_config: false
esphome:
name: "${name}"
friendly_name: "${friendly_name}"
name_add_mac_suffix: true
project:
name: "CloudFree.S31"
version: "1.0.2"
esp8266:
board: esp01_1m
early_pin_init: false
wifi:
ap:
captive_portal:
api:
ota:
web_server:
local: true
logger:
baud_rate: 0
time:
- platform: homeassistant
id: homeassistant_time
text_sensor:
- platform: wifi_info
ip_address:
name: "${friendly_name} IP Address"
uart:
rx_pin: RX
baud_rate: 4800
binary_sensor:
- platform: gpio
pin:
number: GPIO0
mode: INPUT_PULLUP
inverted: True
name: "${friendly_name} Button"
on_press:
- switch.toggle: relay
- platform: status
name: "${friendly_name} Status"
sensor:
- platform: wifi_signal
name: "${friendly_name} WiFi Signal"
update_interval: 60s
- platform: cse7766
current:
name: "${friendly_name} Current"
accuracy_decimals: 1
voltage:
name: "${friendly_name} Voltage"
accuracy_decimals: 1
power:
name: "${friendly_name} Power"
accuracy_decimals: 1
id: my_power
- platform: total_daily_energy
name: "${friendly_name} Daily Energy"
power_id: my_power
filters:
- multiply: 0.001
unit_of_measurement: kWh
switch:
- platform: gpio
name: "${friendly_name} Relay"
pin: GPIO12
id: relay
restore_mode: RESTORE_DEFAULT_OFF
status_led:
pin:
number: GPIO13
inverted: True