Skip to content

Commit

Permalink
Merge pull request #6 from Pho3niX90/feature/storage_mode
Browse files Browse the repository at this point in the history
Feature/storage mode
  • Loading branch information
Pho3niX90 authored Dec 4, 2023
2 parents b2149fa + 4859fd1 commit 03525a5
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 3 deletions.
78 changes: 78 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,84 @@ To install the Solis Modbus Integration, follow these steps:
3. Search for "Solis Modbus"
4. Add in the IP of your inverter in the first box, and port in the second.

# sunsynk solar card setup:
![img_3.png](img_3.png)
```yaml
type: custom:sunsynk-power-flow-card
view_layout:
grid-area: flow
cardstyle: lite
large_font: true
show_solar: true
panel_mode: true
card_height: 415px
inverter:
model: solis
modern: false
colour: '#959595'
autarky: 'no'
solar:
mppts: 2
show_daily: false
colour: '#F4C430'
animation_speed: 9
max_power: 9600
pv1_name: West
pv2_name: North
battery:
energy: 14280
shutdown_soc: 20
show_daily: true
colour: pink
animation_speed: 6
max_power: 6000
load:
show_aux: false
show_daily: true
animation_speed: 8
max_power: 6000
additional_loads: 2
load2_name: Geyser
load2_icon: mdi:heating-coil
load1_name: Pool
load1_icon: mdi:pool
grid:
show_daily_buy: true
no_grid_colour: red
animation_speed: 8
max_power: 6000
invert_grid: true
entities:
dc_transformer_temp_90: sensor.solis_inverter_temperature
day_battery_charge_70: sensor.solis_inverter_today_battery_charge_energy
day_battery_discharge_71: sensor.solis_inverter_today_battery_discharge_energy
day_load_energy_84: sensor.solis_inverter_today_energy_consumption
day_grid_import_76: sensor.solis_inverter_today_energy_imported_from_grid
day_grid_export_77: sensor.solis_inverter_today_energy_fed_into_grid
inverter_voltage_154: sensor.solis_inverter_a_phase_voltage
load_frequency_192: sensor.solis_inverter_grid_frequency
inverter_current_164: sensor.solis_inverter_a_phase_current
inverter_power_175: sensor.solis_inverter_backup_load_power
grid_power_169: sensor.solis_inverter_ac_grid_port_power
battery_voltage_183: sensor.solis_inverter_battery_voltage
battery_soc_184: sensor.solis_inverter_battery_soc
battery_power_190: sensor.solis_inverter_battery_power
battery_current_191: sensor.solis_inverter_battery_current
essential_power: sensor.solis_inverter_backup_load_power
grid_ct_power_172: sensor.solis_inverter_meter_total_active_power
pv1_voltage_109: sensor.solis_inverter_dc_voltage_1
pv1_current_110: sensor.solis_inverter_dc_current_1
pv1_power_186: sensor.solis_inverter_dc_power_1
pv2_power_187: sensor.solis_inverter_dc_power_2
pv_total: sensor.solis_inverter_total_dc_output
pv2_voltage_111: sensor.solis_inverter_dc_voltage_2
pv2_current_112: sensor.solis_inverter_dc_voltage_2
grid_voltage: sensor.solis_inverter_a_phase_voltage
battery_current_direction: sensor.solis_inverter_battery_current_direction
inverter_status_59: sensor.solis_inverter_current_status
remaining_solar: sensor.solcast_pv_forecast_forecast_remaining_today
```
## Tested
**Inverters Tested**
- Solis S6 Pro 6kW Advanced Hybrid Inverter
Expand Down
2 changes: 1 addition & 1 deletion custom_components/solis_modbus/const.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
DOMAIN = "solis_modbus"
CONTROLLER = "modbus_controller"
VERSION = "1.0.5"
VERSION = "1.0.6"
POLL_INTERVAL_SECONDS = 5
2 changes: 1 addition & 1 deletion custom_components/solis_modbus/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"domain": "solis_modbus",
"name": "Solis Modbus",
"version": "1.0.5",
"version": "1.0.6",
"documentation": "https://github.com/Pho3niX90",
"dependencies": [],
"codeowners": ["@pho3nix90"],
Expand Down
21 changes: 20 additions & 1 deletion custom_components/solis_modbus/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,20 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry, asyn
{"type": "SDS", "name": "Solis Inverter Current Status String",
"unique": "solis_modbus_inverter_current_status_string", "decimal_places": 0,
"register": ['33095']},

{"type": "SDS", "name": "Solis Inverter DC Power 1",
"unique": "solis_modbus_inverter_dc_power_1", "device_class": SensorDeviceClass.POWER,
"decimal_places": 1,
"unit_of_measurement": UnitOfPower.WATT,
"state_class": SensorStateClass.MEASUREMENT,
"register": ['33049', '33050']},

{"type": "SDS", "name": "Solis Inverter DC Power 2",
"unique": "solis_modbus_inverter_dc_power_2", "device_class": SensorDeviceClass.POWER,
"decimal_places": 1,
"unit_of_measurement": UnitOfPower.WATT,
"state_class": SensorStateClass.MEASUREMENT,
"register": ['33051', '33052']},
# {
# "type": "SDS", "name": "Solis Inverter Current Status String",
# "unique": "solis_modbus_inverter_current_status_string", "decimal_places": 0,
Expand Down Expand Up @@ -632,9 +646,14 @@ def update(self):
if not self.is_added_to_hass:
return

n_value = round(get_value(self))
n_value = None
if '33095' in self._register:
n_value = round(get_value(self))
n_value = STATUS_MAPPING.get(n_value, "Unknown")
if '33049' in self._register or '33051' in self._register:
r1_value = round(self._hass.data[DOMAIN]['values'][self._register[0]] / (10 ** self._decimal_places))
r2_value = round(self._hass.data[DOMAIN]['values'][self._register[1]] / (10 ** self._decimal_places))
n_value = round(r1_value * r2_value)

self._attr_available = True
self._attr_native_value = n_value
Expand Down
Binary file added img_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 03525a5

Please sign in to comment.