-
Notifications
You must be signed in to change notification settings - Fork 5
/
renogy-modbus.yaml
451 lines (401 loc) · 12.3 KB
/
renogy-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
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
uart:
baud_rate: 9600
data_bits: 8
stop_bits: 1
parity: NONE
modbus:
send_wait_time: 50ms
modbus_controller:
- id: renogy
address: 0xFF
setup_priority: -10
update_interval: 3s
sensor:
#region battery
- id: ${location}_${device}_battery_soc
name: $locationName $deviceName Battery State of Charge
platform: modbus_controller
modbus_controller_id: renogy
address: 0x0100
unit_of_measurement: '%'
register_type: holding
value_type: U_WORD
accuracy_decimals: 0
- id: ${location}_${device}_battery_voltage
name: $locationName $deviceName Battery Voltage
platform: modbus_controller
modbus_controller_id: renogy
address: 0x0101
unit_of_measurement: V
register_type: holding
value_type: U_WORD
accuracy_decimals: 1
filters:
- multiply: 0.1
- id: ${location}_${device}_battery_current
name: $locationName $deviceName Battery Current
platform: modbus_controller
modbus_controller_id: renogy
address: 0x0102
unit_of_measurement: A
register_type: holding
value_type: U_WORD
accuracy_decimals: 2
filters:
- multiply: 0.01
#endregion
#region temperature
- id: ${location}_${device}_controller_temperature
name: $locationName $deviceName Controller Temperature
platform: modbus_controller
modbus_controller_id: renogy
address: 0x0103
bitmask: 0xFF00
unit_of_measurement: '°C'
register_type: holding
value_type: S_WORD
accuracy_decimals: 1
# - id: ${location}_${device}_battery_temperature
# name: $locationName $deviceName Battery Temperature
# platform: modbus_controller
# modbus_controller_id: renogy
# address: 0x0103
# bitmask: 0x00FF
# unit_of_measurement: '°C'
# register_type: holding
# value_type: S_WORD
# accuracy_decimals: 1
#endregion
#region load
- id: ${location}_${device}_load_voltage
name: $locationName $deviceName Load Voltage
platform: modbus_controller
modbus_controller_id: renogy
address: 0x0104
unit_of_measurement: V
register_type: holding
value_type: U_WORD
accuracy_decimals: 1
filters:
- multiply: 0.1
- id: ${location}_${device}_load_current
name: $locationName $deviceName Load Current
platform: modbus_controller
modbus_controller_id: renogy
address: 0x0105
unit_of_measurement: A
register_type: holding
value_type: U_WORD
accuracy_decimals: 2
filters:
- multiply: 0.01
- id: ${location}_${device}_load_power
name: $locationName $deviceName Load Power
platform: modbus_controller
modbus_controller_id: renogy
address: 0x0106
unit_of_measurement: W
register_type: holding
value_type: U_WORD
accuracy_decimals: 1
#endregion
#region solar panel
- id: ${location}_${device}_solar_voltage
name: $locationName $deviceName Solar Voltage
platform: modbus_controller
modbus_controller_id: renogy
address: 0x0107
unit_of_measurement: V
register_type: holding
value_type: U_WORD
accuracy_decimals: 1
filters:
- multiply: 0.1
- id: ${location}_${device}_solar_current
name: $locationName $deviceName Solar Current
platform: modbus_controller
modbus_controller_id: renogy
address: 0x0108
unit_of_measurement: A
register_type: holding
value_type: U_WORD
accuracy_decimals: 2
filters:
- multiply: 0.1
- id: ${location}_${device}_solar_power
name: $locationName $deviceName Solar Power
platform: modbus_controller
modbus_controller_id: renogy
address: 0x0109
unit_of_measurement: W
register_type: holding
value_type: U_WORD
accuracy_decimals: 1
#endregion
#region status
- id: charging_state
name: charging_state
entity_category: diagnostic
internal: true
platform: modbus_controller
modbus_controller_id: renogy
address: 0x0120
bitmask: 0x00FF
register_type: holding
value_type: U_WORD
accuracy_decimals: 0
on_value:
then:
- component.update: ${location}_${device}_charging_state
- id: error_state
name: error_state
entity_category: diagnostic
internal: true
platform: modbus_controller
modbus_controller_id: renogy
address: 0x0121
register_type: holding
value_type: U_WORD
accuracy_decimals: 0
on_value:
then:
- component.update: ${location}_${device}_error_state
#endregion
#region statistics
- id: ${location}_${device}_min_battery_voltage_today
name: $locationName $deviceName Min Battery Voltage
platform: modbus_controller
modbus_controller_id: renogy
address: 0x010B
unit_of_measurement: V
register_type: holding
value_type: U_WORD
accuracy_decimals: 1
skip_updates: 1200
filters:
- multiply: 0.1
- id: ${location}_${device}_max_battery_voltage_today
name: $locationName $deviceName Max Battery Voltage
platform: modbus_controller
modbus_controller_id: renogy
address: 0x010C
unit_of_measurement: V
register_type: holding
value_type: U_WORD
accuracy_decimals: 1
skip_updates: 1200
filters:
- multiply: 0.1
- id: ${location}_${device}_max_charging_current_today
name: $locationName $deviceName Max Charging Current
platform: modbus_controller
modbus_controller_id: renogy
address: 0x010D
unit_of_measurement: A
register_type: holding
value_type: U_WORD
accuracy_decimals: 2
skip_updates: 1200
filters:
- multiply: 0.01
- id: ${location}_${device}_max_discharging_current_today
name: $locationName $deviceName Max Discharging Current
platform: modbus_controller
modbus_controller_id: renogy
address: 0x010E
unit_of_measurement: A
register_type: holding
value_type: U_WORD
accuracy_decimals: 2
skip_updates: 1200
filters:
- multiply: 0.01
- id: ${location}_${device}_max_charging_power_today
name: $locationName $deviceName Max Charging Power
platform: modbus_controller
modbus_controller_id: renogy
address: 0x010F
unit_of_measurement: W
register_type: holding
value_type: U_WORD
accuracy_decimals: 1
skip_updates: 1200
- id: ${location}_${device}_max_discharging_power_today
name: $locationName $deviceName Max Discharging Power
platform: modbus_controller
modbus_controller_id: renogy
address: 0x0110
unit_of_measurement: W
register_type: holding
value_type: U_WORD
accuracy_decimals: 1
skip_updates: 1200
- id: ${location}_${device}_charging_amp_hours_today
name: $locationName $deviceName Charged Current
platform: modbus_controller
modbus_controller_id: renogy
address: 0x0111
unit_of_measurement: AH
register_type: holding
value_type: U_WORD
accuracy_decimals: 1
skip_updates: 1200
- id: ${location}_${device}_discharging_amp_hours_today
name: $locationName $deviceName Discharged Current
platform: modbus_controller
modbus_controller_id: renogy
address: 0x0112
unit_of_measurement: AH
register_type: holding
value_type: U_WORD
accuracy_decimals: 1
skip_updates: 1200
- id: ${location}_${device}_charging_watt_hours_today
name: $locationName $deviceName Charged Power
platform: modbus_controller
modbus_controller_id: renogy
address: 0x0113
unit_of_measurement: WH
register_type: holding
value_type: U_WORD
accuracy_decimals: 1
skip_updates: 1200
filters:
- multiply: 10
- id: ${location}_${device}_discharging_watt_hours_today
name: $locationName $deviceName Discharged Power
platform: modbus_controller
modbus_controller_id: renogy
address: 0x0114
unit_of_measurement: WH
register_type: holding
value_type: U_WORD
accuracy_decimals: 1
skip_updates: 1200
filters:
- multiply: 10
- id: ${location}_${device}_days_operational
name: $locationName $deviceName Days Operational
entity_category: diagnostic
platform: modbus_controller
modbus_controller_id: renogy
address: 0x0115
unit_of_measurement: d
register_type: holding
value_type: U_WORD
accuracy_decimals: 0
skip_updates: 1200
- id: ${location}_${device}_battery_over_discharges
name: $locationName $deviceName Battery Over-Discharges
platform: modbus_controller
modbus_controller_id: renogy
address: 0x0116
register_type: holding
value_type: U_WORD
accuracy_decimals: 0
skip_updates: 1200
- id: ${location}_${device}_battery_full_charges
name: $locationName $deviceName Battery Full Charges
platform: modbus_controller
modbus_controller_id: renogy
address: 0x0117
register_type: holding
value_type: U_WORD
accuracy_decimals: 0
skip_updates: 1200
- id: ${location}_${device}_charging_amp_hours_total
name: $locationName $deviceName Total Charged Current
platform: modbus_controller
modbus_controller_id: renogy
address: 0x0118
unit_of_measurement: AH
register_type: holding
register_count: 2
value_type: U_DWORD
accuracy_decimals: 1
skip_updates: 1200
- id: ${location}_${device}_discharging_amp_hours_total
name: $locationName $deviceName Total Discharged Current
platform: modbus_controller
modbus_controller_id: renogy
address: 0x011A
unit_of_measurement: AH
register_type: holding
register_count: 2
value_type: U_DWORD
accuracy_decimals: 1
skip_updates: 1200
- id: ${location}_${device}_charging_watt_hours_total
name: $locationName $deviceName Total Charged Power
platform: modbus_controller
modbus_controller_id: renogy
address: 0x011C
unit_of_measurement: WH
register_type: holding
register_count: 2
value_type: U_DWORD
accuracy_decimals: 1
skip_updates: 1200
filters:
- multiply: 10
- id: ${location}_${device}_discharging_watt_hours_total
name: $locationName $deviceName Total Discharged Power
platform: modbus_controller
modbus_controller_id: renogy
address: 0x011E
unit_of_measurement: WH
register_type: holding
register_count: 2
value_type: U_DWORD
accuracy_decimals: 1
skip_updates: 1200
filters:
- multiply: 10
#endregion
switch:
- id: ${location}_${device}_light
name: $locationName $deviceName Light
platform: modbus_controller
modbus_controller_id: renogy
address: 0x010A
register_type: holding
bitmask: 1
text_sensor:
- id: ${location}_${device}_charging_state
name: $locationName $deviceName Charging State
platform: template
icon: mdi:battery-charging
lambda: |-
auto current_state = (int)id(charging_state).state;
if (current_state == 0) return {"Not Charging"};
if (current_state == 1) return {"Charging"};
if (current_state == 2) return {"Power Point Tracking"};
if (current_state == 3) return {"Equalizing"};
if (current_state == 4) return {"Boosting"};
if (current_state == 5) return {"Floating"};
if (current_state == 6) return {"Overpower"};
return {"Unknown"};
- id: ${location}_${device}_error_state
name: $locationName $deviceName Error State
entity_category: diagnostic
platform: template
icon: mdi:alert
lambda: |-
auto current_state = (int)id(error_state).state;
if (current_state == 0) return {"Normal"};
if (current_state == 1) return {"Battery Over-Discharge"};
if (current_state == 2) return {"Battery Over-Voltage"};
if (current_state == 4) return {"Battery Under-Voltage"};
if (current_state == 8) return {"Load Short Circuit"};
if (current_state == 16) return {"Load Over-Power/Over-Current"};
if (current_state == 32) return {"Controller Over-Temperature"};
if (current_state == 64) return {"Ambient Over-Temperature"};
if (current_state == 128) return {"Solar Over-Power"};
if (current_state == 256) return {"Solar Short Circuit"};
if (current_state == 512) return {"Solar Over-Voltage"};
if (current_state == 1024) return {"Solar Counter Current"};
if (current_state == 2048) return {"Solar Working Point Over-Voltage"};
if (current_state == 4096) return {"Solar Reverse Connection"};
if (current_state == 8192) return {"Anti-Reverse MOS Short Circuit"};
if (current_state == 16384) return {"Charge MOS Short Circuit"};
return {"Unknown"};