add controls to lvx
This commit is contained in:
@@ -367,6 +367,11 @@ QUERY_COMMANDS = {
|
||||
"description": "Mode inquiry",
|
||||
"result_type": ResultType.SINGLE,
|
||||
"reading_definitions": [
|
||||
# Known modes 00..05 are from upstream's table. 06/07 observed
|
||||
# post-commissioning while the inverter actively bank-charges and
|
||||
# idles between solar cycles; "Charge" / "Eco" are educated guesses.
|
||||
# Codes 08..15 are placeholders so an unexpected value doesn't crash
|
||||
# the service (powermon's OPTION decoder raises KeyError on miss).
|
||||
{"description": "Device Mode", "reading_type": ReadingType.MESSAGE,
|
||||
"response_type": ResponseType.OPTION,
|
||||
"options": {
|
||||
@@ -377,6 +382,8 @@ QUERY_COMMANDS = {
|
||||
"04": "Fault",
|
||||
"05": "Hybrid mode(Line mode, Grid mode)",
|
||||
"06": "Charge",
|
||||
"07": "Eco",
|
||||
**{f"{i:02d}": f"Mode {i:02d}" for i in range(8, 16)},
|
||||
}
|
||||
},
|
||||
],
|
||||
@@ -528,9 +535,34 @@ QUERY_COMMANDS = {
|
||||
# only fields confirmed against live responses are semantically named here.
|
||||
# The rest are exposed as raw strings so the command doesn't error out, and
|
||||
# can be tightened later as more firmware rev responses are confirmed.
|
||||
# Observed unit-1 response (Not valid + fault 71 "Parallel version different"):
|
||||
#
|
||||
# Observed unit-1 response — pre-commissioning, fault 71:
|
||||
# 0,4,71,2453,599,0000,000,0000,0000,00000,00000,000,211,005,000,000,000,
|
||||
# 000,0008,0000,2925,0000,1,0,0,0,0,0,016
|
||||
#
|
||||
# Observed (2026-04-26) — post-commissioning, unit-1 (slave) querying both:
|
||||
# PGS0 (master): 1,6,0,0,0000,000,0000,0000,00000,00000,000,000,536,000,
|
||||
# 4,7,54,252,0,2738,0,2,0,0,1,0,0,030
|
||||
# PGS1 (slave) : 1,6,0,0,0000,000,0000,0000,00000,00000,000,000,536,000,
|
||||
# 2,6,54,237,0,2682,0,2,0,0,1,0,0,030
|
||||
# Cross-referencing against GS at the same moment (battery_voltage=53.6 V,
|
||||
# battery_capacity=54 %, master charging_current=4 A, slave=3 A):
|
||||
# field_14 (idx 13) = 536 → battery voltage * 10 (V) [confirmed]
|
||||
# field_18 (idx 17) = 54 → battery capacity (%) [confirmed]
|
||||
# field_16 (idx 15) = 4 / 2 → likely battery_charging_current (A)
|
||||
# — master 4 A matches; slave 2 vs GS 3 A
|
||||
# (sample-time skew between the two reads)
|
||||
# field_17 (idx 16) = 7 / 6 → small int that follows charging side;
|
||||
# candidate: heat-sink temp (°C – 20)?
|
||||
# field_21 (idx 20) = 2738 / 2682 → 4-digit, fluctuates per-unit;
|
||||
# candidate: mppt1_input_voltage*10 (was
|
||||
# 270.7 / 271.8 V — close, not exact);
|
||||
# might be a cumulative counter instead.
|
||||
# field_1 ("parallel_unit_count") reports 6 with a 2-unit cluster — name
|
||||
# is wrong; not yet identified.
|
||||
#
|
||||
# Next-pass plan: capture under load (AC out enabled) and during
|
||||
# battery discharge to disambiguate currents/voltages from counters.
|
||||
"PGS": {
|
||||
"name": "PGS",
|
||||
"description": "Parallel general status inquiry",
|
||||
@@ -538,10 +570,13 @@ QUERY_COMMANDS = {
|
||||
"command_type": CommandType.PI18_QUERY,
|
||||
"result_type": ResultType.COMMA_DELIMITED,
|
||||
"reading_definitions": [
|
||||
# See note on the matching field in GS — same fix here.
|
||||
{"description": "Parallel instance number", "reading_type": ReadingType.MESSAGE,
|
||||
"response_type": ResponseType.OPTION,
|
||||
"options": {str(i): f"instance {i}{' (master)' if i == 0 else ''}" for i in range(9)}},
|
||||
# PGS field 0 has DIFFERENT semantics from GS field 27 despite sharing
|
||||
# this description in upstream powermon. Live captures show this field
|
||||
# always returns 1 regardless of the queried instance, so it appears to
|
||||
# be a "valid response received" flag — not the instance index. Kept
|
||||
# as a 2-value flag here; the GS version is the actual instance index.
|
||||
{"description": "Parallel response valid", "reading_type": ReadingType.MESSAGE,
|
||||
"response_type": ResponseType.LIST, "options": ["Not valid", "valid"]},
|
||||
{"description": "Parallel unit count", "reading_type": ReadingType.MESSAGE},
|
||||
{"description": "Fault code", "reading_type": ReadingType.MESSAGE},
|
||||
{"description": "Field 4 (raw)", "reading_type": ReadingType.MESSAGE},
|
||||
@@ -558,11 +593,15 @@ QUERY_COMMANDS = {
|
||||
{"description": "Total AC output active power", "reading_type": ReadingType.WATTS, "response_type": ResponseType.INT},
|
||||
{"description": "Load percentage", "reading_type": ReadingType.PERCENTAGE, "response_type": ResponseType.INT},
|
||||
{"description": "Field 13 (raw)", "reading_type": ReadingType.MESSAGE},
|
||||
{"description": "Field 14 (raw)", "reading_type": ReadingType.MESSAGE},
|
||||
# Identified 2026-04-26 by cross-reference with GS battery_voltage:
|
||||
{"description": "Battery voltage (parallel view)", "reading_type": ReadingType.VOLTS,
|
||||
"response_type": ResponseType.TEMPLATE_INT, "format_template": "r/10", "device_class": "voltage"},
|
||||
{"description": "Field 15 (raw)", "reading_type": ReadingType.MESSAGE},
|
||||
{"description": "Field 16 (raw)", "reading_type": ReadingType.MESSAGE},
|
||||
{"description": "Field 17 (raw)", "reading_type": ReadingType.MESSAGE},
|
||||
{"description": "Field 18 (raw)", "reading_type": ReadingType.MESSAGE},
|
||||
# Identified 2026-04-26 by cross-reference with GS battery_capacity:
|
||||
{"description": "Battery capacity (parallel view)", "reading_type": ReadingType.PERCENTAGE,
|
||||
"response_type": ResponseType.INT},
|
||||
{"description": "Field 19 (raw)", "reading_type": ReadingType.MESSAGE},
|
||||
{"description": "Field 20 (raw)", "reading_type": ReadingType.MESSAGE},
|
||||
{"description": "Field 21 (raw)", "reading_type": ReadingType.MESSAGE},
|
||||
|
||||
Reference in New Issue
Block a user