-
Notifications
You must be signed in to change notification settings - Fork 2
/
sonoff-pow-r2.yaml
101 lines (91 loc) · 1.83 KB
/
sonoff-pow-r2.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
esphome:
name: pow
platform: ESP8266
board: esp01_1m
board_flash_mode: dout
wifi:
ssid: '<wifi_nazev>'
password: '<wifi_heslo>'
logger:
baud_rate: 0
uart:
rx_pin: RX
baud_rate: 4800
api:
ota:
binary_sensor:
- platform: gpio
id: button
pin:
number: GPIO0
mode: INPUT_PULLUP
inverted: True
on_press:
- switch.toggle: fakebutton
- platform: template
name: "Pračka pere"
filters:
- delayed_off: 15s
lambda: |-
if (isnan(id(power).state)) {
return {};
} else if (id(power).state > 2) {
// Running
return true;
} else {
// Not running
return false;
}
switch:
- platform: template
name: "Sonoff POW Přepínač"
optimistic: true
id: fakebutton
turn_on_action:
- switch.turn_on: relay
- light.turn_on: led
turn_off_action:
- switch.turn_off: relay
- light.turn_off: led
- platform: gpio
id: relay
pin: GPIO12
output:
- platform: esp8266_pwm
id: pow_blue_led
pin:
number: GPIO13
inverted: True
light:
- platform: monochromatic
output: pow_blue_led
id: led
sensor:
- platform: wifi_signal
name: "Sonoff POW WiFi Signál"
update_interval: 60s
- platform: uptime
name: "Sonoff POW Doba běhu"
- platform: cse7766
update_interval: 2s
current:
name: "Sonoff POW Proud"
voltage:
name: "Sonoff POW Napětí"
power:
name: "Sonoff POW Příkon"
id: power
on_value_range:
- above: 2.0
then:
- light.turn_on: led
- below: 1.0
then:
- light.turn_off: led
- platform: total_daily_energy
name: "Sonoff POW Denní spotřeba"
power_id: power
unit_of_measurement: W
text_sensor:
- platform: version
name: "Sonoff POW Verze"