Skip to content

Commit

Permalink
Cleanup and standardization of older river and delta v1 units. (#388)
Browse files Browse the repository at this point in the history
- Re-ran documentation builder
- Changed capacity sensors to not be tagged as a measure of CURRENT. Capacity (mAh) is not current (mA). This removes some log warnings.
- Delta Max: Added solar voltage/current, DC out voltage, slave 2 battery support, energy sensors
- Delta Mini: Added solar voltage/current, DC out voltage, battery current
- Delta Mini: Changed DC anderson out to OutWattsDcSensorEntity so the value is scaled properly.
- Delta Pro: Reordered code to be consistent with Delta Max/Mini.
- Delta Pro: Fixed DC output watts to use correct sensor type so value is correctly scaled
- Delta Pro: Added battery current sensor
- River Max: Added missing sensors for solar, temp, and battery amps
- River Max: Added DC timeout and updated timeouts to use TimeoutDictSelectEntity
- River Max: Fixed max charge level, which was missing lambda. Assumed 49, like River Pro
- River Max: Fixed incorrect slave battery attributes
- River Pro: Added sensors for battery cycles, battery voltage, combined SOC, and slave battery temp.
  • Loading branch information
Timothy Ace authored Dec 19, 2024
1 parent a496d2c commit b3f49be
Show file tree
Hide file tree
Showing 13 changed files with 318 additions and 128 deletions.
91 changes: 75 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ Once installed, use Add Integration -> Ecoflow Cloud.
- Battery Level (Precise) _(disabled)_
- Total In Power
- Total Out Power
- Main Battery Current
- AC In Power
- AC Out Power
- AC In Volts
Expand All @@ -300,6 +299,7 @@ Once installed, use Add Integration -> Ecoflow Cloud.
- Battery Temperature
- Min Cell Temperature _(disabled)_
- Max Cell Temperature _(disabled)_
- Main Battery Current _(disabled)_
- Battery Volts _(disabled)_
- Min Cell Volts _(disabled)_
- Max Cell Volts _(disabled)_
Expand Down Expand Up @@ -362,22 +362,27 @@ Once installed, use Add Integration -> Ecoflow Cloud.

</p></details>

<details><summary> RIVER_MAX <i>(sensors: 40, switches: 5, sliders: 1, selects: 2)</i> </summary>
<details><summary> RIVER_MAX <i>(sensors: 49, switches: 5, sliders: 1, selects: 3)</i> </summary>
<p>

*Sensors*
- Main Battery Level
- Main Design Capacity _(disabled)_
- Main Full Capacity _(disabled)_
- Main Remain Capacity _(disabled)_
- Battery Level
- Total In Power
- Total Out Power
- Solar In Current
- Solar In Voltage
- AC In Power
- AC Out Power
- AC In Volts
- AC Out Volts
- DC Out Power
- Type-C Out Power
- DC Temperature _(disabled)_
- USB C Temperature _(disabled)_
- USB (1) Out Power
- USB (2) Out Power
- USB (3) Out Power
Expand All @@ -386,9 +391,12 @@ Once installed, use Add Integration -> Ecoflow Cloud.
- Battery Temperature
- Min Cell Temperature _(disabled)_
- Max Cell Temperature _(disabled)_
- Battery Current _(disabled)_
- Battery Volts _(disabled)_
- Min Cell Volts _(disabled)_
- Max Cell Volts _(disabled)_
- Inverter Inside Temperature
- Inverter Outside Temperature
- Solar In Energy
- Battery Charge Energy from AC
- Battery Charge Energy from DC
Expand All @@ -401,9 +409,10 @@ Once installed, use Add Integration -> Ecoflow Cloud.
- Slave Battery Temperature _(auto)_
- Slave Min Cell Temperature _(disabled)_
- Slave Max Cell Temperature _(disabled)_
- Battery Volts _(disabled)_
- Min Cell Volts _(disabled)_
- Max Cell Volts _(disabled)_
- Slave Battery Current _(disabled)_
- Slave Battery Volts _(disabled)_
- Slave Min Cell Volts _(disabled)_
- Slave Max Cell Volts _(disabled)_
- Slave Cycles _(auto)_
- Status

Expand All @@ -415,22 +424,24 @@ Once installed, use Add Integration -> Ecoflow Cloud.
- Auto Fan Speed

*Sliders (numbers)*
- Max Charge Level _(read-only)_
- Max Charge Level

*Selects*
- Unit Timeout
- DC (12V) Timeout
- AC Timeout

</p></details>

<details><summary> RIVER_PRO <i>(sensors: 46, switches: 7, sliders: 1, selects: 3)</i> </summary>
<details><summary> RIVER_PRO <i>(sensors: 49, switches: 7, sliders: 1, selects: 3)</i> </summary>
<p>

*Sensors*
- Main Battery Level
- Main Design Capacity _(disabled)_
- Main Full Capacity _(disabled)_
- Main Remain Capacity _(disabled)_
- Battery Level
- Total In Power
- Total Out Power
- Solar In Current
Expand All @@ -447,31 +458,33 @@ Once installed, use Add Integration -> Ecoflow Cloud.
- USB (2) Out Power
- USB (3) Out Power
- Remaining Time
- Cycles
- Battery Temperature
- Min Cell Temperature _(disabled)_
- Max Cell Temperature _(disabled)_
- Battery Current _(disabled)_
- Battery Volts _(disabled)_
- Min Cell Volts _(disabled)_
- Max Cell Volts _(disabled)_
- Inverter Inside Temperature
- Inverter Outside Temperature
- Solar In Energy
- Battery Charge Energy from AC
- Battery Charge Energy from DC
- Battery Discharge Energy to AC
- Battery Discharge Energy to DC
- Battery Current _(disabled)_
- Battery Volts _(disabled)_
- Min Cell Volts _(disabled)_
- Max Cell Volts _(disabled)_
- Cycles
- Slave Battery Level _(auto)_
- Slave Design Capacity _(disabled)_
- Slave Full Capacity _(disabled)_
- Slave Remain Capacity _(disabled)_
- Slave Cycles _(auto)_
- Slave Battery Temperature _(auto)_
- Slave Min Cell Temperature _(disabled)_
- Slave Max Cell Temperature _(disabled)_
- Slave Battery Current _(disabled)_
- Slave Battery Volts _(disabled)_
- Slave Min Cell Volts _(disabled)_
- Slave Max Cell Volts _(disabled)_
- Slave Cycles _(auto)_
- Status

*Switches*
Expand All @@ -484,7 +497,7 @@ Once installed, use Add Integration -> Ecoflow Cloud.
- Auto Fan Speed

*Sliders (numbers)*
- Max Charge Level
- Max Charge Level _(read-only)_

*Selects*
- Unit Timeout
Expand Down Expand Up @@ -526,24 +539,29 @@ Once installed, use Add Integration -> Ecoflow Cloud.

</p></details>

<details><summary> DELTA_MINI <i>(sensors: 33, switches: 4, sliders: 3, selects: 4)</i> </summary>
<details><summary> DELTA_MINI <i>(sensors: 39, switches: 4, sliders: 3, selects: 4)</i> </summary>
<p>

*Sensors*
- Main Battery Level
- Main Battery Level (Precise) _(disabled)_
- Main Design Capacity _(disabled)_
- Main Full Capacity _(disabled)_
- Main Remain Capacity _(disabled)_
- State of Health
- Battery Level
- Battery Level (Precise) _(disabled)_
- Total In Power
- Total Out Power
- AC In Power
- AC Out Power
- AC In Volts
- AC Out Volts
- Solar In Power
- Solar In Voltage
- Solar In Current
- DC Out Power
- DC Out Voltage
- DC Car Out Power
- DC Anderson Out Power
- Type-C (1) Out Power
Expand All @@ -556,6 +574,7 @@ Once installed, use Add Integration -> Ecoflow Cloud.
- Discharge Remaining Time
- Cycles
- Battery Temperature _(disabled)_
- Main Battery Current _(disabled)_
- Battery Volts _(disabled)_
- Solar In Energy
- Battery Charge Energy from AC
Expand Down Expand Up @@ -583,23 +602,30 @@ Once installed, use Add Integration -> Ecoflow Cloud.

</p></details>

<details><summary> DELTA_MAX <i>(sensors: 30, switches: 7, sliders: 5, selects: 0)</i> </summary>
<details><summary> DELTA_MAX <i>(sensors: 70, switches: 7, sliders: 5, selects: 0)</i> </summary>
<p>

*Sensors*
- Main Battery Level
- Main Battery Level (Precise) _(disabled)_
- Main Design Capacity _(disabled)_
- Main Full Capacity _(disabled)_
- Main Remain Capacity _(disabled)_
- State of Health
- Battery Level
- Battery Level (Precise) _(disabled)_
- Total In Power
- Total Out Power
- Main Battery Current
- AC In Power
- AC Out Power
- AC In Volts
- AC Out Volts
- Solar In Power
- Solar In Voltage
- Solar In Current
- DC Out Power
- DC Out Voltage
- Type-C (1) Out Power
- Type-C (2) Out Power
- USB (1) Out Power
Expand All @@ -616,6 +642,39 @@ Once installed, use Add Integration -> Ecoflow Cloud.
- Battery Volts _(disabled)_
- Min Cell Volts _(disabled)_
- Max Cell Volts _(disabled)_
- Solar In Energy
- Battery Charge Energy from AC
- Battery Charge Energy from DC
- Battery Discharge Energy to AC
- Battery Discharge Energy to DC
- Slave 1 Battery Level _(auto)_
- Slave 1 Battery Level (Precise) _(disabled)_
- Slave 1 Design Capacity _(disabled)_
- Slave 1 Full Capacity _(disabled)_
- Slave 1 Remain Capacity _(disabled)_
- Slave 1 State of Health
- Slave 1 Battery Temperature _(auto)_
- Slave 1 In Power _(auto)_
- Slave 1 Out Power _(auto)_
- Slave 2 Battery Level _(auto)_
- Slave 2 Battery Level (Precise) _(disabled)_
- Slave 2 Design Capacity _(disabled)_
- Slave 2 Full Capacity _(disabled)_
- Slave 2 Remain Capacity _(disabled)_
- Slave 2 State of Health
- Slave 1 Battery Volts _(disabled)_
- Slave 1 Min Cell Volts _(disabled)_
- Slave 1 Max Cell Volts _(disabled)_
- Slave 1 Battery Current _(disabled)_
- Slave 2 Battery Volts _(disabled)_
- Slave 2 Min Cell Volts _(disabled)_
- Slave 2 Max Cell Volts _(disabled)_
- Slave 2 Battery Current _(disabled)_
- Slave 2 Battery Temperature _(auto)_
- Slave 2 In Power _(auto)_
- Slave 2 Out Power _(auto)_
- Slave 1 Cycles _(disabled)_
- Slave 2 Cycles _(disabled)_
- Status

*Switches*
Expand Down
84 changes: 69 additions & 15 deletions custom_components/ecoflow_cloud/devices/internal/delta_max.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
from custom_components.ecoflow_cloud.entities import BaseSensorEntity, BaseNumberEntity, BaseSwitchEntity, BaseSelectEntity
from custom_components.ecoflow_cloud.number import ChargingPowerEntity, MinBatteryLevelEntity, MaxBatteryLevelEntity, \
MaxGenStopLevelEntity, MinGenStartLevelEntity
from custom_components.ecoflow_cloud.sensor import LevelSensorEntity, RemainSensorEntity, TempSensorEntity, \
from custom_components.ecoflow_cloud.sensor import LevelSensorEntity, WattsSensorEntity, RemainSensorEntity, TempSensorEntity, \
CyclesSensorEntity, \
InWattsSensorEntity, OutWattsSensorEntity, MilliVoltSensorEntity, \
InMilliVoltSensorEntity, OutMilliVoltSensorEntity, CapacitySensorEntity, InWattsSolarSensorEntity, \
OutWattsDcSensorEntity, QuotaStatusSensorEntity
InEnergySensorEntity, OutEnergySensorEntity, OutWattsDcSensorEntity, QuotaStatusSensorEntity, \
AmpSensorEntity, InVoltSolarSensorEntity, InAmpSolarSensorEntity, OutVoltDcSensorEntity
from custom_components.ecoflow_cloud.switch import BeeperEntity, EnabledEntity


Expand All @@ -18,13 +19,21 @@ def sensors(self, client: EcoflowApiClient) -> list[BaseSensorEntity]:
.attr("bmsMaster.designCap", const.ATTR_DESIGN_CAPACITY, 0)
.attr("bmsMaster.fullCap", const.ATTR_FULL_CAPACITY, 0)
.attr("bmsMaster.remainCap", const.ATTR_REMAIN_CAPACITY, 0),
LevelSensorEntity(client, self, "bmsMaster.f32ShowSoc", const.MAIN_BATTERY_LEVEL_F32, False)
.attr("bmsMaster.designCap", const.ATTR_DESIGN_CAPACITY, 0)
.attr("bmsMaster.fullCap", const.ATTR_FULL_CAPACITY, 0)
.attr("bmsMaster.remainCap", const.ATTR_REMAIN_CAPACITY, 0),
CapacitySensorEntity(client, self, "bmsMaster.designCap", const.MAIN_DESIGN_CAPACITY, False),
CapacitySensorEntity(client, self, "bmsMaster.fullCap", const.MAIN_FULL_CAPACITY, False),
CapacitySensorEntity(client, self, "bmsMaster.remainCap", const.MAIN_REMAIN_CAPACITY, False),

LevelSensorEntity(client, self, "bmsMaster.soh", const.SOH),

LevelSensorEntity(client, self, "ems.lcdShowSoc", const.COMBINED_BATTERY_LEVEL),
LevelSensorEntity(client, self, "ems.f32LcdShowSoc", const.COMBINED_BATTERY_LEVEL_F32, False),
InWattsSensorEntity(client, self, "pd.wattsInSum", const.TOTAL_IN_POWER),
OutWattsSensorEntity(client, self, "pd.wattsOutSum", const.TOTAL_OUT_POWER),
AmpSensorEntity(client, self, "bmsMaster.amp", const.MAIN_BATTERY_CURRENT),

InWattsSensorEntity(client, self, "inv.inputWatts", const.AC_IN_POWER),
OutWattsSensorEntity(client, self, "inv.outputWatts", const.AC_OUT_POWER),
Expand All @@ -33,7 +42,11 @@ def sensors(self, client: EcoflowApiClient) -> list[BaseSensorEntity]:
OutMilliVoltSensorEntity(client, self, "inv.invOutVol", const.AC_OUT_VOLT),

InWattsSolarSensorEntity(client, self, "mppt.inWatts", const.SOLAR_IN_POWER),
InVoltSolarSensorEntity(client, self, "mppt.inVol", const.SOLAR_IN_VOLTAGE),
InAmpSolarSensorEntity(client, self, "mppt.inAmp", const.SOLAR_IN_CURRENT),

OutWattsDcSensorEntity(client, self, "mppt.outWatts", const.DC_OUT_POWER),
OutVoltDcSensorEntity(client, self, "mppt.outVol", const.DC_OUT_VOLTAGE),

OutWattsSensorEntity(client, self, "pd.typec1Watts", const.TYPEC_1_OUT_POWER),
OutWattsSensorEntity(client, self, "pd.typec2Watts", const.TYPEC_2_OUT_POWER),
Expand Down Expand Up @@ -62,19 +75,60 @@ def sensors(self, client: EcoflowApiClient) -> list[BaseSensorEntity]:
MilliVoltSensorEntity(client, self, "bmsMaster.minCellVol", const.MIN_CELL_VOLT, False),
MilliVoltSensorEntity(client, self, "bmsMaster.maxCellVol", const.MAX_CELL_VOLT, False),

# Optional Slave Battery
#LevelSensorEntity(client, self, "bms_slave.soc", const.SLAVE_BATTERY_LEVEL, False, True),
#TempSensorEntity(client, self, "bms_slave.temp", const.SLAVE_BATTERY_TEMP, False, True),
#TempSensorEntity(client, self, "bms_slave.minCellTemp", const.SLAVE_MIN_CELL_TEMP, False),
#TempSensorEntity(client, self, "bms_slave.maxCellTemp", const.SLAVE_MAX_CELL_TEMP, False),

#VoltSensorEntity(client, self, "bms_slave.vol", const.SLAVE_BATTERY_VOLT, False),
#VoltSensorEntity(client, self, "bms_slave.minCellVol", const.SLAVE_MIN_CELL_VOLT, False),
#VoltSensorEntity(client, self, "bms_slave.maxCellVol", const.SLAVE_MAX_CELL_VOLT, False),

#CyclesSensorEntity(client, self, "bms_slave.cycles", const.SLAVE_CYCLES, False, True),
#InWattsSensorEntity(client, self, "bms_slave.inputWatts", const.SLAVE_IN_POWER, False, True),
#OutWattsSensorEntity(client, self, "bms_slave.outputWatts", const.SLAVE_OUT_POWER, False, True)
# https://github.com/tolwi/hassio-ecoflow-cloud/discussions/87
InEnergySensorEntity(client, self, "pd.chgSunPower", const.SOLAR_IN_ENERGY),
InEnergySensorEntity(client, self, "pd.chgPowerAc", const.CHARGE_AC_ENERGY),
InEnergySensorEntity(client, self, "pd.chgPowerDc", const.CHARGE_DC_ENERGY),
OutEnergySensorEntity(client, self, "pd.dsgPowerAc", const.DISCHARGE_AC_ENERGY),
OutEnergySensorEntity(client, self, "pd.dsgPowerDc", const.DISCHARGE_DC_ENERGY),

# Optional Slave Batteries
LevelSensorEntity(client, self, "bmsSlave1.soc", const.SLAVE_N_BATTERY_LEVEL % 1, False, True)
.attr("bmsSlave1.designCap", const.ATTR_DESIGN_CAPACITY, 0)
.attr("bmsSlave1.fullCap", const.ATTR_FULL_CAPACITY, 0)
.attr("bmsSlave1.remainCap", const.ATTR_REMAIN_CAPACITY, 0),
LevelSensorEntity(client, self, "bmsSlave1.f32ShowSoc", const.SLAVE_N_BATTERY_LEVEL_F32 % 1, False, False)
.attr("bmsSlave1.designCap", const.ATTR_DESIGN_CAPACITY, 0)
.attr("bmsSlave1.fullCap", const.ATTR_FULL_CAPACITY, 0)
.attr("bmsSlave1.remainCap", const.ATTR_REMAIN_CAPACITY, 0),
CapacitySensorEntity(client, self, "bmsSlave1.designCap", const.SLAVE_N_DESIGN_CAPACITY % 1, False),
CapacitySensorEntity(client, self, "bmsSlave1.fullCap", const.SLAVE_N_FULL_CAPACITY % 1, False),
CapacitySensorEntity(client, self, "bmsSlave1.remainCap", const.SLAVE_N_REMAIN_CAPACITY % 1, False),
LevelSensorEntity(client, self, "bmsSlave1.soh", const.SLAVE_N_SOH % 1),

TempSensorEntity(client, self, "bmsSlave1.temp", const.SLAVE_N_BATTERY_TEMP % 1, False, True)
.attr("bmsSlave1.minCellTemp", const.ATTR_MIN_CELL_TEMP, 0)
.attr("bmsSlave1.maxCellTemp", const.ATTR_MAX_CELL_TEMP, 0),
WattsSensorEntity(client, self, "bmsSlave1.inputWatts", const.SLAVE_N_IN_POWER % 1, False, True),
WattsSensorEntity(client, self, "bmsSlave1.outputWatts", const.SLAVE_N_OUT_POWER % 1, False, True),

LevelSensorEntity(client, self, "bmsSlave2.soc", const.SLAVE_N_BATTERY_LEVEL % 2, False, True)
.attr("bmsSlave2.designCap", const.ATTR_DESIGN_CAPACITY, 0)
.attr("bmsSlave2.fullCap", const.ATTR_FULL_CAPACITY, 0)
.attr("bmsSlave2.remainCap", const.ATTR_REMAIN_CAPACITY, 0),
LevelSensorEntity(client, self, "bmsSlave2.f32ShowSoc", const.SLAVE_N_BATTERY_LEVEL_F32 % 2, False, False)
.attr("bmsSlave2.designCap", const.ATTR_DESIGN_CAPACITY, 0)
.attr("bmsSlave2.fullCap", const.ATTR_FULL_CAPACITY, 0)
.attr("bmsSlave2.remainCap", const.ATTR_REMAIN_CAPACITY, 0),
CapacitySensorEntity(client, self, "bmsSlave2.designCap", const.SLAVE_N_DESIGN_CAPACITY % 2, False),
CapacitySensorEntity(client, self, "bmsSlave2.fullCap", const.SLAVE_N_FULL_CAPACITY % 2, False),
CapacitySensorEntity(client, self, "bmsSlave2.remainCap", const.SLAVE_N_REMAIN_CAPACITY % 2, False),
LevelSensorEntity(client, self, "bmsSlave2.soh", const.SLAVE_N_SOH % 2),
MilliVoltSensorEntity(client, self, "bmsSlave1.vol", const.SLAVE_N_BATTERY_VOLT % 1, False),
MilliVoltSensorEntity(client, self, "bmsSlave1.minCellVol", const.SLAVE_N_MIN_CELL_VOLT % 1, False),
MilliVoltSensorEntity(client, self, "bmsSlave1.maxCellVol", const.SLAVE_N_MAX_CELL_VOLT % 1, False),
AmpSensorEntity(client, self, "bmsSlave1.amp", const.SLAVE_N_BATTERY_CURRENT % 1, False),
MilliVoltSensorEntity(client, self, "bmsSlave2.vol", const.SLAVE_N_BATTERY_VOLT % 2, False),
MilliVoltSensorEntity(client, self, "bmsSlave2.minCellVol", const.SLAVE_N_MIN_CELL_VOLT % 2, False),
MilliVoltSensorEntity(client, self, "bmsSlave2.maxCellVol", const.SLAVE_N_MAX_CELL_VOLT % 2, False),
AmpSensorEntity(client, self, "bmsSlave2.amp", const.SLAVE_N_BATTERY_CURRENT % 2, False),
TempSensorEntity(client, self, "bmsSlave2.temp", const.SLAVE_N_BATTERY_TEMP % 2, False, True)
.attr("bmsSlave2.minCellTemp", const.ATTR_MIN_CELL_TEMP, 0)
.attr("bmsSlave2.maxCellTemp", const.ATTR_MAX_CELL_TEMP, 0),
WattsSensorEntity(client, self, "bmsSlave2.inputWatts", const.SLAVE_N_IN_POWER % 2, False, True),
WattsSensorEntity(client, self, "bmsSlave2.outputWatts", const.SLAVE_N_OUT_POWER % 2, False, True),
CyclesSensorEntity(client, self, "bmsSlave1.cycles", const.SLAVE_N_CYCLES % 1, False),
CyclesSensorEntity(client, self, "bmsSlave2.cycles", const.SLAVE_N_CYCLES % 2, False),
QuotaStatusSensorEntity(client, self)
]

Expand Down
Loading

0 comments on commit b3f49be

Please sign in to comment.