-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdevice_sp112_v28.yaml
113 lines (105 loc) · 2.82 KB
/
device_sp112_v28.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
111
112
113
packages:
defaults: !include defaults.yaml
esp: !include board_esp8285.yaml
logger:
baud_rate: 0
uart:
rx_pin: GPIO03
baud_rate: 4800
sensor:
# power sensor
- platform: cse7766
current:
name: "${id} current"
unit_of_measurement: A
accuracy_decimals: 3
filters:
# map from sensor -> measured value
# - calibrate_linear:
# - 0.0 -> 0.013
# - 0.08208 -> 0.071
# - 1.34223 -> 1.066
# - 5.57170 -> 4.408
# - 6.69184 -> 5.259
# - 6.97187 -> 5.540
# make everything below 0.01A appear as just 0A
# furthermore it corrects 0.013A for the power usage of the plug
- lambda: if (x < (0.01 - 0.013)) return 0; else return (x - 0.013);
# voltage sensor
voltage:
name: "${id} voltage"
unit_of_measurement: V
accuracy_decimals: 1
filters:
- delta: 3
- throttle: ${update_throttle}
# filters:
# map from sensor -> measured value
# - calibrate_linear:
# - 0.0 -> 0.0
# - 602.87506 -> 229.9
# - 609.8 -> 232.8
# power sensor
power:
id: "${id}_power_usage"
name: "${id} power"
unit_of_measurement: W
accuracy_decimals: 0
filters:
# map from sensor -> measured value
# - calibrate_linear:
# - 0.0 -> 1.14
# - 62.06167 -> 10.93
# - 1503.27161 -> 247.6
# - 1599.81213 -> 263.7
# - 3923.67700 -> 631.4
# - 7109.50928 -> 1148.0
# - 7237.0857 -> 1193.0
# - 7426.71338 -> 1217.0
# make everything below 2W appear as just 0W
# furthermore it corrects 1.14W for the power usage of the plug
- lambda: if (x < (2 + 1.14)) return 0; else return (x - 1.14);
# total daily energy sensor
- platform: total_daily_energy
name: "${id} daily energy usage"
power_id: "${id}_power_usage"
filters:
# multiplication factor from W to kW is 0.001
- multiply: 0.001
unit_of_measurement: kWh
output:
# relay state led
- platform: esp8266_pwm
id: "${id}_state_led"
pin:
number: GPIO02
inverted: true
# switched output a (mains output)
- platform: gpio
pin: GPIO14
id: "${id}_actor_a"
# switched output b (USB)
- platform: gpio
pin: GPIO05
id: "${id}_actor_b"
light:
# relay state light
- platform: monochromatic
output: "${id}_state_led"
id: "${id}_relay_state_light"
# uses the red led as a status indicator
status_led:
pin:
number: GPIO00
inverted: true
switch:
# switch to restart the plug
- platform: restart
name: "${id} restart"
binary_sensor:
# binary sensor for the button press
- platform: gpio
id: "${id}_sensor"
name: "${id} sensor"
pin:
number: GPIO16