Skip to content

Commit

Permalink
Merge pull request #585 from paultweedy77/h1_g2
Browse files Browse the repository at this point in the history
H1 Gen2 Inverter support
  • Loading branch information
canton7 authored Apr 7, 2024
2 parents 93c3212 + bafbc64 commit 0ca4041
Show file tree
Hide file tree
Showing 6 changed files with 198 additions and 56 deletions.
7 changes: 5 additions & 2 deletions custom_components/foxess_modbus/common/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ class InverterModel(StrEnum):
as config[INVERTER_BASE].
"""

H1 = "H1"
H1_G1 = "H1" # Can't change the value, as it's set in people's configs
H1_G2 = "H1_G2"

AC1 = "AC1"
AIO_H1 = "AIO-H1"

Expand All @@ -59,6 +61,7 @@ class Inv(Flag):

H1_LAN = auto()
H1_G1 = auto()
H1_G2 = auto()

KH_PRE119 = auto()
KH_119 = auto()
Expand All @@ -69,7 +72,7 @@ class Inv(Flag):
KUARA_H3 = auto()
H3_SET = H3 | AIO_H3 | KUARA_H3

ALL = H1_LAN | H1_G1 | KH_SET | H3_SET
ALL = H1_LAN | H1_G1 | H1_G2 | KH_SET | H3_SET


class RegisterPollType(IntEnum):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,15 @@
enable_charge_from_grid_address=41001,
),
models=Inv.H1_G1 | Inv.KH_PRE119,
)
),
ChargePeriodAddressSpec(
holding=ModbusChargePeriodAddressConfig(
period_start_address=41002,
period_end_address=41003,
enable_charge_from_grid_address=41001,
),
models=Inv.H1_G2,
),
],
period_start_key="time_period_1_start",
period_start_name="Period 1 - Start",
Expand All @@ -39,7 +47,15 @@
enable_charge_from_grid_address=41004,
),
models=Inv.H1_G1 | Inv.KH_PRE119,
)
),
ChargePeriodAddressSpec(
holding=ModbusChargePeriodAddressConfig(
period_start_address=41005,
period_end_address=41006,
enable_charge_from_grid_address=41004,
),
models=Inv.H1_G2,
),
],
period_start_key="time_period_2_start",
period_start_name="Period 2 - Start",
Expand Down
Loading

0 comments on commit 0ca4041

Please sign in to comment.