forked from berfenger/esphome_components
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample_sonoff_dual_r3_v1.yaml
102 lines (96 loc) · 1.96 KB
/
example_sonoff_dual_r3_v1.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
external_components:
- source: github://berfenger/esphome_components
components: [ cse7761 ]
esphome:
name: example_sonoff_dual_r3_v1
platform: ESP32
board: esp-wrover-kit
logger:
level: WARN
baud_rate: 0
binary_sensor:
- platform: gpio
pin:
number: GPIO0
mode: INPUT_PULLUP
inverted: True
name: "Cover button"
internal: True
on_click:
then:
- switch.toggle: switch_relay1
on_double_click:
then:
- switch.toggle: switch_relay2
# use this config for momentary switches
- platform: gpio
pin:
number: GPIO32
mode: INPUT_PULLUP
inverted: true
name: "Momentary switch 1"
internal: True
on_press:
then:
- switch.toggle: switch_relay1
- platform: gpio
pin:
number: GPIO33
mode: INPUT_PULLUP
inverted: true
name: "Momentary switch 2"
internal: True
on_press:
then:
- switch.toggle: switch_relay2
# use this config for latching switches
# - platform: gpio
# pin:
# number: GPIO32
# mode: INPUT_PULLDOWN
# name: "Latching switch 1"
# internal: True
# on_state:
# then:
# - switch.toggle: switch_relay1
# - platform: gpio
# pin:
# number: GPIO33
# mode: INPUT_PULLDOWN
# name: "Latching switch 2"
# internal: True
# on_state:
# then:
# - switch.toggle: switch_relay2
status_led:
pin:
number: GPIO13
inverted: true
switch:
- platform: gpio
id: switch_relay1
pin:
number: GPIO27
- platform: gpio
id: switch_relay2
pin:
number: GPIO14
sensor:
platform: cse7761
voltage:
name: CSE7761 Voltage
current_1:
name: CSE7761 Current 1
current_2:
name: CSE7761 Current 2
active_power_1:
name: CSE7761 Active Power 1
active_power_2:
name: CSE7761 Active Power 2
update_interval: 5s
# cse7761 uart port
uart:
tx_pin: GPIO25
rx_pin: GPIO26
baud_rate: 38400
parity: EVEN