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

Add entity Main Breaker Current Limit #1140

Merged
merged 1 commit into from
Dec 22, 2024
Merged
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
19 changes: 19 additions & 0 deletions custom_components/solax_modbus/plugin_solax.py
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,18 @@ def value_function_battery_voltage_cell_difference(initval, descr, datadict):
allowedtypes = AC | HYBRID | GEN4 | GEN5,
icon = "mdi:battery-charging-high",
),
SolaxModbusNumberEntityDescription(
name = "Main Breaker Current Limit",
key = "main_breaker_current_limit",
register = 0x71,
fmt = "i",
native_min_value = 10,
native_max_value = 250,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the Inverter allow you to set 250A? As the docs only mention 100A

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My pull request was intended for X3, but does my pull request apply to X1?

From Solax Modbus spec (V3.24):

image

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was actually looking at 0xD7, where it only mentions 32-100A. It's common for there to be a difference within the docs...
I would keep it at 10-250, people can then set it to what suits.

Or we could have an X1 0x71 with 10-100 and an X3 0x71 with 10-250?

native_step = 1,
native_unit_of_measurement = UnitOfElectricCurrent.AMPERE,
device_class = NumberDeviceClass.CURRENT,
allowedtypes = AC | HYBRID | GEN4 | GEN5,
),
SolaxModbusNumberEntityDescription(
name = "Feedin On Power",
key = "feedin_on_power",
Expand Down Expand Up @@ -2842,6 +2854,13 @@ def value_function_battery_voltage_cell_difference(initval, descr, datadict):
allowedtypes = HYBRID | GEN4 | GEN5,
internal = True,
),
SolaXModbusSensorEntityDescription(
name = "Main Breaker Current Limit",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name =

Isn't actually required on Internal entities, only the key is required.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want me to remove it then so that it is consistent with other Internal entities?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, will do. :)

Should I also add X1 and X3 in the list of allowedtypes?

key = "main_breaker_current_limit",
register = 0xD7,
allowedtypes = AC | HYBRID | GEN4 | GEN5,
internal = True,
),
SolaXModbusSensorEntityDescription(
name = "Battery Install Capacity",
key = "battery_install_capacity",
Expand Down