Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update entity_descriptions.py #775

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions custom_components/foxess_modbus/entities/entity_descriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,13 @@ def _master_version(address: list[ModbusAddressSpec], is_hex: bool) -> ModbusVer
address=[
ModbusAddressSpec(input=10016, models=Inv.H1_G1 | Inv.KH_PRE119),
ModbusAddressSpec(holding=30016, models=Inv.H1_G1 | Inv.H1_LAN | Inv.H3_SET),
ModbusAddressSpec(holding=36001, models=Inv.H3_PRO),
],
is_hex=False,
)
yield _master_version(
address=[
ModbusAddressSpec(holding=30016, models=Inv.KH_PRE133),
ModbusAddressSpec(holding=36001, models=Inv.H1_G2_SET | Inv.KH_133),
ModbusAddressSpec(holding=36001, models=Inv.H1_G2_SET | Inv.KH_133 | Inv.H3_PRO), # For H3-Pro-15.0 Version_Master:1.56 Version_Slave:1.06, Version_Manager 1.22
],
is_hex=True,
)
Expand All @@ -88,14 +87,13 @@ def _slave_version(address: list[ModbusAddressSpec], is_hex: bool) -> ModbusVers
address=[
ModbusAddressSpec(input=10017, models=Inv.H1_G1 | Inv.KH_PRE119),
ModbusAddressSpec(holding=30017, models=Inv.H1_G1 | Inv.H1_LAN | Inv.H3_SET),
ModbusAddressSpec(holding=36002, models=Inv.H3_PRO),
],
is_hex=False,
)
yield _slave_version(
address=[
ModbusAddressSpec(holding=30017, models=Inv.KH_PRE133),
ModbusAddressSpec(holding=36002, models=Inv.H1_G2_SET | Inv.KH_133),
ModbusAddressSpec(holding=36002, models=Inv.H1_G2_SET | Inv.KH_133 | Inv.H3_PRO), # For H3-Pro-15.0 Version_Master:1.56 Version_Slave:1.06, Version_Manager 1.22
],
is_hex=True,
)
Expand Down Expand Up @@ -1313,7 +1311,7 @@ def _invbatpower(index: int | None, addresses: list[ModbusAddressesSpec]) -> Ite
holding=[31009], models=Inv.H1_G1 | Inv.H1_LAN | Inv.H1_G2_SET | Inv.KH_PRE133 | Inv.KH_133
),
ModbusAddressesSpec(holding=[31015], models=Inv.H3_SET),
ModbusAddressesSpec(holding=[38847, 38846], models=Inv.H3_PRO),
ModbusAddressesSpec(holding=[39139], models=Inv.H3_PRO), # For H3-Pro-15.0 Version_Master:1.56 Version_Slave:1.06, Version_Manager 1.22
],
entity_registry_enabled_default=False,
name="Grid Frequency",
Expand Down Expand Up @@ -2090,7 +2088,7 @@ def _inner(
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.TOTAL,
native_unit_of_measurement="kWh",
scale=0.01,
scale=0.001, # For H3-Pro-15.0 Version_Master:1.56 Version_Slave:1.06, Version_Manager 1.22
signed=False,
validate=[Min(0)],
)
Expand Down