Controlling Solis Inverters With Home Assistant

Our general setting for the house prioritises energy use as follows :

Solar » Battery » Grid

This means we minimise our usage of the grid when possible.

Given the cheap rate period of energy usage through the night, we had manually set the inverter to charge the battery from the grid during the core hours 23:30 - 05:30. This effectively stops the battery from being used to power the house in that period and we have no solar in that period bar the peak summer months.

However, Octopus Go occasionally gives “cheap” energy slots for charging the car away from the core 11:30-05:30 am slot. If we are in the daytime setting described above then the battery will discharge during this period. If the battery depletes far enough, it can leave us short in later periods and cause us to use peak rate high carbon energy.

In Home Assistant I’ve been using the excellent Home Assistant Octopus Energy integration from BottlecapDave - Overview

Using the entity of the form Octopus Energy A-XXXXXX Intelligent Dispatching it is possible to detect start/stop times of planned charge events from Octopus. You can see the next planned slots using a template like this

{{state_attr('binary_sensor.octopus_energy_a_xxxxxxx_intelligent_dispatching','completed_dispatches')[0].start }}

{{state_attr('binary_sensor.octopus_energy_a_xxxxxxx_intelligent_dispatching','completed_dispatches')[0].end }}

Some great pointers from Octopus Intelligent Smart Charge Picture Elementson the home assistant forums helped me along the way here.

As discussed before, my home assistant integration to control my Solis inverter is via the Solarman Plugin This includes a service to “poke” values into the inverter via modbus.

Finding the correct registers to write these values to is painful. I’ve struggled to find accurate information from the manufacturer, so I resorted to using modbus reading tools and manually making changes on the inverter to add interesting stop/start times that I could then search for in the register dump. I found a few starting points for where to look like here.

YOU NEED TO BE CERTAIN THAT YOU ARE WRITING TO THE CORRECT REGISTERS. If you mess this up, it is possible damage/make the inverter unsafe. Don’t do this unless you are sure, I’m illustrating what I have done and the is no endorsement that it will work safely for you.

For me the charge hour start address is at 43143, the start minute 43144. Stop time is 43145 and 43146 respectively. You can use the service directly in automations however, I wanted a little more control (especially over some of the calculations). So I used the Python script integration to call the services after pulling the data out in Python.

service_data = { "register" : 43143, "value" : charge_start_hour}
hass.services.call("solarman", "write_holding_register", service_data, False)
service_data = { "register" : 43144, "value" : charge_start_min}
hass.services.call("solarman", "write_holding_register", service_data, False)
service_data = { "register" : 43145, "value" : charge_end_hour}
hass.services.call("solarman", "write_holding_register", service_data, False)
service_data = { "register" : 43146, "value" : charge_end_min}
hass.services.call("solarman", "write_holding_register", service_data, False)

NB. Remember to reset these registers after the period, or you’ll use energy in these periods again the following day!

This is as simple as setting all four registers to zero.