Skip to content

Commit

Permalink
337 issue with delay on sensorsolis total consumption power (#359)
Browse files Browse the repository at this point in the history
* Adding plant total consumption of power

* add plantTotalConsumptionPower

* plantTotalConsumptionPowerUnit

* familyLoadPower

Adding back to InverterDetail and adding plant version
  • Loading branch information
hultenvp authored Mar 22, 2024
1 parent cef6dbf commit df20b76
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
8 changes: 8 additions & 0 deletions custom_components/solis/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,14 @@
SensorStateClass.MEASUREMENT,
GRID_REACTIVE_PHASE3_POWER
],
'planttotalconsumptionpower': [
'Plant Total Consumption power',
UnitOfPower.WATT,
'mdi:home-import-outline',
SensorDeviceClass.POWER,
SensorStateClass.MEASUREMENT,
PLANT_TOTAL_CONSUMPTION_POWER
],
'batstateofhealth': [
'Battery State Of Health',
PERCENTAGE,
Expand Down
3 changes: 2 additions & 1 deletion custom_components/solis/ginlong_const.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,5 @@
METER_ITEM_B_CURRENT = 'meterItemBCurrent'
METER_ITEM_B_VOLTAGE = 'meterItemBVoltage'
METER_ITEM_C_CURRENT = 'meterItemCCurrent'
METER_ITEM_C_VOLTAGE = 'meterItemCVoltage'
METER_ITEM_C_VOLTAGE = 'meterItemCVoltage'
PLANT_TOTAL_CONSUMPTION_POWER = 'plantTotalConsumptionPower'
9 changes: 5 additions & 4 deletions custom_components/solis/soliscloud_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@
GRID_REACTIVE_PHASE1_POWER: ['aReactivePower', float, 3],
GRID_REACTIVE_PHASE2_POWER: ['bReactivePower', float, 3],
GRID_REACTIVE_PHASE3_POWER: ['cReactivePower', float, 3],
GRID_TOTAL_CONSUMPTION_POWER: ['familyLoadPower', float, 3],
GRID_TOTAL_CONSUMPTION_POWER_STR: ['familyLoadPowerStr', str, None],
SOC_CHARGING_SET: ['socChargingSet', float, 0],
SOC_DISCHARGE_SET: ['socDischargeSet', float, 0],
BYPASS_LOAD_POWER: ['bypassLoadPower', float, 3],
Expand Down Expand Up @@ -160,8 +162,8 @@
GRID_DAILY_ON_GRID_ENERGY_STR: ['gridSellDayEnergyStr', str, None],
GRID_DAILY_ENERGY_USED: ['homeLoadEnergy', float, 3],
GRID_DAILY_ENERGY_USED_STR: ['homeLoadEnergyStr', str, None],
GRID_TOTAL_CONSUMPTION_POWER: ['familyLoadPower', float, 3],
GRID_TOTAL_CONSUMPTION_POWER_STR: ['familyLoadPowerStr', str, None]
PLANT_TOTAL_CONSUMPTION_POWER: ['familyLoadPower', float, 3],
PLANT_TOTAL_CONSUMPTION_POWER_STR: ['familyLoadPowerStr', str, None]
},
}

Expand Down Expand Up @@ -325,8 +327,6 @@ async def _get_inverter_details(self,

# Get inverter details
params = {
# 'id': device_id,
# 'sn': device_serial
}

result = await self._post_data_json(INVERTER_DETAIL_LIST, params)
Expand Down Expand Up @@ -459,6 +459,7 @@ def _post_process(self) -> None:
self._fix_units(BAT_TOTAL_ENERGY_CHARGED, BAT_TOTAL_ENERGY_CHARGED_STR)
self._fix_units(BAT_TOTAL_ENERGY_DISCHARGED, BAT_TOTAL_ENERGY_DISCHARGED_STR)
self._fix_units(GRID_TOTAL_CONSUMPTION_POWER, GRID_TOTAL_CONSUMPTION_POWER_STR)
self._fix_units(PLANT_TOTAL_CONSUMPTION_POWER, PLANT_TOTAL_CONSUMPTION_POWER_STR)
self._fix_units(GRID_TOTAL_ENERGY_USED, GRID_TOTAL_ENERGY_USED_STR)
self._fix_units(INVERTER_ACPOWER, INVERTER_ACPOWER_STR)
self._fix_units(INVERTER_ENERGY_THIS_MONTH, INVERTER_ENERGY_THIS_MONTH_STR)
Expand Down
1 change: 1 addition & 0 deletions custom_components/solis/soliscloud_const.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@
GRID_YEARLY_ENERGY_PURCHASED_STR = 'yearlyEnergyPurchasedUnit'
GRID_DAILY_ENERGY_USED_STR = 'dailyEnergyUsedUnit'
BYPASS_LOAD_POWER_STR = 'bypassLoadPowerUnit'
PLANT_TOTAL_CONSUMPTION_POWER_STR = 'plantTotalConsumptionPowerUnit'

0 comments on commit df20b76

Please sign in to comment.