-
Notifications
You must be signed in to change notification settings - Fork 4
/
piggymeter-common.yaml
153 lines (129 loc) · 3.26 KB
/
piggymeter-common.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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# Common settings for all boards
esphome:
name: ${name}
comment: "PiggyMeter IEC62056-21"
esp32:
variant: ${variant}
board: ${board}
framework:
type: esp-idf
logger:
level: DEBUG
# level: INFO
wifi:
networks:
- ssid: !secret wifi_ssid
password: !secret wifi_pass
# Optional domain
# domain: .lan
api:
encryption:
key: !secret api_key
ota:
password: !secret ota_pass
external_components:
# IEC62056-21 component
- source: github://aquaticus/esphome-iec62056
uart:
- id: uart_meter
rx_pin: ${rx_pin}
tx_pin: ${tx_pin}
baud_rate: 300
data_bits: 7
parity: EVEN
stop_bits: 1
switch:
- platform: gpio
pin: ${led_pin}
name: Internal LED
id: led_switch
internal: True
- platform: iec62056
name: 'Readout Trigger'
id: 'readout_trigger'
binary_sensor:
- platform: iec62056
id: meter_status
name: Meter Connection Status
on_press:
then:
- switch.turn_on: led_switch
on_release:
then:
- switch.turn_off: led_switch
iec62056:
update_interval: 60s
baud_rate_max: 9600
# Modify the list and OBIS codes if needed
# Doc: https://aquaticus.info/iec62056.html
sensor:
- platform: iec62056
obis: 1-0:15.8.0
name: Absolute active energy total
unit_of_measurement: kWh
accuracy_decimals: 3
device_class: energy
state_class: total_increasing
- platform: iec62056
name: Instantaneous current in phase L1
obis: 1-0:31.7.0
unit_of_measurement: A
accuracy_decimals: 2
device_class: current
state_class: measurement
- platform: iec62056
name: Instantaneous current in phase L2
obis: 1-0:51.7.0
unit_of_measurement: A
accuracy_decimals: 2
device_class: current
state_class: measurement
- platform: iec62056
name: Instantaneous current in phase L3
obis: 1-0:71.7.0
unit_of_measurement: A
accuracy_decimals: 2
device_class: current
state_class: measurement
- platform: iec62056
name: Instantaneous voltage in phase L1
obis: 1-0:32.7.0
unit_of_measurement: V
accuracy_decimals: 1
device_class: voltage
state_class: measurement
- platform: iec62056
name: Instantaneous voltage in phase L2
obis: 1-0:52.7.0
unit_of_measurement: V
accuracy_decimals: 1
device_class: voltage
state_class: measurement
- platform: iec62056
name: Instantaneous voltage in phase L3
obis: 1-0:72.7.0
unit_of_measurement: V
accuracy_decimals: 1
device_class: voltage
state_class: measurement
- platform: iec62056
name: Positive active instantaneous power
obis: 1-0:1.7.0
unit_of_measurement: kW
accuracy_decimals: 3
device_class: energy
state_class: measurement
- platform: iec62056
name: Absolute active instantaneous power
obis: 1-0:15.7.0
unit_of_measurement: kW
accuracy_decimals: 3
device_class: energy
state_class: measurement
- platform: iec62056
name: Absolute active maximum demand total
obis: 1-0:15.6.0
unit_of_measurement: kW
accuracy_decimals: 3
device_class: energy
state_class: measurement