-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathexample_obis.yml
More file actions
130 lines (113 loc) · 2.93 KB
/
example_obis.yml
File metadata and controls
130 lines (113 loc) · 2.93 KB
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
external_components:
- source: github://jplitza/esphome_components
logger:
baud_rate: 0
uart:
id: uart_bus
rx_pin: GPIO3
tx_pin: GPIO1
# Adapt the following three lines to the energy meter you're reading!
baud_rate: 9600
data_bits: 7
parity: EVEN
stop_bits: 1
# Some devices need to be triggered to send their data. We can use the
# integrated "interval" component for that:
interval:
- interval: 10sec
then:
- logger.log:
format: "Initiating communication at 300 baud"
tag: "mt174"
- lambda: |-
if (id(uart_bus).get_baud_rate() != 300) {
id(uart_bus).flush();
id(uart_bus).set_baud_rate(300);
id(uart_bus).load_settings();
}
- delay: 1s
- uart.write:
id: uart_bus
data: [0x2F, 0x3F, 0x21, 0x0D, 0x0A]
obis:
uart_id: uart_bus
on_opening:
then:
# The following makes Iskra MT174 output their info at 9600 baud instead
# of 300 baud!
- logger.log:
format: "Received opening, sending ACK"
tag: mt174
- uart.write:
id: uart_bus
data: [0x06, 0x30, 0x35, 0x30, 0x0D, 0x0A]
- logger.log:
format: "Switching to 9600 baud"
tag: mt174
- lambda: |-
id(uart_bus).flush();
id(uart_bus).set_baud_rate(9600);
id(uart_bus).load_settings();
sensor:
- platform: obis
channel: "1-0:1.8.0*255"
name: "Power Meter"
unit_of_measurement: "kWh"
device_class: energy
state_class: total_increasing
accuracy_decimals: 2
icon: "mdi:speedometer"
filters:
- throttle: 30s
- platform: obis
channel: "1-0:21.7.255*255"
name: "Phase 1 Power"
unit_of_measurement: "W"
device_class: power
state_class: measurement
accuracy_decimals: 0
icon: "mdi:numeric-1-circle"
filters:
- sliding_window_moving_average:
window_size: 5
send_every: 5
- platform: obis
channel: "1-0:41.7.255*255"
name: "Phase 2 Power"
unit_of_measurement: "W"
device_class: power
state_class: measurement
accuracy_decimals: 0
icon: "mdi:numeric-2-circle"
filters:
- sliding_window_moving_average:
window_size: 5
send_every: 5
- platform: obis
channel: "1-0:61.7.255*255"
name: "Phase 3 Power"
unit_of_measurement: "W"
device_class: power
state_class: measurement
accuracy_decimals: 0
icon: "mdi:numeric-3-circle"
filters:
- sliding_window_moving_average:
window_size: 5
send_every: 5
- platform: obis
channel: "1-0:1.7.255*255"
name: "Total Power"
unit_of_measurement: "W"
device_class: power
state_class: measurement
accuracy_decimals: 0
icon: "mdi:flash"
filters:
- sliding_window_moving_average:
window_size: 5
send_every: 5
text_sensor:
- platform: obis
channel: "0-0:96.1.255*255"
name: "Serial Number"