Hi
With the winter months now here and the sun making less of an appearance, I am trying to write an automation so that if my battery SoC is above say 95%, the system will switch to Feed-In. If the charge drops below the threshold, the system switches back to Self-Use.
This way if is a bad day for solar ill use all thats available and keep the battery topped up for night. If its a good day, i dont need to wait until its squeezed the last drop of power into the battery before i start exporting.
I am playing with the settings, as i dont find the automation method very intuitive.
Can anyone advise what i am looking for to change the Work Mode please, then ill try and figure out the If, Then, Else part of the statement
Thanks

Posts: 7
Joined: Fri Nov 11, 2022 2:33 pm

Posts: 7
Joined: Fri Nov 11, 2022 2:33 pm
I may have actually figured this.
Does this look right? It should check the Battery SoC every 5 minutes between sunrise and sunset. If the battery is above 95%, set the Work Mode to Feed-In. If it drops below 95%, set it back to Self Use
Does this look right? It should check the Battery SoC every 5 minutes between sunrise and sunset. If the battery is above 95%, set the Work Mode to Feed-In. If it drops below 95%, set it back to Self Use
Code: Select all
alias: Set Work Mode based on SoC
description: Set Work Mode of Inverter, based on the battery being above 95%
triggers:
- trigger: time_pattern
minutes: /5
conditions:
- condition: sun
before: sunset
after: sunrise
actions:
- if:
- condition: numeric_state
entity_id: sensor.battery_soc
above: 95
then:
- device_id: **my specific inverter id**
domain: select
entity_id: **my specific entitiy id**
type: select_option
option: Feed-in First
else:
- device_id: **my specific inverter id**
domain: select
entity_id: **my specific entitiy id**
type: select_option
option: Self Use
mode: single

Posts: 13
Joined: Thu Aug 10, 2023 8:19 am
Hi Andy,
Not saying this is more correct, but I have something similar working during summer when I set mode to Force Discharge at peak rate. It's also making use of a created as Settings > Device & Services > Helper tab, which allows playing with the value from the UI
and added to a dash My automation below (looking at again could be neater with a condition on time like you have done with the _sun_) but note the action works setting mode like this
Hope that's useful to you, you might also find viewtopic.php?t=946 helpful as that's doing conditions on Battery SoC too
Not saying this is more correct, but I have something similar working during summer when I set mode to Force Discharge at peak rate. It's also making use of a
Code: Select all
input_number.target_soc_force_export
and added to a dash My automation below (looking at again could be neater with a condition on time like you have done with the _sun_) but note the action works setting mode like this
Code: Select all
alias: >-
Energy: Battery Switch Work mode from Force Discharge to Feed-in First - when target Force Discharge SoC level achieved
description: >-
Sets the work mode back to Feed-in First (from Force Discharge) once the
target SoC acheived. - it 'polls' every 5 minutes during the 16th, 17th & 18th
hours to check condition
trigger:
- platform: time_pattern
hours: 16
minutes: /5
- platform: time_pattern
hours: 17
minutes: /5
- platform: time_pattern
hours: 18
minutes: /5
condition:
- and:
- condition: template
value_template: "{{ states('select.work_mode') == 'Force Discharge' }}"
- condition: template
value_template: >-
{{ states('sensor.battery_soc')|float(0) <=
states('input_number.target_soc_force_export')|float(0) }}
action:
- variables:
workmode: Feed-in First
- service: select.select_option
target:
entity_id: select.work_mode
data:
option: "{{ workmode }}"
mode: single
Marcus
House
H1 Series H1-3.7-E Inverter | RS485 Modbus->HA
8x Jinko 300W Mono (3x East facing; 5x South facing - 2400W)
Workshop
H1 Series H1-5.0-E Inverter | RS485 Modbus->HA
7x HV2600 2.6 kWh (5x V2; 2x V1 (Version C)) BMS V2 using this fix
12x Canadian 430W (2 strings South facing - 5160W)
House
H1 Series H1-3.7-E Inverter | RS485 Modbus->HA
8x Jinko 300W Mono (3x East facing; 5x South facing - 2400W)
Workshop
H1 Series H1-5.0-E Inverter | RS485 Modbus->HA
7x HV2600 2.6 kWh (5x V2; 2x V1 (Version C)) BMS V2 using this fix
12x Canadian 430W (2 strings South facing - 5160W)

Posts: 7
Joined: Fri Nov 11, 2022 2:33 pm
Thanks Marcus
You're bascially doing the same thing, just using Force Discharge and having a variable SoC percentage.
Interesting that your variable method is different to mine, as that was the bit i was originally struggling with
You're bascially doing the same thing, just using Force Discharge and having a variable SoC percentage.
Interesting that your variable method is different to mine, as that was the bit i was originally struggling with