Skip to content

Commit

Permalink
Add support for latest firmware on X1-Hybrid-G4
Browse files Browse the repository at this point in the history
  • Loading branch information
dezzak committed Oct 23, 2024
1 parent 9f5c7cf commit 864245c
Show file tree
Hide file tree
Showing 4 changed files with 346 additions and 1 deletion.
2 changes: 1 addition & 1 deletion solax/inverters/x1_hybrid_gen4.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class X1HybridGen4(Inverter):
vol.Required("data"): vol.Schema(
vol.All(
[vol.Coerce(float)],
vol.Length(min=200, max=200),
vol.Length(min=200, max=300),
)
),
vol.Required("information"): vol.Schema(vol.All(vol.Length(min=9, max=10))),
Expand Down
12 changes: 12 additions & 0 deletions tests/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
X1_BOOST_VALUES_G4_V3,
X1_BOOST_VALUES_OVERFLOWN,
X1_BOOST_VALUES_V3,
X1_HYBRID_G4_V_3_018_VALUES,
X1_HYBRID_G4_VALUES,
X1_MINI_VALUES,
X1_MINI_VALUES_V34,
Expand Down Expand Up @@ -37,6 +38,7 @@
X1_HYBRID_G3_2X_MPPT_RESPONSE,
X1_HYBRID_G3_RESPONSE,
X1_HYBRID_G4_RESPONSE,
X1_HYBRID_G4_V_3_018_RESPONSE,
X1_MINI_RESPONSE_V34,
X1_MINI_RESPONSE_V34_VER3,
X1_SMART_RESPONSE,
Expand Down Expand Up @@ -311,6 +313,16 @@ def simple_http_fixture(httpserver):
headers=None,
data="optType=ReadRealTimeData",
),
InverterUnderTest(
uri="/",
method="POST",
query_string=None,
response=X1_HYBRID_G4_V_3_018_RESPONSE,
inverter=inverter.X1HybridGen4,
values=X1_HYBRID_G4_V_3_018_VALUES,
headers=None,
data="optType=ReadRealTimeData",
),
]


Expand Down
24 changes: 24 additions & 0 deletions tests/samples/expected_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -651,3 +651,27 @@
"Battery Remaining Energy": 1.7,
"Inverter Power": 66.4,
}

X1_HYBRID_G4_V_3_018_VALUES = {
"AC voltage R": 244.1,
"AC current": 1.7,
"AC power": 384.0,
"Grid frequency": 49.89,
"PV1 voltage": 264.1,
"PV2 voltage": 265.2,
"PV1 current": 5.7,
"PV2 current": 5.6,
"PV1 power": 1523.0,
"PV2 power": 1511.0,
"On-grid total yield": 198.8,
"On-grid daily yield": 4.6,
"Battery voltage": 241.0,
"Battery current": 11.0,
"Battery power": 2665.0,
"Battery temperature": 16.0,
"Battery SoC": 53.0,
"Inverter Temperature": 28.0,
"Grid power": 0.0,
"Total feed-in energy": 41.20,
"Total consumption": 13.2,
}
309 changes: 309 additions & 0 deletions tests/samples/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -3881,3 +3881,312 @@
],
"Information": [12.0, 14, "H34XXXXXXXX", 1, 1.15, 0.0, 1.14, 1.07, 0.0, 1],
}

X1_HYBRID_G4_V_3_018_RESPONSE = {
"sn": "SRXXXXXXXX",
"ver": "3.018.03",
"type": 15,
"Data": [
2441,
17,
384,
4989,
2641,
2652,
57,
56,
1523,
1511,
2,
1988,
0,
46,
24100,
1100,
2665,
16,
53,
1059,
0,
1222,
0,
60,
100,
0,
28,
3787,
0,
0,
0,
0,
0,
0,
4120,
0,
1320,
0,
384,
33,
256,
2628,
1800,
250,
350,
170,
158,
34,
34,
10,
1,
1,
4,
0,
2187,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
38,
38,
28,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
9009,
5900,
6154,
1115,
259,
9766,
10023,
0,
0,
0,
0,
1,
2427,
112,
2718,
3390,
3362,
39077,
3,
21302,
14389,
18757,
12355,
16689,
12872,
13874,
21302,
14389,
18757,
12355,
16689,
12872,
13874,
21302,
14389,
19270,
12852,
16688,
12611,
13875,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
3075,
1282,
1540,
1025,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
161,
0,
0,
0,
0,
0,
0,
0,
0,
0,
96,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
],
"Information": [3.680, 15, "H43XXXXXXXXXXX", 8, 1.47, 0.00, 1.43, 1.04, 0.00, 1],
}

0 comments on commit 864245c

Please sign in to comment.