Skip to content

Commit

Permalink
Merge pull request #17 from Pho3niX90/feature/16
Browse files Browse the repository at this point in the history
feat: This commit adds additional sensor entities for Overcharge SOC,…
  • Loading branch information
Pho3niX90 authored Dec 12, 2023
2 parents 53b3ddd + 41da57e commit f9573c4
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 7 deletions.
2 changes: 1 addition & 1 deletion custom_components/solis_modbus/const.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
DOMAIN = "solis_modbus"
CONTROLLER = "modbus_controller"
VERSION = "1.0.10"
VERSION = "1.1.0"
POLL_INTERVAL_SECONDS = 5
MANUFACTURER = "Solis"
MODEL = "S6"
2 changes: 1 addition & 1 deletion custom_components/solis_modbus/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
"issue_tracker": "https://github.com/Pho3niX90/solis_modbus/issues",
"quality_scale": "silver",
"requirements": ["pymodbus==3.5.4"],
"version": "1.0.10"
"version": "1.1.0"
}
17 changes: 13 additions & 4 deletions custom_components/solis_modbus/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,19 @@ async def async_setup_entry(hass, config_entry: ConfigEntry, async_add_devices):
"default": 3000.0, "multiplier": 0.1,
"min_val": 0, "max_val": 6000, "step": 1,
"unit_of_measurement": UnitOfPower.WATT, "enabled": True},
# {"type": "SNE", "name": "Solis Inverter Storage Control Switch Value", "register": 43110,
# "default": 80.0, "multiplier": 1,
# "min_val": 0, "max_val": 100, "step": 1,
# "unit_of_measurement": PERCENTAGE, "enabled": True},

{"type": "SNE", "name": "Solis Overcharge SOC", "register": 43010,
"default": 90, "multiplier": 1,
"min_val": 70, "max_val": 100, "step": 1,
"unit_of_measurement": PERCENTAGE, "enabled": True},
{"type": "SNE", "name": "Solis Overdischarge SOC", "register": 43011,
"default": 20, "multiplier": 1,
"min_val": 5, "max_val": 40, "step": 1,
"unit_of_measurement": PERCENTAGE, "enabled": True},
{"type": "SNE", "name": "Solis Force Charge SOC", "register": 43018,
"default": 10, "multiplier": 1,
"min_val": 0, "max_val": 100, "step": 1,
"unit_of_measurement": PERCENTAGE, "enabled": True}
]

for entity_definition in numbers:
Expand Down
28 changes: 27 additions & 1 deletion custom_components/solis_modbus/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,9 +607,35 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry, asyn
]
},
{
"register_start": 43024,
"register_start": 43011,
"scan_interval": 10,
"entities": [

{"type": "SS", "name": "Solis Overcharge SOC",
"unique": "solis_modbus_inverter_overcharge_soc",
"register": ['43010'],
"decimal_places": 0,
"unit_of_measurement": PERCENTAGE,
"state_class": SensorStateClass.MEASUREMENT},

{"type": "SS", "name": "Solis Overdischarge SOC",
"unique": "solis_modbus_inverter_overdischarge_soc",
"register": ['43011'],
"decimal_places": 0,
"unit_of_measurement": PERCENTAGE,
"state_class": SensorStateClass.MEASUREMENT},

{"type": "reserve", "register": ['43012', '43013', '43014', '43015', '43016', '43017']},

{"type": "SS", "name": "Solis Force Charge SOC",
"unique": "solis_modbus_inverter_force_charge_soc",
"register": ['43018'],
"decimal_places": 0,
"unit_of_measurement": PERCENTAGE,
"state_class": SensorStateClass.MEASUREMENT},

{"type": "reserve", "register": ['43019', '43020', '43021', '43022', '43023']},

{"type": "SS", "name": "Solis Backup SOC",
"unique": "solis_modbus_inverter_backup_soc",
"register": ['43024'],
Expand Down

0 comments on commit f9573c4

Please sign in to comment.