Skip to content

Commit fe261dd

Browse files
committed
Reorganise registers into 125 blocks
The new 1.5 version of the integration uses the pysolarman library which is stricter with the protocol. In this case, we were requesting more than 125 registers at a time, so it failed on the new update. So we need to restructure the requests to only request a max of 125 registers.
1 parent b141943 commit fe261dd

File tree

1 file changed

+22
-19
lines changed

1 file changed

+22
-19
lines changed

custom_components/solarman/inverter_definitions/kstar_hybrid.yaml

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,40 @@
11
# KSTAR Hybrid Inverter
22
# Modbus information taken from "MODBUS RS485 Communication Protocol V2.5" document provided by KSTAR
33

4-
#INPUT_REGISTERS = 3000 - 3660 # 0x0BB8 - 0x0E4C
5-
#HOLDING_REGISTERS = 3200 - 3237 # 0x0C80 - 0x0C9B
4+
# This inverter exposes its data in the following registers (although not all of them are used by this definition file):
5+
#
6+
# - INPUT_REGISTERS 3000 - 3660 decimal, 0x0BB8 - 0x0E4C hexadecimal
7+
# - HOLDING_REGISTERS 3200 - 3237 decimal. 0x0C80 - 0x0C9B hexadecimal
8+
#
9+
# Each request can get a maximum of 125 registers as per modbus protocol (start and end included), so we need to
10+
# split up the list of used registers into multiple requests of maximum 125 registers each.
611

712
requests:
8-
# Input registers 3000 - 3667
13+
# Start requesting from the first needed register (3000)
914
- start: 3000
10-
end: 3125
15+
end: 3124
1116
mb_functioncode: 0x04
1217

13-
# Input registers 3200 - 3228 not read as they would clash with holding registers
18+
# Input registers 3200 - 3227 can't be read as they would clash with holding registers of same number
1419
- start: 3125
15-
end: 3200
20+
end: 3199
1621
mb_functioncode: 0x04
1722

23+
# Change to holding registers 3200 - 3237 (mb_functioncode 3) for the inverter system information.
24+
- start: 3200
25+
end: 3217
26+
mb_functioncode: 0x03
27+
28+
# Continue with the needed input registers
1829
- start: 3228
19-
end: 3250
30+
end: 3249
2031
mb_functioncode: 0x04
2132

33+
# Last input register currently used by this definition file is 3301, so we can skip the rest for now.
2234
- start: 3250
23-
end: 3375
24-
mb_functioncode: 0x04
25-
26-
- start: 3375
27-
end: 3500
35+
end: 3301
2836
mb_functioncode: 0x04
2937

30-
# Holding registers 3200 - 3237. Inverter system information.
31-
- start: 3200
32-
end: 3218
33-
mb_functioncode: 0x03
34-
3538
parameters:
3639
- group: solar
3740
items:
@@ -699,7 +702,7 @@ parameters:
699702
scale: 0.01
700703
rule: 1
701704
registers: [ 3098 ]
702-
icon: 'mdi:home-lightning-bolt'
705+
icon: 'mdi:sine-wave'
703706

704707
- name: "R-phase Meter Current"
705708
class: "current"
@@ -744,7 +747,7 @@ parameters:
744747
scale: 0.01
745748
rule: 1
746749
registers: [ 3125 ]
747-
icon: 'mdi:home-lightning-bolt'
750+
icon: 'mdi:sine-wave'
748751

749752
- name: "R-phase Inverter Power"
750753
class: "power"

0 commit comments

Comments
 (0)