-
Notifications
You must be signed in to change notification settings - Fork 156
Expand file tree
/
Copy pathmodbus_sungrow_multiple_inverters_2.yaml
More file actions
2398 lines (2228 loc) · 91.8 KB
/
Copy pathmodbus_sungrow_multiple_inverters_2.yaml
File metadata and controls
2398 lines (2228 loc) · 91.8 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
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
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# WARNING: Automatically generated file! Do not modify in the repository.
# Release date 2026-06-19
#
# INSTALLATION GUIDE: https://github.com/mkaiser/Sungrow-SHx-Inverter-Modbus-Home-Assistant/blob/main/doc/installation.md
#
# MIGRATING GUIDE from version earlier than 2026 of modbus_sungrow.yaml to this version.
# see https://github.com/mkaiser/Sungrow-SHx-Inverter-Modbus-Home-Assistant/blob/main/doc/migration_guide.md
modbus:
- name: &sg_hub_name SungrowSHx_inv2
type: tcp
host: !secret sungrow_modbus_host_ip_inv_2
port: !secret sungrow_modbus_port_inv_2
delay: 15 # delay 5 second after connecting
timeout: 30 # timeout while waiting for a response before flodding the log with errors
message_wait_milliseconds: !secret sungrow_modbus_wait_milliseconds_inv_2 # delay between messages, depending on inverter connection
sensors:
- name: Sungrow Version 1 inv 2
# first part of firmware string
# SAPPHIRE-H_01011.95.12SAPPHIRE-H_03011.95.12SUBCTL-S_04011.01.01
# --> SAPPHIRE-H_01011.95.12
unique_id: sg_version_1_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 2581 # reg 2582
input_type: input
data_type: string
count: 11
scan_interval: &scan_interval_slowest 600
- name: Sungrow Version 2 inv 2
# second part of firmware string
# SAPPHIRE-H_01011.95.12SAPPHIRE-H_03011.95.12SUBCTL-S_04011.01.01
# --> SAPPHIRE-H_03011.95.12
unique_id: sg_version_2_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 2596
input_type: input
data_type: string
count: 11
scan_interval: *scan_interval_slowest
- name: Sungrow Version 3 inv 2
# third part of firmware string
# SAPPHIRE-H_01011.95.12SAPPHIRE-H_03011.95.12SUBCTL-S_04011.01.01
# --> SUBCTL-S_04011.01.01
unique_id: sg_version_3_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 2612
input_type: input
data_type: string
count: 11
scan_interval: *scan_interval_slowest
- name: Sungrow Version 4 (Sungrow Battery) inv 2
# TODO: cannot test, have no sungrow battery
# fourth part of firmware string (only for sungrow batteries)
# SAPPHIRE-H_01011.95.12SAPPHIRE-H_03011.95.12SUBCTL-S_04011.01.01 - XXXX
# --> XXXX
unique_id: sg_version_4_battery_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 2628
input_type: input
data_type: string
count: 11
scan_interval: *scan_interval_slowest
- name: Sungrow Protocol Version inv 2
unique_id: sg_protocol_version_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 4951 # reg 5952-4953
input_type: input
data_type: uint32
swap: word
scan_interval: *scan_interval_slowest
- name: Sungrow Arm Software inv 2
unique_id: sg_arm_software_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 4953 # reg 4954-4968, 15 registers
input_type: input
data_type: string
count: 15
scan_interval: *scan_interval_slowest
- name: Sungrow DSP Software inv 2
unique_id: sg_dsp_software_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 4968 # reg 4969-4983, 15 registers
input_type: input
data_type: string
count: 15
scan_interval: *scan_interval_slowest
- name: Sungrow inverter serial inv 2
unique_id: sg_inverter_serial_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 4989 # reg 4990- 4999, 10 registers
input_type: input
data_type: string
count: 10
scan_interval: *scan_interval_slowest
# for Sungrow batteries only
# - name: Sungrow battery serial
# unique_id: sg_battery_serial
# device_address: !secret sungrow_modbus_sbr_device_address_inv_2
# address: 10710 # reg 10711
# input_type: input
# data_type: string
# count: 10
# scan_interval: 86400
- name: Sungrow device type code inv 2
unique_id: sg_dev_code_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 4999 # reg 5000
input_type: input
data_type: uint16
scan_interval: *scan_interval_slowest
- name: Inverter rated output inv 2
unique_id: sg_inverter_rated_output_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 5000 # reg 5001
input_type: input
data_type: uint16
unit_of_measurement: "W"
device_class: power
state_class: measurement
scale: 100
scan_interval: *scan_interval_slowest
- name: Daily PV generation & battery discharge inv 2
unique_id: sg_daily_pv_gen_battery_discharge_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 5002 # reg 5003
input_type: input
data_type: uint16
precision: 1
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
scale: 0.1
scan_interval: *scan_interval_slowest
- name: Total PV generation & battery discharge inv 2
unique_id: sg_total_pv_gen_battery_discharge_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 5003 # reg 5004
input_type: input
data_type: uint32
swap: word
unit_of_measurement: kWh
precision: 1
device_class: energy
state_class: total
scale: 0.1
scan_interval: *scan_interval_slowest
- name: Inverter temperature inv 2
unique_id: sg_inverter_temperature_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 5007 # reg 5008
input_type: input
data_type: int16
precision: 1
unit_of_measurement: °C
device_class: temperature
state_class: measurement
scale: 0.1
scan_interval: &scan_interval_medium 60
- name: MPPT1 voltage inv 2
unique_id: sg_mppt1_voltage_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 5010 # reg 5011
input_type: input
data_type: uint16
precision: 1
unit_of_measurement: V
device_class: voltage
state_class: measurement
scale: 0.1
scan_interval: &scan_interval_fast 10
- name: MPPT1 current inv 2
unique_id: sg_mppt1_current_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 5011 # reg 5012
input_type: input
data_type: uint16
precision: 1
unit_of_measurement: A
device_class: current
state_class: measurement
scale: 0.1
scan_interval: *scan_interval_fast
- name: MPPT2 voltage inv 2
unique_id: sg_mppt2_voltage_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 5012 # reg 5013
input_type: input
data_type: uint16
precision: 1
unit_of_measurement: V
device_class: voltage
state_class: measurement
scale: 0.1
scan_interval: *scan_interval_fast
- name: MPPT2 current inv 2
unique_id: sg_mppt2_current_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 5013 # reg 5014
input_type: input
data_type: uint16
precision: 1
unit_of_measurement: A
device_class: current
state_class: measurement
scale: 0.1
scan_interval: *scan_interval_fast
# only for SH*T inverters with 3 MPPTs
# NOTE that mppt3 registers read on a SH10RT as 0xFFFF
# Therefore adding the nan_value here. This causes HA to render the sensor as 'unavailable' instead of '6553.5 V'
- name: MPPT3 voltage inv 2
unique_id: sg_mppt3_voltage_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 5014 # reg 5015
input_type: input
data_type: uint16
nan_value: 0xFFFF
precision: 1
unit_of_measurement: V
device_class: voltage
state_class: measurement
scale: 0.1
scan_interval: *scan_interval_fast
# only for SH*T inverters with 3 MPPTs
# NOTE that mppt3 registers read on a SH10RT as 0xFFFF
# Therefore adding the nan_value here. This causes HA to render the sensor as 'unavailable' instead of '6553.5 V'
- name: MPPT3 current inv 2
unique_id: sg_mppt3_current_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 5015 # reg 5016
input_type: input
data_type: uint16
nan_value: 0xFFFF
precision: 1
unit_of_measurement: A
device_class: current
state_class: measurement
scale: 0.1
scan_interval: *scan_interval_fast
- name: Total DC power inv 2
unique_id: sg_total_dc_power_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 5016 # reg 5017
input_type: input
data_type: uint32
swap: word
precision: 0
unit_of_measurement: W
device_class: power
state_class: measurement
scale: 1
scan_interval: *scan_interval_fast
- name: Phase A voltage inv 2
unique_id: sg_phase_a_voltage_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 5018 # reg: 5019
input_type: input
data_type: uint16
precision: 1
unit_of_measurement: V
device_class: voltage
state_class: measurement
scale: 0.1
scan_interval: *scan_interval_fast
- name: Phase B voltage inv 2
unique_id: sg_phase_b_voltage_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 5019 # reg: 5020
input_type: input
data_type: uint16
precision: 1
unit_of_measurement: V
device_class: voltage
state_class: measurement
scale: 0.1
scan_interval: *scan_interval_fast
- name: Phase C voltage inv 2
unique_id: sg_phase_c_voltage_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 5020 # reg: 5021
input_type: input
data_type: uint16
precision: 1
unit_of_measurement: V
device_class: voltage
state_class: measurement
scale: 0.1
scan_interval: *scan_interval_fast
- name: Reactive power inv 2
unique_id: sg_reactive_power_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 5032 # reg 5033
input_type: input
data_type: int32
swap: word
precision: 0
unit_of_measurement: W
device_class: power
state_class: measurement
scale: 1
scan_interval: *scan_interval_fast
- name: Power factor inv 2
unique_id: sg_power_factor_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 5034 # reg 5035
input_type: input
data_type: int16
precision: 3
state_class: measurement
scale: 0.001
scan_interval: *scan_interval_fast
# only for inverters with 4 MPPTs (SH8|10RS)
# NOTE that mppt4 registers read on a SH10RT as 0xFFFF, using nan_value to render the value unavailable
- name: MPPT4 voltage inv 2
unique_id: sg_mppt4_voltage_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 5114 # reg 5115
input_type: input
data_type: uint16
nan_value: 0xFFFF
precision: 1
unit_of_measurement: V
device_class: voltage
state_class: measurement
scale: 0.1
scan_interval: *scan_interval_fast
# only for inverters with 4 MPPTs (SH8|10RS)
# NOTE that mppt4 registers read on a SH10RT as 0xFFFF, using nan_value to render the value unavailable
- name: MPPT4 current inv 2
unique_id: sg_mppt4_current_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 5115 # reg 5116
input_type: input
data_type: uint16
nan_value: 0xFFFF
precision: 1
unit_of_measurement: A
device_class: current
state_class: measurement
scale: 0.1
scan_interval: *scan_interval_fast
# NOTE: In datasheet (1.1.11) it is recommended to use this register instead of 13022
# negative: Battery charging
# positive: Battery discharging
- name: Battery power inv 2
unique_id: sg_battery_power_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 5213 # reg 5214-5215
input_type: input
data_type: int32
swap: word
precision: 0
unit_of_measurement: W
device_class: power
state_class: measurement
scale: 1
scan_interval: *scan_interval_fast
- name: Grid frequency inv 2
unique_id: sg_grid_frequency_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 5241 # reg 5242
input_type: input
data_type: uint16
precision: 2
unit_of_measurement: "Hz"
device_class: frequency
state_class: measurement
scale: 0.01
scan_interval: *scan_interval_fast
# modbus spec: Only valid when the inverter is directly connected to the smart energy meter. (See note 1);
# > 0 buy from grid; < 0 sell to grid;
- name: Meter active power inv 2
unique_id: sg_meter_active_power_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 5600 # reg 5601
input_type: input
data_type: int32
swap: word
nan_value: 0x7FFFFFFF
precision: 0
unit_of_measurement: W
device_class: power
state_class: measurement
scale: 1
scan_interval: *scan_interval_fast
# modbus spec: Only valid when the inverter is directly connected to the smart energy meter. (See note 1);
# > 0 buy from grid; < 0 sell to grid;
- name: Meter phase A active power inv 2
unique_id: sg_meter_phase_a_active_power_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 5602 # reg 5603
input_type: input
data_type: int32
swap: word
nan_value: 0x7FFFFFFF
precision: 0
unit_of_measurement: W
device_class: power
state_class: measurement
scale: 1
scan_interval: *scan_interval_fast
# modbus spec: Only valid when the inverter is directly connected to the smart energy meter. (See note 1);
# > 0 buy from grid; < 0 sell to grid;
- name: Meter phase B active power inv 2
unique_id: sg_meter_phase_b_active_power_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 5604 # reg 5605
input_type: input
data_type: int32
swap: word
nan_value: 0x7FFFFFFF
precision: 0
unit_of_measurement: W
device_class: power
state_class: measurement
scale: 1
scan_interval: *scan_interval_fast
# modbus spec: Only valid when the inverter is directly connected to the smart energy meter. (See note 1);
# > 0 buy from grid; < 0 sell to grid;
- name: Meter phase C active power inv 2
unique_id: sg_meter_phase_c_active_power_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 5606 # reg 5607
input_type: input
data_type: int32
swap: word
nan_value: 0x7FFFFFFF
precision: 0
unit_of_measurement: W
device_class: power
state_class: measurement
scale: 1
scan_interval: *scan_interval_fast
# in the documentation this is called "Min. Feed-in Power Limitation Value"
- name: Export power limit min inv 2
unique_id: sg_export_power_limit_min_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 5621 # reg 5622
input_type: input
data_type: uint16
nan_value: 0xFFFF
unit_of_measurement: "W"
device_class: power
state_class: measurement
scale: 10
scan_interval: *scan_interval_slowest
# in the documentation this is called "Max. Feed-in Power Limitation Value"
- name: Export power limit max inv 2
unique_id: sg_export_power_limit_max_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 5622 # reg 5623
input_type: input
data_type: uint16
nan_value: 0xFFFF
unit_of_measurement: "W"
device_class: power
state_class: measurement
scale: 10
scan_interval: *scan_interval_slowest
- name: BDC rated power inv 2
unique_id: sg_bdc_rated_power_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 5627 # reg 5628
input_type: input
data_type: uint16
unit_of_measurement: "W"
device_class: power
state_class: measurement
scale: 100
scan_interval: *scan_interval_slowest
# NOTE: In datasheet (1.1.11) it is recommended to use Battery current register 5631 instead of 13021
- name: Battery current inv 2
unique_id: sg_battery_current_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 5630 # reg 5631
input_type: input
data_type: int16
precision: 1
unit_of_measurement: A
state_class: measurement
device_class: current
scale: 0.1
scan_interval: *scan_interval_fast
- name: BMS max. charging current inv 2
unique_id: sg_bms_max_charging_current_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 5634 # reg 5635
input_type: input
data_type: uint16
precision: 0
unit_of_measurement: A
device_class: current
state_class: measurement
scale: 1
scan_interval: *scan_interval_slowest
- name: BMS max. discharging current inv 2
unique_id: sg_bms_max_discharging_current_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 5635 # reg 5636
input_type: input
data_type: uint16
precision: 0
unit_of_measurement: A
device_class: current
state_class: measurement
scale: 1
scan_interval: *scan_interval_slowest
- name: Battery capacity high precision inv 2 # as in TI_20240924_Communication Protocol of Residential Hybrid Inverter-V1.1.5
unique_id: uid_battery_capacity_high_precision_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 5638 # reg 5639
input_type: input
data_type: uint16
precision: 2
unit_of_measurement: kWh
device_class: energy_storage
scale: 0.01
scan_interval: *scan_interval_slowest
- name: Backup phase A power inv 2
unique_id: sg_backup_phase_a_power_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 5722 # reg 5723
input_type: input
data_type: int16
precision: 0
unit_of_measurement: W
device_class: power
state_class: measurement
scale: 1
scan_interval: *scan_interval_fast
- name: Backup phase B power inv 2
unique_id: sg_backup_phase_b_power_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 5723 # reg 5724
input_type: input
data_type: int16
precision: 0
unit_of_measurement: W
device_class: power
state_class: measurement
scale: 1
scan_interval: *scan_interval_fast
- name: Backup phase C power inv 2
unique_id: sg_backup_phase_c_power_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 5724 # reg 5725
input_type: input
data_type: int16
precision: 0
unit_of_measurement: W
device_class: power
state_class: measurement
scale: 1
scan_interval: *scan_interval_fast
- name: Total backup power inv 2
device_address: !secret sungrow_modbus_device_address_inv_2
unique_id: sg_total_backup_power_inv_2
address: 5725 # reg 5726
input_type: input
data_type: int32
swap: word
precision: 0
unit_of_measurement: W
device_class: power
state_class: measurement
scale: 1
scan_interval: *scan_interval_fast
# https://www.photovoltaikforum.com/thread/166134-daten-lesen-vom-sungrow-wechselrichtern-modbus/?postID=3324464#post3324464
- name: Meter phase A voltage inv 2
unique_id: sg_meter_phase_a_voltage_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 5740 # reg 5741
input_type: input
data_type: int16
nan_value: 0x7FFF
precision: 1
unit_of_measurement: V
device_class: voltage
state_class: measurement
scale: 0.1
scan_interval: *scan_interval_fast
- name: Meter phase B voltage inv 2
unique_id: sg_meter_phase_b_voltage_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 5741 # reg 5742
input_type: input
data_type: int16
nan_value: 0x7FFF
precision: 1
unit_of_measurement: V
device_class: voltage
state_class: measurement
scale: 0.1
scan_interval: *scan_interval_fast
- name: Meter phase C voltage inv 2
unique_id: sg_meter_phase_c_voltage_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 5742 # reg 5743
input_type: input
data_type: int16
nan_value: 0x7FFF
precision: 1
unit_of_measurement: V
device_class: voltage
state_class: measurement
scale: 0.1
scan_interval: *scan_interval_fast
- name: Meter phase A current inv 2
unique_id: sg_meter_phase_a_current_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 5743 # reg 5744
input_type: input
data_type: uint16
nan_value: 0xFFFF
precision: 2
unit_of_measurement: A
device_class: current
state_class: measurement
scale: 0.01
scan_interval: *scan_interval_fast
- name: Meter phase B current inv 2
unique_id: sg_meter_phase_b_current_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 5744 # reg 5745
input_type: input
data_type: uint16
nan_value: 0xFFFF
precision: 2
unit_of_measurement: A
device_class: current
state_class: measurement
scale: 0.01
scan_interval: *scan_interval_fast
- name: Meter phase C current inv 2
unique_id: sg_meter_phase_c_current_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 5745 # reg 5746
input_type: input
data_type: uint16
nan_value: 0xFFFF
precision: 2
unit_of_measurement: A
device_class: current
state_class: measurement
scale: 0.01
scan_interval: *scan_interval_fast
# NOTE: in old modbus doc version this was called "system state"
# but has been renamed to "running state"
- name: Running state raw inv 2
unique_id: uid_sg_running_state_raw_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: &sg_reg_running_state 12999 # reg 13000
input_type: input
data_type: uint16
precision: 0
scale: 1
state_class: measurement
scan_interval: &scan_interval_realtime 5
# NOTE: In old modbus doc versions this was called "running state"
# but has been renamed to "power flow status"
# template binary sensors are used to determine their states based on this value
- name: Power Flow Status inv 2
unique_id: uid_power_flow_status_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 13000 # reg 13001
input_type: input
data_type: uint16
precision: 0
state_class: measurement
scale: 1
scan_interval: *scan_interval_realtime
- name: Daily PV generation inv 2
unique_id: sg_daily_pv_generation_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 13001 # reg 13002
input_type: input
data_type: uint16
precision: 1
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
scale: 0.1
scan_interval: *scan_interval_slowest
- name: Total PV generation inv 2
unique_id: sg_total_pv_generation_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 13002 # reg 13003
input_type: input
data_type: uint32
swap: word
precision: 1
unit_of_measurement: kWh
device_class: energy
state_class: total
scale: 0.1
scan_interval: *scan_interval_slowest
- name: Daily exported energy from PV inv 2
unique_id: sg_daily_exported_energy_from_PV_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 13004 # reg 13005
input_type: input
data_type: uint16
precision: 1
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
scale: 0.1
scan_interval: *scan_interval_slowest
- name: Total exported energy from PV inv 2
unique_id: sg_total_exported_energy_from_pv_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 13005 # reg 13006
input_type: input
data_type: uint32
swap: word
precision: 1
unit_of_measurement: kWh
device_class: energy
state_class: total
scale: 0.1
scan_interval: *scan_interval_slowest
- name: Load power inv 2
unique_id: sg_load_power_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 13007 # reg 13008
input_type: input
data_type: int32
nan_value: 0x7FFFFFFF
swap: word
precision: 0
unit_of_measurement: W
device_class: power
state_class: measurement
scale: 1
scan_interval: *scan_interval_realtime
# this value returns a positive value when exporting and a negative value when importing power
- name: Export power raw inv 2
unique_id: sg_battery_export_power_raw_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 13009 # reg 13010
input_type: input
data_type: int32
nan_value: 0x7FFFFFFF
swap: word
precision: 0
unit_of_measurement: W
device_class: power
state_class: measurement
scale: 1
scan_interval: *scan_interval_fast
- name: Daily battery charge from PV inv 2
unique_id: sg_daily_battery_charge_from_pv_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 13011 # reg 13012
input_type: input
data_type: uint16
precision: 1
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
scale: 0.1
scan_interval: *scan_interval_slowest
- name: Total battery charge from PV inv 2
unique_id: sg_total_battery_charge_from_pv_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 13012 # reg 13013
input_type: input
data_type: uint32
swap: word
precision: 1
unit_of_measurement: kWh
device_class: energy
state_class: total
scale: 0.1
scan_interval: *scan_interval_slowest
- name: Daily direct energy consumption inv 2
unique_id: sg_daily_direct_energy_consumption_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 13016 # reg 13017
input_type: input
data_type: uint16
precision: 1
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
scale: 0.1
scan_interval: *scan_interval_slowest
- name: Total direct energy consumption inv 2
unique_id: sg_total_direct_energy_consumption_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 13017 # reg 13018
input_type: input
data_type: uint32
swap: word
precision: 1
unit_of_measurement: kWh
device_class: energy
state_class: total
scale: 0.1
scan_interval: *scan_interval_slowest
- name: Battery voltage inv 2
unique_id: sg_battery_voltage_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 13019 # reg 13020
input_type: input
data_type: uint16
precision: 1
unit_of_measurement: V
device_class: voltage
state_class: measurement
scale: 0.1
scan_interval: *scan_interval_fast
# NOTE: 2025-12-12. This sensor was replaced by register 5631 as recommended in the datasheet
# datasheet states that this value is unsigned, but it is actually signed:
# https://github.com/mkaiser/Sungrow-SHx-Inverter-Modbus-Home-Assistant/issues/304
# - name: Battery current
# unique_id: sg_battery_current
# device_address: !secret sungrow_modbus_device_address_inv_2
# address: 13020 # reg 13021
# input_type: input
# data_type: int16
# precision: 1
# unit_of_measurement: A
# state_class: measurement
# device_class: current
# scale: 0.1
# scan_interval: *scan_interval_fast
# NOTE: 2025-12-12: substituted this register by reg 5214 as recommended in the datasheet
# old firmware ( before october 2024): always positive battery power
# use binary_sensor.battery_charging_inv_2 | discharging to retrieve the direction of the energy flow
# new firmware: positive if charging and negative if discharging
# with new firmware installed we could use this raw value directly as signed battery power
# to support both firmwares we use the template sensor "signed battery power"
# - name: Battery power raw
# unique_id: sg_battery_power_raw
# device_address: !secret sungrow_modbus_device_address_inv_2
# address: 13021 # reg 13022
# input_type: input
# data_type: int16 #updated to signed int, see github issue #406
# precision: 0
# unit_of_measurement: W
# device_class: power
# state_class: measurement
# scale: 1
# scan_interval: *scan_interval_fast
# 0..100% | min_soc..max_soc
- name: Battery level inv 2
unique_id: sg_battery_level_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 13022 # reg 13023
input_type: input
data_type: uint16
precision: 1
unit_of_measurement: "%"
device_class: battery
state_class: measurement
scale: 0.1
scan_interval: *scan_interval_medium
# 0..100% calculated internally by the BMS load balancing
- name: Battery state of health inv 2
unique_id: sg_battery_state_of_health_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 13023 # reg 13024
input_type: input
data_type: uint16
precision: 0
unit_of_measurement: "%"
state_class: measurement
scale: 0.1
scan_interval: *scan_interval_slowest
- name: Battery temperature inv 2
unique_id: sg_battery_temperature_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 13024 # reg 13025
input_type: input
data_type: int16
precision: 1
unit_of_measurement: °C
device_class: temperature
state_class: measurement
scale: 0.1
scan_interval: *scan_interval_medium
- name: Daily battery discharge inv 2
unique_id: sg_daily_battery_discharge_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 13025 # reg 13026
input_type: input
data_type: uint16
precision: 1
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
scale: 0.1
scan_interval: *scan_interval_slowest
- name: Total battery discharge inv 2
unique_id: sg_total_battery_discharge_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 13026 # reg 13027
input_type: input
data_type: uint32
swap: word
precision: 1
unit_of_measurement: kWh
device_class: energy
state_class: total
scale: 0.1
scan_interval: *scan_interval_slowest
- name: Phase A current inv 2
unique_id: sg_phase_a_current_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 13030 # reg 13031
input_type: input
data_type: int16
precision: 1
unit_of_measurement: A
device_class: current
state_class: measurement
scale: 0.1
scan_interval: *scan_interval_fast
- name: Phase B current inv 2
unique_id: sg_phase_b_current_inv_2
device_address: !secret sungrow_modbus_device_address_inv_2
address: 13031 # reg 13032
input_type: input
data_type: int16
precision: 1
unit_of_measurement: A
device_class: current