Skip to content

Commit 3432f28

Browse files
committed
Add new registers with write_blocks
1 parent 6b762b4 commit 3432f28

File tree

1 file changed

+276
-9
lines changed

1 file changed

+276
-9
lines changed

SOFAR-HYD-3PH-AND-G3.json

Lines changed: 276 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,27 @@
2222
"battery_config_eps_buffer"
2323
],
2424
"append": [1]
25+
},
26+
{
27+
"name": "eps_config",
28+
"start_register": "0x1029",
29+
"length": "2",
30+
"registers": [
31+
"eps_control",
32+
"eps_wait_time"
33+
]
34+
},
35+
{
36+
"name": "rs485_config",
37+
"start_register": "0x100B",
38+
"length": "5",
39+
"registers": [
40+
"rs485_config_address",
41+
"rs485_config_baud",
42+
"rs485_config_stop_bit",
43+
"rs485_config_parity_bit"
44+
],
45+
"append": [1]
2546
}
2647
],
2748
"registers": [
@@ -77,6 +98,124 @@
7798
},
7899
"refresh": 86400
79100
},
101+
{
102+
"name": "rs485_config_address",
103+
"register": "0x100B",
104+
"desc": "RS 485 configuration- communication address",
105+
"type": "U16",
106+
"min": 1,
107+
"max": 63,
108+
"ha": {
109+
"name": "RS485 Address",
110+
"icon": "mdi:identifier",
111+
"entity_category": "config",
112+
"min": 1,
113+
"max": 63,
114+
"initial": 0,
115+
"mode": "box",
116+
"command_topic": "sofar/rw/rs485_config/address",
117+
"control": "number",
118+
"value_template": "{{ value_json.rs485_config_address | int }}"
119+
},
120+
"refresh": 1
121+
},
122+
{
123+
"name": "rs485_config_baud",
124+
"register": "0x100C",
125+
"desc": "RS485 Baud Rate Selection",
126+
"type": "U16",
127+
"function": "mode",
128+
"modes": {
129+
"0": "4800",
130+
"1": "9600",
131+
"2": "19200",
132+
"3": "38400",
133+
"4": "57600"
134+
},
135+
"ha": {
136+
"name": "RS485 Baud",
137+
"icon": "mdi:identifier",
138+
"entity_category": "config",
139+
"min": 0,
140+
"max": 4,
141+
"initial": 0,
142+
"mode": "box",
143+
"unit_of_measurement": "bps",
144+
"value_template": "{{ value_json.rs485_config_baud }}",
145+
"command_topic": "sofar/rw/rs485_config/baud",
146+
"options": [
147+
"4800",
148+
"9600",
149+
"19200",
150+
"38400",
151+
"57600"
152+
],
153+
"control": "select"
154+
},
155+
"refresh": 1
156+
},
157+
{
158+
"name": "rs485_config_stop_bit",
159+
"register": "0x100C",
160+
"desc": "RS485 Stop Bit Selection",
161+
"type": "U16",
162+
"function": "mode",
163+
"modes": {
164+
"0": "1",
165+
"1": "1.5",
166+
"2": "2"
167+
},
168+
"ha": {
169+
"name": "RS485 Stop Bit",
170+
"icon": "mdi:identifier",
171+
"entity_category": "config",
172+
"min": 0,
173+
"max": 2,
174+
"initial": 0,
175+
"value_template": "{{ value_json.rs485_config_stop_bit }}",
176+
"command_topic": "sofar/rw/rs485_config/stop_bit",
177+
"options": [
178+
"1",
179+
"1.5",
180+
"2"
181+
],
182+
"control": "select"
183+
},
184+
"refresh": 1
185+
},
186+
{
187+
"name": "rs485_config_parity_bit",
188+
"register": "0x100C",
189+
"desc": "RS485 Parity Bit Selection",
190+
"type": "U16",
191+
"function": "mode",
192+
"modes": {
193+
"0": "None",
194+
"1": "Even",
195+
"2": "Odd",
196+
"3": "High/Mark",
197+
"4": "Low/Space"
198+
},
199+
"ha": {
200+
"name": "RS485 Parity Bit",
201+
"icon": "mdi:identifier",
202+
"entity_category": "config",
203+
"min": 0,
204+
"max": 4,
205+
"initial": 0,
206+
"value_template": "{{ value_json.rs485_config_parity_bit }}",
207+
"command_topic": "sofar/rw/rs485_config/parity_bit",
208+
"options": [
209+
"None",
210+
"Even",
211+
"Odd",
212+
"High/Mark",
213+
"Low/Space"
214+
],
215+
"control": "select"
216+
},
217+
"refresh": 1
218+
},
80219
{
81220
"name": "battery_config_id",
82221
"register": "0x1044",
@@ -1025,6 +1164,22 @@
10251164
},
10261165
"refresh": 60
10271166
},
1167+
{
1168+
"name": "total_generation",
1169+
"register": "0x0687",
1170+
"function": "divide",
1171+
"factor": 100,
1172+
"ha": {
1173+
"device_class": "energy",
1174+
"unit_of_measurement": "kWh",
1175+
"name": "Solar Generation Total",
1176+
"icon": "mdi:solar-power-variant",
1177+
"state_class": "total_increasing",
1178+
"entity_category": "diagnostic",
1179+
"value_template": "{{ value_json.total_generation }}"
1180+
},
1181+
"refresh": 3600
1182+
},
10281183
{
10291184
"name": "today_consumption",
10301185
"register": "0x0689",
@@ -1041,6 +1196,22 @@
10411196
},
10421197
"refresh": 60
10431198
},
1199+
{
1200+
"name": "total_consumption",
1201+
"register": "0x068B",
1202+
"function": "divide",
1203+
"factor": 100,
1204+
"ha": {
1205+
"device_class": "energy",
1206+
"unit_of_measurement": "kWh",
1207+
"name": "Consumption Total",
1208+
"icon": "mdi:home-lightning-bolt-outline",
1209+
"state_class": "total_increasing",
1210+
"entity_category": "diagnostic",
1211+
"value_template": "{{ value_json.total_consumption }}"
1212+
},
1213+
"refresh": 3600
1214+
},
10441215
{
10451216
"name": "today_import",
10461217
"register": "0x068D",
@@ -1057,6 +1228,22 @@
10571228
},
10581229
"refresh": 60
10591230
},
1231+
{
1232+
"name": "total_import",
1233+
"register": "0x068F",
1234+
"function": "divide",
1235+
"factor": 100,
1236+
"ha": {
1237+
"device_class": "energy",
1238+
"unit_of_measurement": "kWh",
1239+
"name": "Import Total",
1240+
"icon": "mdi:transmission-tower-import",
1241+
"state_class": "total_increasing",
1242+
"entity_category": "diagnostic",
1243+
"value_template": "{{ value_json.total_import }}"
1244+
},
1245+
"refresh": 3600
1246+
},
10601247
{
10611248
"name": "today_export",
10621249
"register": "0x0691",
@@ -1074,20 +1261,20 @@
10741261
"refresh": 60
10751262
},
10761263
{
1077-
"name": "today_battery_discharge",
1078-
"register": "0x0699",
1264+
"name": "total_export",
1265+
"register": "0x0693",
10791266
"function": "divide",
10801267
"factor": 100,
10811268
"ha": {
10821269
"device_class": "energy",
10831270
"unit_of_measurement": "kWh",
1084-
"name": "Battery Discharge Today",
1085-
"icon": "mdi:battery-minus-variant",
1271+
"name": "Export Total",
1272+
"icon": "mdi:transmission-tower-export",
10861273
"state_class": "total_increasing",
10871274
"entity_category": "diagnostic",
1088-
"value_template": "{{ value_json.today_battery_discharge }}"
1275+
"value_template": "{{ value_json.total_export }}"
10891276
},
1090-
"refresh": 60
1277+
"refresh": 3600
10911278
},
10921279
{
10931280
"name": "today_battery_charge",
@@ -1105,6 +1292,54 @@
11051292
},
11061293
"refresh": 60
11071294
},
1295+
{
1296+
"name": "total_battery_charge",
1297+
"register": "0x0697",
1298+
"function": "divide",
1299+
"factor": 100,
1300+
"ha": {
1301+
"device_class": "energy",
1302+
"unit_of_measurement": "kWh",
1303+
"name": "Battery Charge Total",
1304+
"icon": "mdi:battery-plus-variant",
1305+
"state_class": "total_increasing",
1306+
"entity_category": "diagnostic",
1307+
"value_template": "{{ value_json.total_battery_charge }}"
1308+
},
1309+
"refresh": 3600
1310+
},
1311+
{
1312+
"name": "today_battery_discharge",
1313+
"register": "0x0699",
1314+
"function": "divide",
1315+
"factor": 100,
1316+
"ha": {
1317+
"device_class": "energy",
1318+
"unit_of_measurement": "kWh",
1319+
"name": "Battery Discharge Today",
1320+
"icon": "mdi:battery-minus-variant",
1321+
"state_class": "total_increasing",
1322+
"entity_category": "diagnostic",
1323+
"value_template": "{{ value_json.today_battery_discharge }}"
1324+
},
1325+
"refresh": 60
1326+
},
1327+
{
1328+
"name": "total_battery_discharge",
1329+
"register": "0x069B",
1330+
"function": "divide",
1331+
"factor": 100,
1332+
"ha": {
1333+
"device_class": "energy",
1334+
"unit_of_measurement": "kWh",
1335+
"name": "Battery Discharge Total",
1336+
"icon": "mdi:battery-minus-variant",
1337+
"state_class": "total_increasing",
1338+
"entity_category": "diagnostic",
1339+
"value_template": "{{ value_json.total_battery_discharge }}"
1340+
},
1341+
"refresh": 3600
1342+
},
11081343
{
11091344
"name": "battery_voltage",
11101345
"register": "0x0604",
@@ -1187,9 +1422,41 @@
11871422
"0": "Off",
11881423
"1": "On"
11891424
},
1190-
"write": true,
1191-
"untested": true,
1192-
"refresh": 86400
1425+
"ha": {
1426+
"name": "EPS Control",
1427+
"icon": "mdi:toggle-switch",
1428+
"entity_category": "config",
1429+
"command_topic": "sofar/rw/eps_config/eps_control",
1430+
"options": [
1431+
"Off",
1432+
"On"
1433+
],
1434+
"control": "select",
1435+
"value_template": "{{ value_json.eps_control }}"
1436+
},
1437+
"refresh": 1
1438+
},
1439+
{
1440+
"name": "eps_wait_time",
1441+
"register": "0x102A",
1442+
"desc": "Waiting time for emergency power start",
1443+
"type": "U16",
1444+
"min": 0,
1445+
"max": 65535,
1446+
"ha": {
1447+
"name": "EPS Wait Time",
1448+
"icon": "mdi:alpha-s-box",
1449+
"entity_category": "config",
1450+
"min": 0,
1451+
"max": 65535,
1452+
"mode": "box",
1453+
"command_topic": "sofar/rw/eps_config/eps_wait_time",
1454+
"control": "number",
1455+
"device_class": "duration",
1456+
"unit_of_measurement": "s",
1457+
"value_template": "{{ value_json.eps_wait_time }}"
1458+
},
1459+
"refresh": 1
11931460
},
11941461
{
11951462
"name": "remote_on_off_control",

0 commit comments

Comments
 (0)