Skip to content

Add X1-VAST (type 34), fix battery current sign, add 14 sensors, fix discovery#209

Open
Jhacarreiro wants to merge 9 commits intosquishykid:masterfrom
Jhacarreiro:x1-vast-pr
Open

Add X1-VAST (type 34), fix battery current sign, add 14 sensors, fix discovery#209
Jhacarreiro wants to merge 9 commits intosquishykid:masterfrom
Jhacarreiro:x1-vast-pr

Conversation

@Jhacarreiro
Copy link
Copy Markdown

Adds support for the Solax X1-VAST inverter (type 34), which shares
the same data format as the X1-Hybrid-G4 (type 15).

Changes:

x1_hybrid_gen4.py:

  • Accept type 34 in schema validation (X1-VAST)
  • Fix Battery current sign: added to_signed before div100
  • Add 14 new sensors, all verified against the official SolaX app:
    Total battery discharge/charge energy, Battery health (SoH),
    Load power, Radiator temperature, Consumption today,
    Total PV energy, Feed-in energy today, Grid import energy today,
    EPS energy total/today, PV daily yield, Battery discharge/charge today
  • Document unknown data points as comments for future investigation
  • 37 sensors total, most complete single-phase profile in the repo

init.py:

  • Fix discovery: use ALL_COMPLETED instead of FIRST_COMPLETED to
    prevent premature failure on slow dongles behind HTTPS proxies

README.md:

  • Add X1-VAST to confirmed supported inverters

Tested on: Solax X1-VAST, type 34, WiFi+LAN 2.0 dongle (HTTPS),
firmware 3.x, with Solax Triple Power battery.
All sensors cross-validated against the official SolaX Cloud app.

The X1-VAST is a newer single-phase hybrid inverter from SolaX.
It returns type=34 in the API response but uses the same Data mapping as the X1 Hybrid Gen4 (type 15).

Tested and confirmed matching fields:
- Data[0]/10 = Grid Voltage (V)
- Data[1]/10 = Grid Current (A)
- Data[2] = AC Power (W, signed)
- Data[3]/100 = Grid Frequency (Hz)
- Data[4]/10 = PV1 Voltage (V)
- Data[5]/10 = PV2 Voltage (V)
- Data[6]/10 = PV1 Current (A)
- Data[7]/10 = PV2 Current (A)
- Data[8] = PV1 Power (W)
- Data[9] = PV2 Power (W)
- Data[11,12] = Total Yield (kWh, /10)
- Data[13]/10 = Daily Yield (kWh)
- Data[14]/100 = Battery Voltage (V)
- Data[16] = Battery Power (W, signed)
- Data[17] = Battery Temperature (C)
- Data[18] = Battery SoC (%)
- Data[32] = Grid Power (W, signed)
- Data[34,35] = Feed-in Energy (kWh, /100)
- Data[36,37] = Consumption (kWh, /100)

API response example:
{"sn":"...","ver":"006.06","type":34,"Data":[2479,178,4336,5002,2297,2288,100,99,2317,2280,21,8212,0,69,24330,65516,0,18,99,...],"Information":[10,34,"10M0A00210170P",18,17.07,0,15.05,0.03,0,1]}

Connection: HTTPS only (port 443), requires nginx reverse proxy for the solax library (HTTP only).
… A parte relevante é esta: (_, _, *processors) = mapping for processor in processors: result[sensor_name] = processor(result[sensor_name])

Two changes to x1_hybrid_gen4.py:

1. Accept type 34 (X1-VAST) alongside type 15 in schema validation,
   following the same pattern used in x1_g4_series.py for types 18/22.
   The X1-VAST is a newer single-phase hybrid inverter that returns 
   type=34 but uses the same Data mapping as X1 Hybrid Gen4 (type 15).

2. Fix Battery current (Data[15]) sign handling.
   Added to_signed before div100 so negative values are correctly
   interpreted. Without this, value 65516 shows as 655.16A instead
   of the correct -0.20A.

Tested with real X1-VAST hardware:
- Firmware: 006.06
- Connection: HTTPS (port 443) via nginx reverse proxy
- All response_decoder fields return correct values
- Discovery works correctly via real_time_api()

API response example:
{"sn":"...","ver":"006.06","type":34,"Data":[2479,178,4336,5002,...],"Information":[10,34,"10M0A00210170P",18,17.07,0,15.05,0.03,0,1]}
Three changes to x1_hybrid_gen4.py:

1. Accept type 34 (X1-VAST) alongside type 15 in schema validation,
   following the same pattern used in x1_g4_series.py for types 18/22.

2. Fix Battery current (Data[15]) sign handling.
   Added to_signed before div100 so negative values are correctly
   interpreted. Without this, value 65516 shows as 655.16A instead
   of the correct -0.20A.

3. Add missing sensors from Data2.txt mapping (type 15,23):
   - Run mode (Data[10])
   - Battery remaining energy (Data[23], /10, kWh)
   - EPS power (Data[28], signed)
   - EPS voltage (Data[29], /10)
   - EPS current (Data[30], signed, /10)

Tested with real X1-VAST hardware:
- Firmware: 006.06
- All new and existing fields return correct values
- Discovery works correctly via real_time_api()
…ensors

Adds support for the Solax X1-VAST inverter (type 34), which shares the same
data format as the X1-Hybrid-G4 (type 15).

Changes:
- Accept type 34 in schema validation (X1-VAST)
- Fix Battery current sign: added to_signed before div100
- Add 14 new sensors verified against the official SolaX app:
  - Total battery discharge energy [19]
  - Total battery charge energy [21]
  - Battery health (SoH) [24]
  - Load power [38]
  - Radiator temperature [39]
  - Consumption today [52]
  - Total PV energy [54]
  - Feed-in energy today [78]
  - Grid import energy today [80]
  - EPS energy total [83]
  - EPS energy today [84]
  - PV daily yield [85]
  - Battery discharge energy today [86]
  - Battery charge energy today [87]
- Document unknown/redundant data points as comments for future investigation

Tested on: Solax X1-VAST, type 34, WiFi+LAN 2.0 dongle (HTTPS),
firmware 3.x, with Solax Triple Power battery.

All new sensors cross-validated against the official SolaX Cloud app
in real-time to confirm data point indices and scaling factors.
The X1-VAST (type 34) shares the same data format as the X1-Hybrid-G4
and now has 37 sensors mapped, making it the most complete single-phase
profile in the repo.
…LL_COMPLETED to avoid premature failure on slow dongles

FIRST_COMPLETED causes discovery to fail on inverters behind HTTPS
reverse proxies or slow WiFi+LAN dongles, as the first successful
response may not be the correct inverter class while others timeout.

ALL_COMPLETED ensures all inverter classes finish before selecting
the best match.
Shell script that patches the solax library inside the HA container to skip full discovery and target X1HybridGen4 directly.

Needed when the WiFi LAN 2.0 dongle is behind an HTTPS reverse proxy and cannot handle 22 parallel discovery requests.

Usage: curl -s https://raw.githubusercontent.com/Jhacarreiro/solax/master/patches/local-vast-patch.sh | sh
@Jhacarreiro
Copy link
Copy Markdown
Author

Note: CI failures are pre-existing on the repo (see fix-1lint branch
and recent workflow runs — all failing since Dec 2025).
My changes don't affect the test infrastructure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant