-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathesphome PV sdm modbus.yaml
248 lines (221 loc) · 5.63 KB
/
esphome PV sdm modbus.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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
esphome:
name: stromzahler-fotovoltaik
friendly_name: Stromzähler Fotovoltaik
esp32:
board: esp32dev #wt32-eth01 funktioniert nicht zusammen mit esp-idf https://github.com/esphome/issues/issues/5644
framework:
type: esp-idf
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "xxx"
ota:
password: "xxx"
# WT32-ETH01 ethernet
ethernet:
type: LAN8720
mdc_pin: GPIO23
mdio_pin: GPIO18
clk_mode: GPIO0_IN
phy_addr: 1
power_pin: GPIO16
web_server:
port: 80
time:
- platform: homeassistant
id: homeassistant_time
uart:
id: uart_id
tx_pin: 17
rx_pin: 5
baud_rate: 9600
modbus:
id: modbus_id
uart_id: uart_id
modbus_controller:
- id: modbus_controller_id
address: 1
modbus_id: modbus_id
setup_priority: -10
update_interval: 1s
sensor:
# General
- platform: modbus_controller
modbus_controller_id: modbus_controller_id
name: "Netzfrequenz"
register_type: read
address: 70
value_type: FP32
unit_of_measurement: Hz
state_class: "measurement"
device_class: "frequency"
accuracy_decimals: 3
- platform: modbus_controller
modbus_controller_id: modbus_controller_id
id: leistung
name: "Leistung"
register_type: read
address: 52
value_type: FP32
unit_of_measurement: W
state_class: "measurement"
device_class: "power"
accuracy_decimals: 3
on_value: # seperate import & export
then:
- sensor.template.publish:
id: leistung_export
state: !lambda |-
if (id(leistung).state < 0) {
return id(leistung).state*(-1);
} else {
return 0.0;
}
- sensor.template.publish:
id: leistung_import
state: !lambda |-
if (id(leistung).state >= 0) {
return id(leistung).state;
} else {
return 0.0;
}
- platform: modbus_controller
modbus_controller_id: modbus_controller_id
name: "Strom"
register_type: read
address: 48
value_type: FP32
device_class: "current"
state_class: "measurement"
unit_of_measurement: A
accuracy_decimals: 3
- platform: modbus_controller
modbus_controller_id: modbus_controller_id
name: "Import Energie"
register_type: read
address: 72
value_type: FP32
unit_of_measurement: kWh
state_class: "total_increasing"
device_class: "energy"
accuracy_decimals: 3
- platform: modbus_controller
modbus_controller_id: modbus_controller_id
name: "Export Energie"
register_type: read
address: 74
value_type: FP32
unit_of_measurement: kWh
state_class: "total_increasing"
device_class: "energy"
accuracy_decimals: 3
# Phasen Leistung
- platform: modbus_controller
modbus_controller_id: modbus_controller_id
name: "L1 Leistung"
register_type: read
address: 12
value_type: FP32
unit_of_measurement: W
device_class: "power"
state_class: "measurement"
accuracy_decimals: 3
- platform: modbus_controller
modbus_controller_id: modbus_controller_id
name: "L2 Leistung"
register_type: read
address: 14
value_type: FP32
unit_of_measurement: W
device_class: "power"
state_class: "measurement"
accuracy_decimals: 3
- platform: modbus_controller
modbus_controller_id: modbus_controller_id
name: "L3 Leistung"
register_type: read
address: 16
value_type: FP32
unit_of_measurement: W
device_class: "power"
state_class: "measurement"
accuracy_decimals: 3
# Phasen Spannung
- platform: modbus_controller
modbus_controller_id: modbus_controller_id
name: "L1 Spannung"
register_type: read
address: 0
value_type: FP32
unit_of_measurement: V
device_class: "voltage"
state_class: "measurement"
accuracy_decimals: 3
- platform: modbus_controller
modbus_controller_id: modbus_controller_id
name: "L2 Spannung"
register_type: read
address: 2
value_type: FP32
device_class: "voltage"
state_class: "measurement"
unit_of_measurement: V
accuracy_decimals: 3
- platform: modbus_controller
modbus_controller_id: modbus_controller_id
name: "L3 Spannung"
register_type: read
address: 4
value_type: FP32
device_class: "voltage"
state_class: "measurement"
unit_of_measurement: V
accuracy_decimals: 3
# Phasen Strom
- platform: modbus_controller
modbus_controller_id: modbus_controller_id
name: "L1 Strom"
register_type: read
address: 6
value_type: FP32
device_class: "current"
state_class: "measurement"
unit_of_measurement: A
accuracy_decimals: 3
- platform: modbus_controller
modbus_controller_id: modbus_controller_id
name: "L2 Strom"
register_type: read
address: 8
value_type: FP32
device_class: "current"
state_class: "measurement"
unit_of_measurement: A
accuracy_decimals: 3
- platform: modbus_controller
modbus_controller_id: modbus_controller_id
name: "L3 Strom"
register_type: read
address: 10
value_type: FP32
device_class: "current"
state_class: "measurement"
unit_of_measurement: A
accuracy_decimals: 3
# Eigene Entitäten
- platform: template
name: "Leistung Export"
id: leistung_export
unit_of_measurement: W
device_class: "power"
state_class: "measurement"
accuracy_decimals: 0
- platform: template
name: "Leistung Import"
id: leistung_import
unit_of_measurement: W
device_class: "power"
state_class: "measurement"
accuracy_decimals: 0