Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial documentation for Solis inverters #308

Merged
merged 10 commits into from
Dec 10, 2023
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Introduction

Home battery prediction and automatic charging for Home Assistant with GivTCP
Home battery prediction and automatic charging for Home Assistant

Also known by some as Batpred or Batman!

Expand All @@ -21,7 +21,7 @@ It also explains how you can contribute to the project.

## Support

For support please raise a Github ticket or use the [GivTCP Facebook page](https://www.facebook.com/groups/615579009972782).
For support please raise a Github ticket or use the [GivTCP](https://www.facebook.com/groups/615579009972782) or [Solis](https://www.facebook.com/groups/288045168816481) Facebook Groups.

```text
Copyright (c) Trefor Southwell October 2023 - All rights reserved
Expand Down
75 changes: 37 additions & 38 deletions docs/config-yml-settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Basic configuration items

## Inverter information

The following are entity names in HA for GivTCP, assuming you only have one inverter and the entity names are standard then it will be auto discovered
The following are entity names in HA for GivTCP, assuming you only have one inverter and the entity names are standard then it will be auto discovered. For other brands of inverter see [Other Inverters](other-inverters.md)

- **num_inverters** - If you increase this above 1 you must provide multiple of each of these entities
- **geserial** - This is a helper regular expression to find your serial number, if it doesn't work edit it manually or change individual entities to match:
Expand All @@ -23,20 +23,20 @@ The following are entity names in HA for GivTCP, assuming you only have one inve

### Data from GivTCP

It's recommended you get this data from GivTCP, there are also controls for load_scaling and import_export_scaling if they need scale adjustments
It's recommended you get this data from GivTCP, there are also controls for load_scaling and import_export_scaling if they need scale adjustments

- **load_today** - GivTCP Entity name for the house load in kWh today (must be incrementing)
- **load_today** - GivTCP Entity name for the house load in kWh today (must be incrementing)
- **import_today** - GivTCP Imported energy today in kWh (incrementing)
- **export_today** - GivTCP Exported energy today in kWh (incrementing)
- **pv_today** - GivTCP PV energy today in kWh (incrementing)
- **pv_today** - GivTCP PV energy today in kWh (incrementing)

### GivEnergy Cloud Data

If you have an issue with the GivTCP data you can get this historical data from the GivEnergy cloud instead. This data is updated every 30 minutes
If you have an issue with the GivTCP data you can get this historical data from the GivEnergy cloud instead. This data is updated every 30 minutes

- **ge_cloud_data** - When True use the GE Cloud for data rather than load_today, import_today and export_today
- **ge_cloud_data** - When True use the GE Cloud for data rather than load_today, import_today and export_today
- **ge_cloud_serial** - Set the inverter serial number to use for the Cloud data
- **ge_cloud_key** - Set to your API Key for GE Cloud (long string)
- **ge_cloud_key** - Set to your API Key for GE Cloud (long string)

## Inverter control

Expand Down Expand Up @@ -122,14 +122,14 @@ Predbat also include the daily standing charge in cost predictions (optional)
Or manually set your rates in a 24-hour period using these:

```yaml
rates_import:
- start : "HH:MM:SS"
end : "HH:MM:SS"
rate : pence
rates_export:
- start : "HH:MM:SS"
end : "HH:MM:SS"
rate : p
rates_import:
- start: "HH:MM:SS"
end: "HH:MM:SS"
rate: pence
rates_export:
- start: "HH:MM:SS"
end: "HH:MM:SS"
rate: p
```

**start** and **end** are in time format of "HH:MM:SS" e.g. "12:30:00" and should be aligned to 30 minute slots normally.
Expand All @@ -138,16 +138,14 @@ rate is in pence e.g. 4.2
You can also override the energy rates (regardless of if they are set manually or via Octopus) using the override feature.
The override is used to set times where rates are different, e.g. an Octopus Power Up session (zero rate for an hour or two)

rates_import_override:
- start : "HH:MM:SS"
end : "HH:MM:SS"
rate : p
date : "YYYY-MM-DD"
rates_export_override:
- start : "HH:MM:SS"
end : "HH:MM:SS"
rate : p
date : "YYYY-MM-DD"
rates_import_override: - start : "HH:MM:SS"
end : "HH:MM:SS"
rate : p
date : "YYYY-MM-DD"
rates_export_override: - start : "HH:MM:SS"
end : "HH:MM:SS"
rate : p
date : "YYYY-MM-DD"

**date** is in date format of "YYYY-MM-DD" e.g. "2023-09-09"

Expand Down Expand Up @@ -186,13 +184,14 @@ Connect to your cars sensors for accurate data:
Control how your battery behaves during car charging:

- **car_charging_from_battery** - When True the car can drain the home battery, Predbat will manage the correct level of battery accordingly. When False home battery discharge will be prevented when your car charges, all load from the car and home will be from the grid. This is achieved by setting the discharge rate to 0 during car charging and to the maximum otherwise, hence if you turn this switch Off you won't be able to change your discharge rate outside Predbat. The home battery can still charge from the grid/solar in either case. Only use this if Predbat knows your car charging plan, e.g. you are using Intelligent Octopus or you use the car slots in Predbat to control your car charging.
- CAUTION: If you turn this switch back on during a car charging session you will need to set your battery discharge rate back to maximum manually.

- CAUTION: If you turn this switch back on during a car charging session you will need to set your battery discharge rate back to maximum manually.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The proper Markdown spec is to have 4 spaces (or a tab) for an indented list, I think you've changed this plus some others to 2.

I went through them all when I redid the docs and set them all to 4 (GitHub was fairly forgiving, and would work with 2).

And if it did with with mkdocs, that'll be because fairly late on I added the sane lists extension, as one of the original lists wasn't working with the strict implementation of Markdown spec.


- Multiple cars can be planned with Predbat, in which case you should set **num_cars** in apps.yaml to the number of cars you want to plan
- **car_charging_limit**, **car_charging_planned**, **car_charging_battery_size** and **car_charging_soc** must then be a list of values (e.g. 2 entries for 2 cars)
- If you have Intelligent Octopus then Car 0 will be managed by Octopus Energy plugin if enabled
- Each car will have it's own slot sensor created **predbat_car_charging_slot_1** for car 1
- Each car will have it's own SOC planning sensor created e.g **predbat.car_soc_1** and **predbat.car_soc_best_1** for car 1
- **car_charging_limit**, **car_charging_planned**, **car_charging_battery_size** and **car_charging_soc** must then be a list of values (e.g. 2 entries for 2 cars)
- If you have Intelligent Octopus then Car 0 will be managed by Octopus Energy plugin if enabled
- Each car will have it's own slot sensor created **predbat_car_charging_slot_1** for car 1
- Each car will have it's own SOC planning sensor created e.g **predbat.car_soc_1** and **predbat.car_soc_best_1** for car 1

## Workarounds

Expand Down Expand Up @@ -230,21 +229,21 @@ The triggers count export energy until the next active charge slot only.

For each trigger give a name, the minutes of export needed and the energy required in that time
Multiple triggers can be set at once so in total you could use too much energy if all run
Each trigger create an entity called 'binary_sensor.predbat_export_trigger_<name>' which will be turned On when the condition is valid
Each trigger create an entity called 'binary*sensor.predbat_export_trigger*<name>' which will be turned On when the condition is valid
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo, the star should be before binary?

connect this to your automation to start whatever you want to trigger.

Set the name for each trigger, the number of minutes of solar export you need and the amount of energy in kwH you will need available during that time period.

For example:

```yaml
export_triggers:
- name: 'large'
minutes: 60
energy: 1.0
- name: 'small'
minutes: 15
energy: 0.25
export_triggers:
- name: "large"
minutes: 60
energy: 1.0
- name: "small"
minutes: 15
energy: 0.25
```

If you wish to trigger based on charging or discharging the battery rather than spare solar energy you can instead use the following binary sensors
Expand Down
2 changes: 2 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ For support please raise a Github ticket or use the GivTCP Facebook page:

[https://www.facebook.com/groups/615579009972782](https://www.facebook.com/groups/615579009972782)

For support specific to the Solis inverter you can use the [Solis Facebook Group:](https://www.facebook.com/groups/288045168816481).

If you want to buy me a beer then please use Paypal - [tdlj@tdlj.net](mailto:tdlj@tdlj.net)
![image](https://github.com/springfall2008/batpred/assets/48591903/b3a533ef-0862-4e0b-b272-30e254f58467)

Expand Down
24 changes: 15 additions & 9 deletions docs/install.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
# Install

## GivTCP install
## Inverter Control Integration install (GivTCP/SolaX-ModBus)

- You must have GivTCP installed and running first ([https://github.com/britkat1980/giv_tcp](https://github.com/britkat1980/giv_tcp))
- You will need at least 24 hours history in HA for this to work correctly, the default is 7 days (but you configure this back 1 day if you need to)
The Integration that communicates with your inverter will be dependen on the brand:

| Brand | Integration | Github Link |
| :-------- | :----------- | :------------------------------------------------------------------------------- |
| GivEnergy | GivTCP | [https://github.com/britkat1980/giv_tcp](https://github.com/britkat1980/giv_tcp) |
| Solis | SolaX ModBus | https://github.com/wills106/homeassistant-solax-modbus |

- You will need at least 24 hours history in HA for this to work correctly, the default is 7 days (but you configure this back 1 day if you need to)

## AppDaemon install

- Install AppDaemon add-on [https://github.com/hassio-addons/addon-appdaemon](https://github.com/hassio-addons/addon-appdaemon)
- Set the **time_zone** correctly in appdaemon.yml (e.g. Europe/London)
- Add **thread_duration_warning_threshold: 30** to the appdaemon.yml file in the appdaemon section
- Set the **time_zone** correctly in appdaemon.yml (e.g. Europe/London)
- Add **thread_duration_warning_threshold: 30** to the appdaemon.yml file in the appdaemon section

## HACS install

Expand All @@ -25,11 +31,11 @@
- Add https://github.com/springfall2008/batpred as a custom repository of type 'AppDaemon'
- Click on the Repo and Download the app

*After an update with HACS you may need to reboot AppDaemon as it sometimes reads the config wrongly during the update (If this happens you will get a template configuration error).*
_After an update with HACS you may need to reboot AppDaemon as it sometimes reads the config wrongly during the update (If this happens you will get a template configuration error)._

- Edit in HomeAssistant config/appdaemon/apps/predbat/config/apps.yml to configure
- You must delete the 'template: True' line in the configuration to enable Predbat once you are happy with your configuration
- Note that future updates will not overwrite apps.yml, but you may need to copy settings for new features across manually
- You must delete the 'template: True' line in the configuration to enable Predbat once you are happy with your configuration
- Note that future updates will not overwrite apps.yml, but you may need to copy settings for new features across manually

## Predbat manual install

Expand All @@ -45,7 +51,7 @@

Predbat needs a solar forecast in order to predict battery levels.

If you don't have solar then comment out the Solar forecast part of the apps.yml: **pv_forecast_* **
If you don't have solar then comment out the Solar forecast part of the apps.yml: **pv*forecast*\* **
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why star's in place of underscore?


- Make sure Solcast is installed and working (https://github.com/oziee/ha-solcast-solar)

Expand Down
26 changes: 26 additions & 0 deletions docs/other-inverters.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
## Other Inverters

PredBat was originally written for GivEnergy inverters using the GivTCP integration but this is now being extended to othert models:

- Solis Hybrid inverters [Solax Modbus integration](https://github.com/wills106/homeassistant-solax-modbus)
- Solax Gen4 inverters [Solax Modbus integration](https://github.com/wills106/homeassistant-solax-modbus) in Modbus Power Control Mode\*
- SolarEdge inverters\*

\*Work in progress

Note that support for all these inverters is in various stages of development. Please expect things to fail and report them as Issues on Github. Please also ensure you have set up enhanced logging in AppDaemon as described here

### Solis Inverters

To run PredBat with Solis hybrid inverters, follow the following steps:

1. Install PredBat as per the [Installation Summary](installation-summary.md)
2. Ensure that you have the Solax Modbus integration running. There are a number of entities which this integration disables by defaul that you will need to enable via the Home Assistant GUI:

| Name | Description |
| :---------------------------- | :-------------- |
| `sensor.solisx_rtc` | Real Time Clock |
| `sensor.solisx_battery_power` | Battery Power |

3. Instead of `apps.yaml` use `ginlong_solis.yaml` from this Repo as your starting template. The majority of settings should be correct but please cleck. You will need to un-comment the `template` line to enable it. Save it to the `config/appdaemon/apps/predbat/config` folder.
4. Ensure that the inverter is set Control Mode 35 - on the Solax integration this is `Timed Charge/Discharge`. If you want to use the `Reserve` functionality within PredBat you will need to select `Backup/Reserve` (code 51) instead but be aware that this is not fully tested. In due course these mode settings will be incorporated into the code.
6 changes: 3 additions & 3 deletions docs/what-does-predbat-do.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# What does Predbat do?

The app runs every N minutes (default 5), it will automatically update its prediction for the home battery levels for the next period, up to a maximum of 48 hours. It will automatically find charging slots (up to 10 slots) and if enabled configure them automatically with GivTCP. It uses the solar production forecast from Solcast combined with your historical energy use and your plan charging slots to make a prediction. When enable it will tune the charging percentage (SOC) for each of the slots to achieve the lowest cost possible.
The app runs every N minutes (default 5), it will automatically update its prediction for the home battery levels for the next period, up to a maximum of 48 hours. It will automatically find charging slots (up to 10 slots) and if enabled configure them automatically with the inverter using GivTCP or, for Solis inverters, the SolaX Modbus integration. It uses the solar production forecast from Solcast combined with your historical energy use and your plan charging slots to make a prediction. When enable it will tune the charging percentage (SOC) for each of the slots to achieve the lowest cost possible.

- The output is a prediction of the battery levels, charging slots, discharging slots, costs and import and export amounts.
- Costs are based on energy pricing data, either manually configured (e.g. 7p from 11pm-4pm and 35p otherwise) or by using the Octopus Plugin
- Both import and export rates are supported.
- Intelligent Octopus is also supported and takes into account allocated charging slots.
- Both import and export rates are supported.
- Intelligent Octopus is also supported and takes into account allocated charging slots.
- The solar forecast used is the central scenario from Solcast but you can also add weighting to the 10% (worst case) scenario, the default is 20% weighting to this.
- The SOC calculation can be adjusted with a safety margin (minimum battery level, extra amount to add and pence threshold).
- The charging windows and charge level (SOC) can be automatically programmed into the inverter.
Expand Down
4 changes: 1 addition & 3 deletions ginlong_solis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pred_bat:
prefix: predbat

# XXX: This is a configuration template, delete this line once you edit your configuration
# template: True
template: True

# Timezone to work in
timezone: Europe/London
Expand All @@ -16,14 +16,12 @@ pred_bat:
# however if you have two inverters only set one of them as they will both read the same.
#


inverter_type: "GS"
num_inverters: 1
#
# Controls/status - must by 1 per inverter
#


# Max inverter power from battery
battery_rate_max:
- 3600
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ nav:
- creating-charts.md
- predbat-plan-card.md
- 'Predbat development':
- other-inverters.md
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I'd add this in another section, rather than in the section on developing on Predbat, as it's not really developer content.

- todo-list.md
- developing.md
markdown_extensions:
Expand Down