forked from robgt978/Easun-SMG-II-11Kw-esphome-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathesp32-easun-rs232.yaml
More file actions
1005 lines (914 loc) · 33.5 KB
/
esp32-easun-rs232.yaml
File metadata and controls
1005 lines (914 loc) · 33.5 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
substitutions:
name: esp32-easun-rs232
friendly_name: esp32-easun-rs232
device_description: "Monitor and control a ISolar/EASUN SMG II 11Kw inverter via RS232"
tx_pin: GPIO16
rx_pin: GPIO17
esphome:
name: ${name}
comment: ${device_description}
project:
name: "robgt.esphome-smg-11Kw"
version: 1.1.1
esp32:
board: esp32dev
framework:
type: arduino
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# mettere il proprio indirizzo ip
manual_ip:
static_ip: 192.168.1.143
gateway: 192.168.1.1
subnet: 255.255.255.0
dns1: 192.168.1.1
dns2: 8.8.8.8
web_server:
port: 80
logger:
level: DEBUG
# Don't write log messages to UART0 (GPIO1/GPIO3) if the inverter is connected to GPIO1/GPIO3
#baud_rate: 0
uart:
- id: uart_0
baud_rate: 9600
tx_pin: ${tx_pin}
rx_pin: ${rx_pin}
debug:
direction: BOTH
dummy_receiver: false
# If you use Home Assistant please remove this `mqtt` section and uncomment the `api` component!
# The native API has many advantages over MQTT: https://esphome.io/components/api.html#advantages-over-mqtt
#mqtt:
# broker: !secret mqtt_host
# username: !secret mqtt_username
# password: !secret mqtt_password
# id: mqtt_client
# Enable Home Assistant API
api:
encryption:
key: "YgRhs72Ilmz8m6fjzYVvVffwmabzL/3op9YsKgKYd8k="
ota:
- platform: esphome
password: "175d3c9fd8256b480532478e448cf7e4"
#captive_portal:
modbus:
- id: modbus0
uart_id: uart_0
send_wait_time: 200ms
modbus_controller:
- id: smg0
address: 0x01
modbus_id: modbus0
command_throttle: 200ms
update_interval: 10s
time:
- platform: sntp
sensor:
- platform: total_daily_energy
name: "${name} PV1 energy today"
restore: true
device_class: energy
power_id: smg0_pv1_average_power
filters:
# Multiplication factor from W to kW is 0.001
- multiply: 0.001
unit_of_measurement: kWh
- platform: total_daily_energy
name: "${name} PV2 energy today"
restore: true
device_class: energy
power_id: smg0_pv2_average_power
filters:
# Multiplication factor from W to kW is 0.001
- multiply: 0.001
unit_of_measurement: kWh
# Fault code ULong 100 2 R
- platform: modbus_controller
modbus_controller_id: smg0
name: "${name} fault code"
address: 100
register_type: holding
value_type: U_DWORD
accuracy_decimals: 0
# Warning code ULong 108 2 R
- platform: modbus_controller
modbus_controller_id: smg0
name: "${name} warning code"
address: 108
register_type: holding
value_type: U_DWORD
accuracy_decimals: 0
# Operation Mode UInt 201 1 R 0: Power On
# 1: Standby
# 2: Mains
# 3: Off-Grid
# 4: Bypass
# 5: Charging
# 6: Fault
- platform: modbus_controller
modbus_controller_id: smg0
name: "${name} operation mode id"
address: 201
register_type: holding
value_type: U_WORD
accuracy_decimals: 0
# Effective mains voltage 0.1V Int 338 1 R
- platform: modbus_controller
modbus_controller_id: smg0
name: "${name} ac mains voltage"
address: 338
register_type: holding
value_type: S_WORD
unit_of_measurement: "V"
device_class: voltage
state_class: measurement
accuracy_decimals: 1
filters:
- multiply: 0.1
# Mains Frequency 0.01Hz Int 203 1 R
- platform: modbus_controller
modbus_controller_id: smg0
name: "${name} ac mains frequency"
address: 203
register_type: holding
value_type: S_WORD
unit_of_measurement: "Hz"
device_class: frequency
state_class: measurement
accuracy_decimals: 2
filters:
- multiply: 0.01
# Average mains power 1W Int 340 1 R
- platform: modbus_controller
modbus_controller_id: smg0
name: "${name} average mains power"
address: 340
register_type: holding
value_type: S_WORD
unit_of_measurement: "W"
device_class: power
state_class: measurement
accuracy_decimals: 0
# Output effective voltage 0.1V Int 606 1 R
- platform: modbus_controller
modbus_controller_id: smg0
name: "${name} output effective voltage"
address: 606
register_type: holding
value_type: S_WORD
unit_of_measurement: "V"
device_class: voltage
state_class: measurement
accuracy_decimals: 1
filters:
- multiply: 0.1
# Output effective Current 0.1A Int 605 1 R
- platform: modbus_controller
modbus_controller_id: smg0
name: "${name} output effective Current"
address: 605
register_type: holding
value_type: S_WORD
unit_of_measurement: "A"
device_class: current
state_class: measurement
accuracy_decimals: 1
filters:
- multiply: 0.1
# Output frequency 0.01Hz Int 607 1 R
- platform: modbus_controller
modbus_controller_id: smg0
name: "${name} output frequency"
address: 607
register_type: holding
value_type: S_WORD
unit_of_measurement: "Hz"
device_class: frequency
state_class: measurement
accuracy_decimals: 2
filters:
- multiply: 0.01
# Output active power 1W Int 254 1 R
- platform: modbus_controller
modbus_controller_id: smg0
name: "${name} output active power"
address: 254
register_type: holding
value_type: S_WORD
unit_of_measurement: "W"
device_class: power
state_class: measurement
accuracy_decimals: 0
# Output apparent power 1VA Int 255 1 R
- platform: modbus_controller
modbus_controller_id: smg0
name: "${name} output apparent power"
address: 255
register_type: holding
value_type: S_WORD
unit_of_measurement: "VA"
device_class: apparent_power
state_class: measurement
accuracy_decimals: 0
# Battery average voltage 0.1V Int 277 1 R
- platform: modbus_controller
modbus_controller_id: smg0
name: "${name} battery average voltage"
address: 277
register_type: holding
value_type: S_WORD
unit_of_measurement: "V"
device_class: voltage
state_class: measurement
accuracy_decimals: 1
filters:
- multiply: 0.1
# Battery average Current 0.1A Int 278 1 R
- platform: modbus_controller
modbus_controller_id: smg0
name: "${name} battery average Current"
address: 278
register_type: holding
value_type: S_WORD
unit_of_measurement: "A"
device_class: current
state_class: measurement
accuracy_decimals: 1
filters:
- multiply: 0.1
# Battery average power 1W Int 279 1 R
- platform: modbus_controller
modbus_controller_id: smg0
name: "${name} battery average power"
address: 279
register_type: holding
value_type: S_WORD
unit_of_measurement: "W"
device_class: power
state_class: measurement
accuracy_decimals: 0
# Battery state of charge 1% UInt 280 1 R
- platform: modbus_controller
modbus_controller_id: smg0
name: "${name} battery state of charge"
address: 280
register_type: holding
value_type: U_WORD
unit_of_measurement: "%"
device_class: battery
state_class: measurement
accuracy_decimals: 0
# PV1 average voltage 0.1V Int 351 1 R
- platform: modbus_controller
modbus_controller_id: smg0
name: "${name} pv1 average voltage"
address: 351
register_type: holding
value_type: S_WORD
unit_of_measurement: "V"
device_class: voltage
state_class: measurement
accuracy_decimals: 1
filters:
- multiply: 0.1
# PV2 average voltage 0.1V Int 389 1 R
- platform: modbus_controller
modbus_controller_id: smg0
name: "${name} pv2 average voltage"
address: 389
register_type: holding
value_type: S_WORD
unit_of_measurement: "V"
device_class: voltage
state_class: measurement
accuracy_decimals: 1
filters:
- multiply: 0.1
# PV1 average current 0.1A Int 352 1 R
- platform: modbus_controller
modbus_controller_id: smg0
name: "${name} pv1 average current"
address: 352
register_type: holding
value_type: S_WORD
unit_of_measurement: "A"
device_class: current
state_class: measurement
accuracy_decimals: 1
filters:
- multiply: 0.1
# PV2 average current 0.1A Int 390 1 R
- platform: modbus_controller
modbus_controller_id: smg0
name: "${name} pv2 average current"
address: 390
register_type: holding
value_type: S_WORD
unit_of_measurement: "A"
device_class: current
state_class: measurement
accuracy_decimals: 1
filters:
- multiply: 0.1
# PV1 average power 1W Int 353 1 R
- platform: modbus_controller
modbus_controller_id: smg0
id: smg0_pv1_average_power
name: "${name} pv1 average power"
address: 353
register_type: holding
value_type: S_WORD
unit_of_measurement: "W"
device_class: power
state_class: measurement
accuracy_decimals: 0
# PV2 average power 1W Int 391 1 R
- platform: modbus_controller
modbus_controller_id: smg0
id: smg0_pv2_average_power
name: "${name} pv2 average power"
address: 391
register_type: holding
value_type: S_WORD
unit_of_measurement: "W"
device_class: power
state_class: measurement
accuracy_decimals: 0
# PV1-2 average power 1W Int 223 1 R
- platform: modbus_controller
modbus_controller_id: smg0
id: smg0_pv1_2_average_power
name: "${name} pv1-2 average power"
address: 302
register_type: holding
value_type: S_WORD
unit_of_measurement: "W"
device_class: power
state_class: measurement
accuracy_decimals: 0
# PV1-2 charging average power 1W Int 303 1 R
- platform: modbus_controller
modbus_controller_id: smg0
name: "${name} pv1-2 charging average power"
address: 303
register_type: holding
value_type: S_WORD
unit_of_measurement: "W"
device_class: power
state_class: measurement
accuracy_decimals: 0
# Load percentage 1% Int 225 1 R
- platform: modbus_controller
modbus_controller_id: smg0
name: "${name} load percentage"
address: 256
register_type: holding
value_type: S_WORD
unit_of_measurement: "%"
# device_class: battery
state_class: measurement
accuracy_decimals: 0
# DCDC Temperature 1°C Int 281 1 R
- platform: modbus_controller
modbus_controller_id: smg0
name: "${name} dcdc temperature"
address: 281
register_type: holding
value_type: S_WORD
unit_of_measurement: "°C"
device_class: temperature
state_class: measurement
accuracy_decimals: 0
# Inverter Temperature 1°C Int 231 1 R
- platform: modbus_controller
modbus_controller_id: smg0
name: "${name} inverter temperature"
address: 231
register_type: holding
value_type: S_WORD
unit_of_measurement: "°C"
device_class: temperature
state_class: measurement
accuracy_decimals: 0
# Produzione DAY 1W Int 702 1 R
- platform: modbus_controller
modbus_controller_id: smg0
id: smg0_power_day
name: "${name} produzione day"
address: 702
register_type: holding
value_type: S_WORD
unit_of_measurement: "W"
device_class: power
state_class: measurement
accuracy_decimals: 1
filters:
- multiply: 10.0
# # Output voltage 0.1V Uint 320 1 R/W
# - platform: modbus_controller
# modbus_controller_id: smg0
# name: "${name} output voltage"
# address: 320
# register_type: holding
# value_type: U_WORD
# unit_of_measurement: "V"
# device_class: voltage
# # state_class: measurement
# accuracy_decimals: 1
# filters:
# - multiply: 0.1
# # Output frequency setting 0.01Hz Uint 321 1 R/W
# - platform: modbus_controller
# modbus_controller_id: smg0
# name: "${name} output frequency setting"
# address: 321
# register_type: holding
# value_type: U_WORD
# unit_of_measurement: "Hz"
# device_class: frequency
# # state_class: measurement
# accuracy_decimals: 2
# filters:
# - multiply: 0.01
# # Eq Charging voltage 0.1V Uint 334 1 R/W
# - platform: modbus_controller
# modbus_controller_id: smg0
# name: "${name} Eq Charging voltage"
# address: 334
# register_type: holding
# value_type: U_WORD
# unit_of_measurement: "V"
# device_class: voltage
# # state_class: measurement
# accuracy_decimals: 1
# filters:
# - multiply: 0.1
# Rated power W Uint 691 1 R
- platform: modbus_controller
modbus_controller_id: smg0
name: "${name} rated power"
address: 691
register_type: holding
value_type: U_WORD
unit_of_measurement: "W"
device_class: power
# state_class: measurement
accuracy_decimals: 0
select:
# Output priority Uint 601 1 R/W 0: Utility-PV-Battery, 1: PV-Utility-Battery, 2: PV-Battery-Utility
- platform: modbus_controller
modbus_controller_id: smg0
name: "${name} output priority"
use_write_multiple: true
address: 601
value_type: U_WORD
optionsmap:
"PV-Utility-Battery (SUB)": 1
"PV-Battery-Utility (SBU)": 2
"PV-Utility-Battery (SUF)": 3
# Input voltage range Uint 302 1 R/W 0: Wide range, 1: Narrow range
# - platform: modbus_controller
# modbus_controller_id: smg0
# name: "${name} input voltage range"
# use_write_multiple: true
# address: 302
# value_type: U_WORD
# optionsmap:
# "Wide range": 0
# "Narrow range": 1
# Buzzer mode Uint 303 1 R/W 0: Mute in all situations, 1: Sound when the input source is changed or there is a specific warning or fault, 2: Sound when there is aspecific warning or fault, 3: Sound when fault occurs
# - platform: modbus_controller
# modbus_controller_id: smg0
# name: "${name} buzzer mode"
# use_write_multiple: true
# address: 303
# value_type: U_WORD
# optionsmap:
# "Silent": 0
# "Beep on input source changes, warnings and faults": 1
# "Beep on warnings and faults": 2
# "Beep on faults": 3
# LCD backlight Uint 305 1 R/W 0: Timed off, 1: Always on
# - platform: modbus_controller
# modbus_controller_id: smg0
# name: "${name} lcd backlight"
# use_write_multiple: true
# address: 305
# value_type: U_WORD
# optionsmap:
# "Timed off": 0
# "Always on": 1
# Battery charging priority Uint 331 1 R/W 0: Utility priority, 1: PV priority, 2: PV is at the same level as the Utility, 3: Only PV charging is allowed
- platform: modbus_controller
modbus_controller_id: smg0
name: "${name} battery charging priority"
use_write_multiple: true
address: 632
value_type: U_WORD
optionsmap:
"SOF": 1
"SNU": 2
"OSO": 3
"SOT": 4
# Turn on mode Uint 693 1 R/W 0: Can be turn-on locally or remotely, 1: Only local turn-on, 2: Only remote turn-on
- platform: modbus_controller
modbus_controller_id: smg0
name: "${name} turn on mode"
use_write_multiple: true
address: 693
value_type: U_WORD
optionsmap:
"Local and remotely turn-on allowed": 0
"Local turn-on only": 1
"Remote turn-on only": 2
switch:
# Neutral to ground Uint 707 1 R/W 0: neutral to ground is off, 1: neutral to ground is on
- platform: modbus_controller
modbus_controller_id: smg0
name: "${name} neutral to ground"
use_write_multiple: true
address: 707
register_type: holding
bitmask: 1
# LCD automatically returns to the homepage Uint 306 1 R/W 0: Do not return automatically, 1: Automatically return after 1 minute
#- platform: modbus_controller
# modbus_controller_id: smg0
# name: "${name} lcd automatically returns to the homepage"
# use_write_multiple: true
# address: 306
# register_type: holding
# bitmask: 1
# Energy-saving mode Uint 307 1 R/W 0: Energy-saving mode is off, 1: Energy-saving mode is on
#- platform: modbus_controller
# modbus_controller_id: smg0
# name: "${name} energy-saving mode"
# use_write_multiple: true
# address: 307
# register_type: holding
# bitmask: 1
# Overload automatic restart Uint 308 1 R/W 0: Overload failure will not restart, 1: Automatic restart after overload failure
#- platform: modbus_controller
# modbus_controller_id: smg0
# name: "${name} overload automatic restart"
# use_write_multiple: true
# address: 308
# register_type: holding
# bitmask: 1
# Over temperature automatic restart Uint 309 1 R/W 0: Over temperature failure will not restart, 1: Automatic restart after over-temperature fault
# - platform: modbus_controller
# modbus_controller_id: smg0
# name: "${name} over temperature automatic restart"
# use_write_multiple: true
# address: 309
# register_type: holding
# bitmask: 1
# Overload transfer to bypass enabled Uint 310 1 R/W 0: Disable, 1: Enable
# - platform: modbus_controller
# modbus_controller_id: smg0
# name: "${name} overload transfer to bypass enabled"
# use_write_multiple: true
# address: 310
# register_type: holding
# bitmask: 1
# Battery Eq mode is enabled Uint 313 1 R/W 0: Disable, 1: Enable
# - platform: modbus_controller
# modbus_controller_id: smg0
# name: "${name} battery Eq mode is enabled"
# use_write_multiple: true
# address: 313
# register_type: holding
# bitmask: 1
# Remote switch Uint 694 1 R/W 0: Remote shutdown, 1: Remote turn-on
- platform: modbus_controller
modbus_controller_id: smg0
name: "${name} remote switch"
use_write_multiple: true
address: 694
register_type: holding
bitmask: 1
text_sensor:
# Fault code ULong 100 2 R
- platform: modbus_controller
modbus_controller_id: smg0
name: "${name} fault"
address: 100
register_type: holding
register_count: 2
response_size: 4
raw_encode: HEXBYTES
lambda: |-
static const uint8_t FAULTS_SIZE = 27;
static const char *const FAULTS[FAULTS_SIZE] = {
"Over temperature of inverter module", // 0000 0000 0000 0000 0000 0000 0000 0001 (1)
"Over temperature of DCDC module", // 0000 0000 0000 0000 0000 0000 0000 0010 (2)
"Battery over voltage", // 0000 0000 0000 0000 0000 0000 0000 0100 (3)
"PV module over temperature", // 0000 0000 0000 0000 0000 0000 0000 1000 (4)
"Output short circuit", // 0000 0000 0000 0000 0000 0000 0001 0000 (5)
"Inverter over voltage", // 0000 0000 0000 0000 0000 0000 0010 0000 (6)
"Output over load", // 0000 0000 0000 0000 0000 0000 0100 0000 (7)
"Bus over voltage", // 0000 0000 0000 0000 0000 0000 1000 0000 (8)
"Bus soft start timed out", // 0000 0000 0000 0000 0000 0001 0000 0000 (9)
"PV over current", // 0000 0000 0000 0000 0000 0010 0000 0000 (10)
"PV over voltage", // 0000 0000 0000 0000 0000 0100 0000 0000 (11)
"Battery over current", // 0000 0000 0000 0000 0000 1000 0000 0000 (12)
"Inverter over current", // 0000 0000 0000 0000 0001 0000 0000 0000 (13)
"Bus low voltage", // 0000 0000 0000 0000 0010 0000 0000 0000 (14)
"Reserve (Bit 15)", // 0000 0000 0000 0000 0100 0000 0000 0000 (15)
"Inverter DC component is too high", // 0000 0000 0000 0000 1000 0000 0000 0000 (16)
"Reserve (Bit 17)", // 0000 0000 0000 0001 0000 0000 0000 0000 (17)
"The zero bias of output current is too large", // 0000 0000 0000 0010 0000 0000 0000 0000 (18)
"The zero bias of inverter current is too large", // 0000 0000 0000 0100 0000 0000 0000 0000 (19)
"The zero bias of battery current is too large", // 0000 0000 0000 1000 0000 0000 0000 0000 (20)
"The zero bias of PV current is too large", // 0000 0000 0001 0000 0000 0000 0000 0000 (21)
"Inverter low voltage", // 0000 0000 0010 0000 0000 0000 0000 0000 (22)
"Inverter negative power protection", // 0000 0000 0100 0000 0000 0000 0000 0000 (23)
"The host in the parallel system is lost", // 0000 0000 1000 0000 0000 0000 0000 0000 (24)
"Synchronization signal abnormal in the parallel system", // 0000 0001 0000 0000 0000 0000 0000 0000 (25)
"The battery type is incompatible", // 0000 0010 0000 0000 0000 0000 0000 0000 (26)
"Parallel versions are incompatible", // 0000 0100 0000 0000 0000 0000 0000 0000 (27)
};
std::string values = "";
uint32_t mask = modbus_controller::dword_from_hex_str(x, 0);
if (mask) {
for (int i = 0; i < FAULTS_SIZE; i++) {
if (mask & (1 << i)) {
values.append(FAULTS[i]);
values.append(";");
}
}
if (!values.empty()) {
values.pop_back();
}
}
return values;
# Warning code ULong 108 2 R
- platform: modbus_controller
modbus_controller_id: smg0
name: "${name} warning"
address: 108
register_type: holding
register_count: 2
response_size: 4
raw_encode: HEXBYTES
lambda: |-
static const uint8_t WARNINGS_SIZE = 19;
static const char *const WARNINGS[WARNINGS_SIZE] = {
"Reserve (Bit 0)", // 0000 0000 0000 0000 0000 0000 0000 0001 (1)
"Mains waveform abnormal", // 0000 0000 0000 0000 0000 0000 0000 0010 (2)
"Reserve (Bit 2)", // 0000 0000 0000 0000 0000 0000 0000 0100 (3)
"Mains low voltage", // 0000 0000 0000 0000 0000 0000 0000 1000 (4)
"Mains over frequency", // 0000 0000 0000 0000 0000 0000 0001 0000 (5)
"Mains low frequency", // 0000 0000 0000 0000 0000 0000 0010 0000 (6)
"PV low voltage", // 0000 0000 0000 0000 0000 0000 0100 0000 (7)
"Over temperature", // 0000 0000 0000 0000 0000 0000 1000 0000 (8)
"Battery low voltage", // 0000 0000 0000 0000 0000 0001 0000 0000 (9)
"Battery is not connected", // 0000 0000 0000 0000 0000 0010 0000 0000 (10)
"Overload", // 0000 0000 0000 0000 0000 0100 0000 0000 (11)
"Battery Eq charging", // 0000 0000 0000 0000 0000 1000 0000 0000 (12)
"Battery undervoltage", // 0000 0000 0000 0000 0001 0000 0000 0000 (13)
"Output power derating", // 0000 0000 0000 0000 0010 0000 0000 0000 (14)
"Fan blocked", // 0000 0000 0000 0000 0100 0000 0000 0000 (15)
"PV energy is too low to be use", // 0000 0000 0000 0000 1000 0000 0000 0000 (16)
"Parallel communication interrupted", // 0000 0000 0000 0001 0000 0000 0000 0000 (17)
"Output mode of Single and Parallel systems inconsistent", // 0000 0000 0000 0010 0000 0000 0000 0000 (18)
"Battery voltage difference of parallel system is too large", // 0000 0000 0000 0100 0000 0000 0000 0000 (19)
};
std::string values = "";
uint32_t mask = modbus_controller::dword_from_hex_str(x, 0);
if (mask) {
for (int i = 0; i < WARNINGS_SIZE; i++) {
if (mask & (1 << i)) {
values.append(WARNINGS[i]);
values.append(";");
}
}
if (!values.empty()) {
values.pop_back();
}
}
return values;
# Operation Mode UInt 201 1 R 0: Power On, 1: Standby, 2: Mains, 3: Off-Grid, 4: Bypass, 5: Charging, 6: Fault
- platform: modbus_controller
modbus_controller_id: smg0
name: "${name} operation mode"
address: 201
register_type: holding
raw_encode: HEXBYTES
lambda: |-
uint16_t value = modbus_controller::word_from_hex_str(x, 0);
switch (value) {
case 0: return std::string("Power On");
case 1: return std::string("Standby");
case 2: return std::string("Mains");
case 3: return std::string("Off-Grid");
case 4: return std::string("Bypass");
case 5: return std::string("Charging");
case 6: return std::string("Fault");
}
return std::string("Unknown");
number:
# Output voltage 0.1V Uint 320 1 R/W
# - platform: modbus_controller
# modbus_controller_id: smg0
# name: "${name} output voltage"
# use_write_multiple: true
# address: 320
# register_type: holding
# value_type: U_WORD
# min_value: 0.0
# max_value: 100.0
# step: 0.1
# unit_of_measurement: "V"
# lambda: "return x * 0.1f;"
# write_lambda: |-
# return x * 10.0f;
# Output frequency setting 0.01Hz Uint 321 1 R/W
#- platform: modbus_controller
# modbus_controller_id: smg0
# name: "${name} output frequency setting"
# use_write_multiple: true
# address: 321
# register_type: holding
# value_type: U_WORD
# min_value: 0.0
# max_value: 100.0
# step: 0.01
# unit_of_measurement: "Hz"
# lambda: "return x * 0.01f;"
# write_lambda: |-
# return x * 100.0f;
# Battery overvoltage protection point 0.1V Uint 631 1 R/W
- platform: modbus_controller
modbus_controller_id: smg0
name: "${name} battery overvoltage protection point"
use_write_multiple: true
address: 631
register_type: holding
value_type: U_WORD
min_value: 0.0
# max_value: 100.0
step: 0.1
unit_of_measurement: "V"
lambda: "return x * 0.1f;"
write_lambda: |-
return x * 10.0f;
# Max charging voltage 0.1V Uint 637 1 R/W
- platform: modbus_controller
modbus_controller_id: smg0
name: "${name} max charging voltage"
use_write_multiple: true
address: 637
register_type: holding
value_type: U_WORD
min_value: 0.0
max_value: 100.0
step: 0.1
unit_of_measurement: "V"
lambda: "return x * 0.1f;"
write_lambda: |-
return x * 10.0f;
# Floating charging voltage 0.1V Uint 638 1 R/W
- platform: modbus_controller
modbus_controller_id: smg0
name: "${name} floating charging voltage"
use_write_multiple: true
address: 638
register_type: holding
value_type: U_WORD
min_value: 0.0
# max_value: 100.0
step: 0.1
unit_of_measurement: "V"
lambda: "return x * 0.1f;"
write_lambda: |-
return x * 10.0f;
# Battery discharge recovery point in mains mode 0.1V Uint 646 1 R/W
- platform: modbus_controller
modbus_controller_id: smg0
name: "${name} battery discharge recovery point in mains mode"
use_write_multiple: true
address: 646
register_type: holding
value_type: U_WORD
min_value: 0.0
# max_value: 100.0
step: 0.1
unit_of_measurement: "V"
lambda: "return x * 0.1f;"
write_lambda: |-
return x * 10.0f;
# Battery low voltage protection point in mains mode 0.1V Uint 644 1 R/W
- platform: modbus_controller
modbus_controller_id: smg0
name: "${name} battery low voltage protection point in mains mode"
use_write_multiple: true
address: 644
register_type: holding
value_type: U_WORD
min_value: 0.0
# max_value: 100.0
step: 0.1
unit_of_measurement: "V"
lambda: "return x * 0.1f;"
write_lambda: |-
return x * 10.0f;
# Battery low voltage protection point in off-grid mode 0.1V Uint 643 1 R/W
- platform: modbus_controller
modbus_controller_id: smg0
name: "${name} battery low voltage protection point in off-grid mode"
use_write_multiple: true
address: 643
register_type: holding
value_type: U_WORD
min_value: 0.0
# max_value: 100.0
step: 0.1
unit_of_measurement: "V"
lambda: "return x * 0.1f;"
write_lambda: |-
return x * 10.0f;
# Maximum charging current 0.1A Uint 640 1 R/W
- platform: modbus_controller
modbus_controller_id: smg0
name: "${name} maximum charging current"
use_write_multiple: true
address: 640
register_type: holding
value_type: U_WORD
min_value: 0.0
max_value: 100.0
step: 0.1
unit_of_measurement: "A"
lambda: "return x * 0.1f;"
write_lambda: |-
return x * 10.0f;
# Maximum mains charging current 0.1A Uint 641 1 R/W
- platform: modbus_controller
modbus_controller_id: smg0
name: "${name} maximum mains charging current"
use_write_multiple: true
address: 641
register_type: holding
value_type: U_WORD
min_value: 0.0
max_value: 100.0
step: 0.1
unit_of_measurement: "A"
lambda: "return x * 0.1f;"
write_lambda: |-
return x * 10.0f;
# Eq Charging voltage 0.1V Uint 334 1 R/W
# - platform: modbus_controller
# modbus_controller_id: smg0
# name: "${name} Eq Charging voltage"
# use_write_multiple: true
# address: 334
# register_type: holding
# value_type: U_WORD
# min_value: 0.0
# max_value: 100.0
# step: 0.1
# unit_of_measurement: "V"
# lambda: "return x * 0.1f;"
# write_lambda: |-
# return x * 10.0f;
# Battery equalization time min Uint 335 1 R/W Range: 0~900
# - platform: modbus_controller
# modbus_controller_id: smg0
# name: "${name} battery equalization time"
# use_write_multiple: true
# address: 335
# register_type: holding
# value_type: U_WORD
# min_value: 0.0
# max_value: 900.0
# step: 1
# unit_of_measurement: "min"
# Equalization Timeout exit min Uint 336 1 R/W Range: 0~900
# - platform: modbus_controller
# modbus_controller_id: smg0
# name: "${name} equalization Timeout exit"
# use_write_multiple: true
# address: 336
# register_type: holding
# value_type: U_WORD
# min_value: 0.0
# max_value: 900.0
# step: 1
# unit_of_measurement: "min"
# Two equalization charging intervals day Uint 337 1 R/W Range: 1~90
# - platform: modbus_controller
# modbus_controller_id: smg0
# name: "${name} two equalization charging intervals"
# use_write_multiple: true
# address: 337
# register_type: holding
# value_type: U_WORD
# min_value: 0.0
# max_value: 90.0
# step: 1
# unit_of_measurement: "day"