Skip to content

Commit

Permalink
Extended PIP4084 commands
Browse files Browse the repository at this point in the history
  • Loading branch information
gianfrdp committed Oct 17, 2023
1 parent 4fe65b8 commit 3021e5a
Show file tree
Hide file tree
Showing 8 changed files with 926 additions and 23 deletions.
29 changes: 29 additions & 0 deletions components/pipsolar/binary_sensor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
CONF_ALARM_ON_WHEN_PRIMARY_SOURCE_INTERRUPT = "alarm_on_when_primary_source_interrupt"
CONF_FAULT_CODE_RECORD = "fault_code_record"
CONF_POWER_SAVING = "power_saving"
CONF_SOLAR_FEED_TO_GRID_STATUS="solar_feed_to_grid_status"

CONF_WARNINGS_PRESENT = "warnings_present"
CONF_FAULTS_PRESENT = "faults_present"
Expand Down Expand Up @@ -74,6 +75,22 @@
CONF_DISCHARGE_WITH_STANDBY_ONOFF = "discharge_with_standby_onoff"
CONF_CHARGE_ONOFF = "charge_onoff"

# QPGS0 binary sensors
CONF_PARALLEL_NUM_0 = "parallel_num_0"
CONF_INVERTER_STATUS_SCC_0 = "inverter_status_scc_0"
CONF_INVERTER_STATUS_AC_CHARGING_0 = "inverter_status_ac_charging_0"
CONF_INVERTER_STATUS_SCC_CHARGING_0 = "inverter_status_scc_charging_0"
CONF_INVERTER_STATUS_LINE_0 = "inverter_status_line_0"
CONF_INVERTER_STATUS_LOAD_0 = "inverter_status_load_0"
CONF_INVERTER_STATUS_CONFIGURATION_0 = "inverter_status_configuration_0"

#Q1
CONF_SCC_FLAG = "scc_flag"
CONF_ALLOW_SCC_ON = "allow_scc_on"
CONF_FAN_LOCK_STATUS = "fan_lock_status"
CONF_PARALLEL_WARNING = "parallel_warning"
CONF_INVERTER_CHARGE_STATUS = "inverter_charge_status"

TYPES = [
CONF_ADD_SBU_PRIORITY_VERSION,
CONF_CONFIGURATION_STATUS,
Expand All @@ -95,6 +112,7 @@
CONF_ALARM_ON_WHEN_PRIMARY_SOURCE_INTERRUPT,
CONF_FAULT_CODE_RECORD,
CONF_POWER_SAVING,
CONF_SOLAR_FEED_TO_GRID_STATUS,
CONF_WARNINGS_PRESENT,
CONF_FAULTS_PRESENT,
CONF_WARNING_POWER_LOSS,
Expand Down Expand Up @@ -134,6 +152,17 @@
CONF_DISCHARGE_ONOFF,
CONF_DISCHARGE_WITH_STANDBY_ONOFF,
CONF_CHARGE_ONOFF,
CONF_PARALLEL_NUM_0,
CONF_INVERTER_STATUS_SCC_0,
CONF_INVERTER_STATUS_AC_CHARGING_0,
CONF_INVERTER_STATUS_SCC_CHARGING_0,
CONF_INVERTER_STATUS_LINE_0,
CONF_INVERTER_STATUS_LOAD_0,
CONF_INVERTER_STATUS_CONFIGURATION_0,
CONF_SCC_FLAG,
CONF_ALLOW_SCC_ON,
CONF_FAN_LOCK_STATUS,
CONF_PARALLEL_WARNING,
]

CONFIG_SCHEMA = PIPSOLAR_COMPONENT_SCHEMA.extend(
Expand Down
27 changes: 21 additions & 6 deletions components/pipsolar/output/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
# 48V unit: 44V/45V/46V/47V/48V/49V/50V/51V
# battery_under_voltage; 40.0V ~ 48.0V for 48V unit
# battery_float_voltage; 48.0V ~ 58.4V for 48V unit
# battery_type; 00 for AGM, 01 for Flooded battery
# battery_type; 00 for AGM, 01 for Flooded battery, 02 for user define, 03 for Pylontech,
# 04 for Shinheung, 05 for Weco, 06 for Soltaro, 07 for BAK, 08 for Lib, 09 for Lic
# current_max_ac_charging_current;
# output_source_priority; 00 / 01 / 02
# charger_source_priority; For HS: 00 for utility first, 01 for solar first, 02 for solar and utility, 03 for only solar charging
Expand All @@ -41,24 +42,38 @@
CONF_BATTERY_REDISCHARGE_VOLTAGE = "battery_redischarge_voltage"

TYPES = {
# 26. Bulk charging voltage (C.V voltage)
CONF_BATTERY_BULK_VOLTAGE: (
[44.0, 45.0, 46.0, 47.0, 48.0, 49.0, 50.0, 51.0],
#[44.0, 45.0, 46.0, 47.0, 48.0, 49.0, 50.0, 51.0],
[48.0, 48.8, 49.6, 50.4, 51.2, 52.0, 52.8, 53.6, 54.4, 55.2, 56.0, 56.8, 57.0, 57.6, 58.4],
#[3.0, 3.05, 3.1, 3.15, 3.2, 3.25, 3.3, 3.35, 3.4, 3.45, 3.5, 3.5, 3.55, 3.6, 3.65], # Single Cell Volt
"PCVV%02.1f",
),
CONF_BATTERY_RECHARGE_VOLTAGE: (
[44.0, 45.0, 46.0, 47.0, 48.0, 49.0, 50.0, 51.0],
"PBCV%02.1f",
),
# 29. Low DC cut-off voltage
CONF_BATTERY_UNDER_VOLTAGE: (
[40.0, 40.1, 42, 43, 44, 45, 46, 47, 48.0],
[42.0, 42.4, 43.2, 44, 44.8, 45.6, 46.4, 47.2, 48.0],
#[2.625, 2.65, 2.7, 2.75, 2.8, 2.85, 2.9, 2.95, 3], # Single Cell Volt
"PSDV%02.1f",
),
CONF_BATTERY_FLOAT_VOLTAGE: ([48.0, 49.0, 50.0, 51.0], "PBFT%02.1f"),
CONF_BATTERY_TYPE: ([0, 1, 2], "PBT%02.0f"),
# 27. Floating charging voltage
CONF_BATTERY_FLOAT_VOLTAGE: (
#[48.0, 49.0, 50.0, 51.0],
[48.0, 48.8, 49.6, 50.4, 51.2, 52.0, 52.8, 53.6, 54.4, 55.2, 56.0, 56.8, 57.0, 57.6, 58.4],
#[3.0, 3.05, 3.1, 3.15, 3.2, 3.25, 3.3, 3.35, 3.4, 3.45, 3.5, 3.5, 3.55, 3.6, 3.65], # Single Cell Volt
"PBFT%02.1f"
),
# Setting battery type, 00 for AGM, 01 for Flooded battery, 02 for user define, 03 for Pylontech, 04 for Shinheung, 05 for Weco, 06 for Soltaro, 07 for BAK, 08 for Lib, 09 for Lic
CONF_BATTERY_TYPE: ([0, 1, 2, 3, 4 ,5 ,6, 7, 8, 9], "PBT%02.0f"),
CONF_CURRENT_MAX_AC_CHARGING_CURRENT: ([2, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120], "MUCHGC%04.0f"),
CONF_CURRENT_MAX_CHARGING_CURRENT: ([ 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120 ], "MCHGC%03.0f"),
#CONF_CURRENT_MAX_CHARGING_CURRENT: ([ 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120 ], "MCHGC%03.0f"),
CONF_CURRENT_MAX_CHARGING_CURRENT: ([ 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120 ], "MNCHGC%03.0f"),
CONF_OUTPUT_SOURCE_PRIORITY: ([0, 1, 2], "POP%02.0f"),
CONF_CHARGER_SOURCE_PRIORITY: ([0, 1, 2, 3], "PCP%02.0f"),
# 13. Setting voltage point back to battery mode when selecting “SBU” (SBU priority) in program 01.
CONF_BATTERY_REDISCHARGE_VOLTAGE: (
[0, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58],
"PBDV%02.1f",
Expand Down
Loading

0 comments on commit 3021e5a

Please sign in to comment.