Skip to content

Commit

Permalink
Merge pull request fboundy#6 from finalbillybong/main
Browse files Browse the repository at this point in the history
Add automation to set SOC estimate for overnight charging.
  • Loading branch information
fboundy authored Oct 21, 2023
2 parents a32be03 + 37e8762 commit 472136f
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

<H2>Home Assistant YAML for Solis Hybrid Inverter using MODBUS</H2>

This forked from https://github.com/fboundy/ha_solis_modbus and includes automations to estimate an overnight target SOC to ensure enough power to run your house until the sun comes out while also leaving maximum space in your battery for energy capture.

Fill in the three input numbers for charge, and set your usable battery capacity and solar prediction entity_id in the template sensor.

Requires forcast.solar integration: https://www.home-assistant.io/integrations/forecast_solar/

I plan to add support for setting battery discharge times and current to accomodate people who are on the new Octopus Flux tariff. Everything is written for this and being tested now. I should be able to upload in the next week or so.


-------------------------------------------------------------------------------------------------------------------------------------------------------------

This is a Home Assistant YAML file for communicating with a Solis Hybrid inverter using a Data Logging Stick which uses pure Modbus over TCP. It has been tested using a Solis 5-eh1p(3-6)k inverter and:

- DLS-LAN stick: Serial number 1920xxxxxx [as shown here](https://tenergise.co.uk/product/solis-data-logging-stick/)
Expand Down
21 changes: 21 additions & 0 deletions eco7-automations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,24 @@ automations:
- service: script.solis_set_eco7_times
data: {}
mode: single

- id: '1678731184170'
alias: Set Target SOC for Overnight Charging
description: ''
trigger:
- platform: time
at: 00:28:00
condition:
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
action:
- service: input_number.set_value
entity_id: input_number.eco7_target_soc
data:
value: '{{ states(''sensor.target_battery_charge_weekday'') | int(0) }}'
mode: single
27 changes: 27 additions & 0 deletions inputs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,30 @@ input_number:
max: 100
step: 1
icon: mdi:battery

end_of_day_charge_required:
name: End of Day Charge Required
mode: box
unit_of_measurement: "kWh"
min: 0
max: 13
step: 0.5
icon: mdi:home-battery

start_of_day_charge_required:
name: Start of Day Charge Required
mode: box
unit_of_measurement: "kWh"
min: 0
max: 13
step: 0.5
icon: mdi:home-battery

daytime_charge_required:
name: Day Time Charge Required
mode: box
unit_of_measurement: "kWh"
min: 0
max: 13
step: 0.5
icon: mdi:home-battery
19 changes: 19 additions & 0 deletions solis-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,22 @@ template:
state: >-
{% set state = states.sensor.solis_battery_current_direction.state | int %}
{{ states('sensor.solis_battery_power') | float(2) if state > 0 else 0 }}
name: 'Target Battery Charge Weekday'
unique_id: 'sensor.target_battery_charge_weekday'
unit_of_measurement: '%'
icon: mdi:battery-90
state: >
{% set charge_end = states('input_number.end_of_day_charge_required') | float %}
{% set charge_now = states('input_number.start_of_day_charge_required') | float %}
{% set home_consumption = states('input_number.daytime_charge_required') | float %}
{% set forecast = states('sensor.energy_production_today') | float %}
{% set capacity = 13 %}
{% set target_charge = ((charge_end + charge_now + home_consumption - forecast) / capacity) * 100 %}
{% if target_charge < 32 %}
{{ 32 }}
{% elif target_charge > 100 %}
{{ 100 }}
{% else %}
{{ target_charge | round(0, default=0) }}
{% endif %}

0 comments on commit 472136f

Please sign in to comment.