Skip to content

Commit

Permalink
Add support for X3-Hybiyd-G3 (tested with Solax X3 Hybrid G2) (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
ppetru authored Feb 26, 2021
1 parent acd1b96 commit 81f7e9e
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 2 deletions.
4 changes: 2 additions & 2 deletions solax/inverter.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ class X3(InverterPost):
vol.All(
[vol.Coerce(float)],
vol.Any(
vol.Length(min=102, max=102),
vol.Length(min=103, max=103)),
vol.Length(min=102, max=103),
vol.Length(min=107, max=107)),
)
),
vol.Required('Information'): vol.Schema(
Expand Down
73 changes: 73 additions & 0 deletions tests/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,28 @@
1, 3.00, 0.00, 3.17, 1.01]
}

X3_HYBRID_G3_2X_MPPT_RESPONSE = {
"type": "X3-Hybiyd-G3",
"SN": "XXXXXXXXXX",
"ver": "2.033.20",
"Data": [0.0, 0.0, 0.0, 0.0, 0.9, 234.0, 3189, 42, 15.2, 27.0, -25, 0, 0,
210.30, -15.70, -3321, 24, 8.6, 0, 11.0, 1, 68, 232.4, 170.0,
31.0, 35.0, 22.6, 20.7, 3.8, 3.8, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2.03, 23.41, 123, 1344, 1722, 5.4, 6.9, 250.0, 251.9, 50.01,
50.01, 50.01, 0.0, 0.0, 0, 0.00, 0, 0, 0, 0.00, 0, 0, 0, 0, 0.00,
0, 0, 2, 1, 26, 1.00, 0, 100, 10, 25.00, 25.00, 0, 0, 0, 0, 0.0,
10.8, 24.4, 0.0, 0, 2, 0.0, 0.0, 0, 0.0, 0.0, 0, 0, 0, 0, 1, 1,
0, 0, 0.00, 0.00, 1, 273, 212.3, -16.2, -3439],
"Information": [8.000, 5, "X3-Hybiyd-G3", "XXXXXXXX", 1, 4.47, 0.00, 4.34,
1.05],
"battery": {
"brand": "83",
"masterVer": "1.11",
"slaveNum": "4",
"slaveVer": [1.13, 1.13, 1.13, 1.13]
}
}

XHYBRID_VALUES = {
'Today\'s Energy': 8.0,
'Battery Current': 14.0,
Expand Down Expand Up @@ -202,6 +224,49 @@
'EPS Frequency': 56,
}

X3_HYBRID_VALUES = {
'PV1 Current': 0,
'PV2 Current': 0,
'PV1 Voltage': 0,
'PV2 Voltage': 0,

'Output Current Phase 1': 0.9,
'Network Voltage Phase 1': 234,
'AC Power': 3189,

'Inverter Temperature': 42,
'Today\'s Energy': 15.2,
'Total Energy': 27,
'Exported Power': -25,
'PV1 Power': 0,
'PV2 Power': 0,

'Battery Voltage': 210.3,
'Battery Current': -15.7,
'Battery Power': -3321,
'Battery Temperature': 24,
'Battery Remaining Capacity': 68,

'Total Feed-in Energy': 2.03,
'Total Consumption': 23.41,

'Output Current Phase 2': 5.4,
'Output Current Phase 3': 6.9,
'Network Voltage Phase 2': 250,
'Network Voltage Phase 3': 251.9,
'Grid Frequency Phase 1': 50.01,
'Grid Frequency Phase 2': 50.01,
'Grid Frequency Phase 3': 50.01,
'Power Now Phase 1': 123,
'Power Now Phase 2': 1344,
'Power Now Phase 3': 1722,

'EPS Voltage': 0,
'EPS Current': 0,
'EPS Power': 0,
'EPS Frequency': 0,
}

X1_VALUES = {
'PV1 Current': 0,
'PV2 Current': 1,
Expand Down Expand Up @@ -333,6 +398,14 @@ def simple_http_fixture(httpserver):
response=X1_HYBRID_G3_2X_MPPT_RESPONSE,
inverter=inverter.X1,
values=X1_VALUES,
),
InverterUnderTest(
uri="/",
method='POST',
query_string='optType=ReadRealTimeData',
response=X3_HYBRID_G3_2X_MPPT_RESPONSE,
inverter=inverter.X3,
values=X3_HYBRID_VALUES,
)
]

Expand Down

0 comments on commit 81f7e9e

Please sign in to comment.