Skip to content

Control Solis inverters using the Solis Cloud API - includes a Home Assistant pyscript app for the Octopus Flux tariff

License

Notifications You must be signed in to change notification settings

aspeakman/SolisControl

Repository files navigation

SolisControl

A Python package soliscontrol which has modules for controlling a Solis battery/inverter setup using the Solis Cloud API. This can be used to view key inverter parameters and to set daily charge times (within a cheap rate period) or discharge times (within a peak rate period). It will also check that times are synchronised with the inverter and that charge currents do not exceed the configured maxima.

The project also includes solis_flux_times a Pyscript Home Assistant app for use with energy suppliers that offer cheap rate charging periods and peak rate discharging periods such as the Octopus Flux tariff. For details see README2.

This project is based on the Solis API docs for monitoring and control (and on the solis_control project which has the practical details for constructing requests to the Solis API).

Pre-requisites

You should access the Solis Cloud API by following these instructions. Based on the values returned you will need to create a secrets.yaml - replace xxxx in the following example:

solis_key_id: "xxxx"
solis_key_secret: "xxxx"
solis_user_name: "xxxx"
solis_password: "xxxx"
solis_station_id: "xxxx"

On your inverter you will also need to enable Self Use mode and set Time of Use: Optimal Income to Run - see https://www.youtube.com/watch?v=h1A80cSOrhA

Configuration

Put your secrets.yaml in the soliscontrol folder then edit main.yaml to suit - an example as follows:

battery_capacity: 7.1 # in kWh - nominal stored energy of battery at 100% SOC (eg 2 * Pylontech US3000C with Nominal Capacity of 3.55 kWh each)
battery_max_current: 74 # in amps (eg 2 * Pylontech US3000C with spec Recommend Charge Current of 37A each)
# Also see https://www.youtube.com/watch?v=h1A80cSOrhA to view battery Dis/Charging Current Limits
inverter_max_current: 62.5 # in amps - see inverter datasheet specs for 'Max. charge / discharge current'  (eg 62.5A or 100A)
#api_url: = 'https://www.soliscloud.com:13333' # default
charge_period: # First period when energy can be imported from the grid at low rates
  start: "02:01"
  end: "04:59" 
  current: 50 # charge current setting in amps
  sync: 'random' # if 'start', charging is tied to start of period or if 'end' it is tied to the end (otherwise it starts randomly)
discharge_period: # First period when energy can be exported to the grid at high rates
  start: "16:01" # set both to "00:00" if no discharging
  end: "18:59" # set both to "00:00" if no discharging
  current: 50 # discharge current setting in amps
  sync: 'start' # if 'start', discharging is tied to start of period or if 'end' it is tied to the end (otherwise it starts randomly)

Note there can be up to 3 charge_periods and 3 discharge periods with different start and end times. As well as charge_period and discharge_period you could also define charge_period2, charge_period3, discharge_period2 and discharge_period3 in the example above.

Actions

Use the solis_run.py module. You should save your secrets.yaml in the same folder.

To get help:

python solis_run.py -h

To get inverter status information:

python solis_run.py

To set inverter charge and discharge times for the periods above to one hour per day:

python solis_run.py -c1 60 -d1 60

To turn inverter charge and discharge times off:

python solis_run.py -c1 0 -d1 0

If charge_period3 was configured, you could clear all existing settings and then set timeslot 3 to charge for one hour like this:

python solis_run.py -r -c3 60

About

Control Solis inverters using the Solis Cloud API - includes a Home Assistant pyscript app for the Octopus Flux tariff

Topics

Resources

License

Stars

Watchers

Forks