Skip to content

Commit

Permalink
Extra sensors
Browse files Browse the repository at this point in the history
Added sensors: Grid Apparent power, Grid Reactive power, Grid total consumption power and grid active power. The Grid active power on each phase is not implemented now in SolisCloud server, but should be fixed by November.
  • Loading branch information
artarus committed Oct 19, 2023
1 parent 556a03a commit 1f00015
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 4 deletions.
74 changes: 74 additions & 0 deletions custom_components/solis/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
ENERGY_KILO_WATT_HOUR,
ENERGY_MEGA_WATT_HOUR,
POWER_WATT,
POWER_VOLT_AMPERE_REACTIVE,
POWER_VOLT_AMPERE,
ELECTRIC_CURRENT_AMPERE,
DEVICE_CLASS_CURRENT,
DEVICE_CLASS_ENERGY,
Expand Down Expand Up @@ -479,6 +481,78 @@
STATE_CLASS_TOTAL_INCREASING,
GRID_TOTAL_ENERGY_USED
],
'gridphase1power': [
'Grid Phase1 Power',
POWER_WATT,
'mdi:home-import-outline',
DEVICE_CLASS_POWER,
STATE_CLASS_MEASUREMENT,
GRID_PHASE1_POWER
],
'gridphase2power': [
'Grid Phase2 Power',
POWER_WATT,
'mdi:home-import-outline',
DEVICE_CLASS_POWER,
STATE_CLASS_MEASUREMENT,
GRID_PHASE2_POWER
],
'gridphase3power': [
'Grid Phase3 Power',
POWER_WATT,
'mdi:home-import-outline',
DEVICE_CLASS_POWER,
STATE_CLASS_MEASUREMENT,
GRID_PHASE3_POWER
],
'gridapparentphase1power': [
'Grid Phase1 Apparent Power',
POWER_VOLT_AMPERE,
'mdi:home-import-outline',
None,
STATE_CLASS_MEASUREMENT,
GRID_APPARENT_PHASE1_POWER
],
'gridapparentphase2power': [
'Grid Phase2 Apparent Power',
POWER_VOLT_AMPERE,
'mdi:home-import-outline',
None,
STATE_CLASS_MEASUREMENT,
GRID_APPARENT_PHASE2_POWER
],
'gridapparentphase3power': [
'Grid Phase3 Apparent Power',
POWER_VOLT_AMPERE,
'mdi:home-import-outline',
None,
STATE_CLASS_MEASUREMENT,
GRID_APPARENT_PHASE3_POWER
],
'gridreactivephase1power': [
'Grid Phase1 Reactive Power',
POWER_VOLT_AMPERE_REACTIVE,
'mdi:home-import-outline',
None,
STATE_CLASS_MEASUREMENT,
GRID_REACTIVE_PHASE1_POWER
],
'gridreactivephase2power': [
'Grid Phase2 Reactive Power',
POWER_VOLT_AMPERE_REACTIVE,
'mdi:home-import-outline',
None,
STATE_CLASS_MEASUREMENT,
GRID_REACTIVE_PHASE2_POWER
],
'gridreactivephase3power': [
'Grid Phase3 Reactive Power',
POWER_VOLT_AMPERE_REACTIVE,
'mdi:home-import-outline',
None,
STATE_CLASS_MEASUREMENT,
GRID_REACTIVE_PHASE3_POWER
],
'batstateofhealth': [
'Battery State Of Health',
PERCENTAGE,
Expand Down
9 changes: 9 additions & 0 deletions custom_components/solis/ginlong_const.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,15 @@
GRID_TOTAL_CONSUMPTION_POWER = 'totalConsumptionPower'
GRID_TOTAL_ENERGY_PURCHASED = 'totalEnergyPurchased'
GRID_TOTAL_ENERGY_USED = 'totalEnergyUsed'
GRID_PHASE1_POWER = 'Phase1Power'
GRID_PHASE2_POWER = 'Phase2Power'
GRID_PHASE3_POWER = 'Phase3Power'
GRID_APPARENT_PHASE1_POWER = 'ApparentPhase1Power'
GRID_APPARENT_PHASE2_POWER = 'ApparentPhase2Power'
GRID_APPARENT_PHASE3_POWER = 'ApparentPhase3Power'
GRID_REACTIVE_PHASE1_POWER = 'ReactivePhase1Power'
GRID_REACTIVE_PHASE2_POWER = 'ReactivePhase2Power'
GRID_REACTIVE_PHASE3_POWER = 'ReactivePhase3Power'
SOC_CHARGING_SET = 'socChargingSet'
SOC_DISCHARGE_SET = 'socDischargeSet'
BYPASS_LOAD_POWER = 'bypassLoadPower'
17 changes: 13 additions & 4 deletions custom_components/solis/soliscloud_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,21 @@
GRID_TOTAL_ON_GRID_ENERGY_STR: ['gridSellTotalEnergyStr', str, None],
GRID_TOTAL_POWER: ['psum', float, 3],
GRID_TOTAL_POWER_STR: ['psumStr', str, None],
GRID_TOTAL_CONSUMPTION_POWER: ['familyLoadPower', float, 3],
GRID_TOTAL_CONSUMPTION_POWER_STR: ['familyLoadPowerStr', str, None],
GRID_TOTAL_ENERGY_USED: ['homeLoadTotalEnergy', float, 3],
GRID_TOTAL_ENERGY_USED_STR: ['homeLoadTotalEnergyStr', str, None],
GRID_PHASE1_POWER: ['pA', float, 3],
GRID_PHASE2_POWER: ['pB', float, 3],
GRID_PHASE3_POWER: ['pC', float, 3],
GRID_APPARENT_PHASE1_POWER: ['aLookedPower', float, 3],
GRID_APPARENT_PHASE2_POWER: ['bLookedPower', float, 3],
GRID_APPARENT_PHASE3_POWER: ['cLookedPower', float, 3],
GRID_REACTIVE_PHASE1_POWER: ['aReactivePower', float, 3],
GRID_REACTIVE_PHASE2_POWER: ['bReactivePower', float, 3],
GRID_REACTIVE_PHASE3_POWER: ['cReactivePower', float, 3],
SOC_CHARGING_SET: ['socChargingSet', float, 0],
SOC_DISCHARGE_SET: ['socDischargeSet', float, 0],
BYPASS_LOAD_POWER: ['bypassLoadPower', float, 3],
BYPASS_LOAD_POWER_STR: ['bypassLoadPowerStr', str, None],
BYPASS_LOAD_POWER_STR: ['bypassLoadPowerStr', str, None]
},
PLANT_DETAIL: {
INVERTER_PLANT_NAME: ['sno', str, None], #stationName no longer available?
Expand All @@ -142,7 +149,9 @@
GRID_DAILY_ON_GRID_ENERGY: ['gridSellDayEnergy', float, 3],
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_DAILY_ENERGY_USED_STR: ['homeLoadEnergyStr', str, None],
GRID_TOTAL_CONSUMPTION_POWER: ['familyLoadPower', float, 3],
GRID_TOTAL_CONSUMPTION_POWER_STR: ['familyLoadPowerStr', str, None]
},
}

Expand Down

0 comments on commit 1f00015

Please sign in to comment.