From 40982497e2c4779dcea785d670b653baf929d52f Mon Sep 17 00:00:00 2001 From: fboundy Date: Sun, 27 Nov 2022 15:28:42 +0000 Subject: [PATCH] v1.1.0 --- README.md | 66 ++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 51 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 4ecc58b..9e04d6e 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,13 @@ # ha_solis_modbus -

Home Assistant YAML for Solis Hybrid Inverter using MODBUS

+

Home Assistant YAML for Solis Hybrid Inverter using MODBUS

This is a Home Assistant YAML file for communicating with a Solis Hybrid inverter using a DLS-L LAN Data Logging Stick which uses pure Modbus over TCP. It has been tested using a stick with Serial number 1920xxxxxx and a Solis 5-eh1p(3-6)k inverter. -The YAML file which can be included in the configuration.yaml file in the Home Assitant config folder. All that should need changing is the solis_ip secret which is included from secrets.yaml. Alternatively just overwrite with the IP address. +v1.1.0 now also supports writing to the inverter using a number of Automations. Scripts and Inputs. + +

Reading from the Inverter

+ +The YAML file which can be included in the `configuration.yaml` file in the Home Assitant `config` folder. All that should need changing is the `solis_ip` secret which is included from `secrets.yaml`. Alternatively just overwrite with the IP address. Scan intervals are set as follows: @@ -11,25 +15,57 @@ Scan intervals are set as follows: - Daily totals: 5 minutes - Monthly, Yearly and Lifetime totals: 1 hour - -There is also a single template sensor which negates the grid power so that export is negative and import is positive - mainly for presentation purposes. configuation.yaml will therefore contain: +Include this file in your `configuation.yaml` file with: modbus: !include solis.yaml - + +A fairly comprehensive set of both the input registers (33xxx) and holding registers (43xxx) is read. Other registers can be imported using the same format. A full list can be found [here](https://www.scss.tcd.ie/Brian.Coghlan/Elios4you/RS485_MODBUS-Hybrid-BACoghlan-201811228-1854.pdf) courtesy of Dr. Brian Coghlan. Note that some parameters are 32 bit and span two registers. Also note that 16 bit parameters can be signed (int16) or unsigned (uint16). More information on the Home Asistant Modbus integration can be found [here](https://www.home-assistant.io/integrations/modbus/). + +

Writing to the Inverter

+This is done with a service call to the modbus integration. For example, to set the Timed Discharge Current Limit (register) to 50A: + + service: modbus.write_register + data: + address: 43141 + slave: 1 + value: 500 + hub: solis + +The following scripts are included in `scripts.yaml` to assit with this: + +- Solis Write Holding Register: writes `value` to `address` +- Solis Set Charge Current: sets the Timed Charge Current (Register 43131) to `current` +- Solis Set Eco7 Times: sets the 1st set of Timed Charging Times (Registers 43143 - 6) to the times specified by the `input_datetime` enties: `economy_7_start` and `economy_7_start` +- Solis Set Energy Storage Mode: sets the Energy Storage Control Switch(Register 43110) to that specified by the six `input_boolean` entites `solis_storage_mode_*` +- Set Solis Storage Toggles: sets the six `input_boolean` entites `solis_storage_mode_*` to match the values read from the inverter if they change (e.g. they are set manually on the inverter itself) + +

Template Sensors

+ +There are also a number of template sensors some of which are just helpers but others are needed for some of the scripting below and rely on certain input entities (see below). These are included in a separate file `solis-templates.yaml` these can be included into your `configuation.yaml` file with the below. Alternatively you may wish to merge them into the file directly: + template: - sensor: - name: "Solis Grid Active Power (Negative)" - unique_id: "Solis Grid Active Power (Negative)" - unit_of_measurement: W - device_class: power - state_class: measurement - state: >- - {{ -1 * states('sensor.solis_grid_active_power') | float }} + !include solis-templates.yaml + +

Inputs

+ +A number of helpers are needed for the scripts and automations included below. These are included in `inputs.yaml`. As with the other `.yaml` files they need to be either merged or included into your `configuation.yaml`. The inputs are as follows: -Other registers can be imported using the same format. A full list can be found [here](https://www.scss.tcd.ie/Brian.Coghlan/Elios4you/RS485_MODBUS-Hybrid-BACoghlan-201811228-1854.pdf) courtesy of Dr. Brian Coghlan. + - Economy 7 Start Time: `input_boolean.economy_7_start` + - Economy 7 End Time: `input_boolean.economy_7_end` + - Solis Storage Mode toggles which set the following bits of the Energy Storage Control Switch: + + Bit 0 (1) - Spontaneous Mode input_boolean.solis_storage_mode_spontaneous + Bit 1 (2) - Timed Mode input_boolean.solis_storage_mode_timed + Bit 2 (4) - Off-Grid Mode input_boolean.solis_storage_mode_off_grid + Bit 3 (8) - Battery Wake-Up Mode input_boolean.solis_storage_mode_wake_up + Bit 4 (16) - Backup Mode input_boolean.solis_storage_mode_backup + Bit 5 (32) - Grid Charge Mode input_boolean.solis_storage_mode_grid_charge + +

Utilities

-Also included is a small Python script which will check modbus communications and, if all is well, will report back Inverter Temperature, Grid Voltage and Batter SOC: + +Also included is a small Python script `modbus_test.py` 2hich will check modbus communications and, if all is well, will report back Inverter Temperature, Grid Voltage and Battery SOC: Inverter Temperature: 30.3 C Grid Voltage: 243.3 V