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

Added new sensors for PIP8048 #90

Open
wants to merge 3 commits into
base: pip8048
Choose a base branch
from
Open
Show file tree
Hide file tree
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
35 changes: 31 additions & 4 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 @@ -61,8 +62,7 @@
CONF_WARNING_MPPT_OVERLOAD = "warning_mppt_overload"
CONF_WARNING_BATTERY_TOO_LOW_TO_CHARGE = "warning_battery_too_low_to_charge"
CONF_FAULT_DC_DC_OVER_CURRENT = "fault_dc_dc_over_current"
CONF_FAULT_CODE = "fault_code"
CONF_WARNUNG_LOW_PV_ENERGY = "warnung_low_pv_energy"
CONF_WARNING_BATTERY_WEAK = "warning_battery_weak"
CONF_WARNING_HIGH_AC_INPUT_DURING_BUS_SOFT_START = (
"warning_high_ac_input_during_bus_soft_start"
)
Expand All @@ -74,6 +74,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 +111,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 @@ -127,13 +144,23 @@
CONF_WARNING_MPPT_OVERLOAD,
CONF_WARNING_BATTERY_TOO_LOW_TO_CHARGE,
CONF_FAULT_DC_DC_OVER_CURRENT,
CONF_FAULT_CODE,
CONF_WARNUNG_LOW_PV_ENERGY,
CONF_WARNING_BATTERY_WEAK,
CONF_WARNING_HIGH_AC_INPUT_DURING_BUS_SOFT_START,
CONF_WARNING_BATTERY_EQUALIZATION,
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