Hi,
I am using the NathanMarlor HA integration, version 1.13.4 (Thanks Dave!) which shows 81 entities. The ones I need for my automation project are the two associated settings for force discharge mode. I can access the Force Discharge Power, number.kh10_inverter_force_discharge_power but for the life of me I cannot find the Force Discharge Soc.
My KH10 inverter firmware versions are:
(ARM) Manager (KH10_Inverter) 1.22
Master (KH10_Inverter) 1.39
Slave (KH10_Inverter) 1.01
Maybe the ARM version is too old to show the FDSoc entity but it's odd that the FDPwr entity is present but not the other. Am I missing something?
Thanks,
Hugh
Missing Sensor
- HughInDevon
- Posts: 63
- Joined: Wed Jul 31, 2024 4:50 pm
KH10 with 4 off ECS4800 batteries.
20 Jinko 435W panels in 2 strings. 10 on house, south facing, 10 on barn, east facing.
Solar installation active on 27/11/2024. Export MPAN active on 30.12/2024.
Zappi V2 charger and 2 EVs.
Currently on Octopus Intelligent Go tariff.
Home Assistant modbus integration (Now working - ish)
20 Jinko 435W panels in 2 strings. 10 on house, south facing, 10 on barn, east facing.
Solar installation active on 27/11/2024. Export MPAN active on 30.12/2024.
Zappi V2 charger and 2 EVs.
Currently on Octopus Intelligent Go tariff.
Home Assistant modbus integration (Now working - ish)
-
- Posts: 52
- Joined: Mon Nov 18, 2024 9:16 pm
Some of the registers relating to force charge / discharge slots in the mode scheduler aren't readable on the KH inverters (not sure about other inverters), so the integration has no way to know.
I don't know if they are writeable however (i.e., write-only), or simply inaccessible entirely.
I implemented this in my own crude scheduler by simply monitoring the battery_soc myself and changing the work mode when the target was reached.
I don't know if they are writeable however (i.e., write-only), or simply inaccessible entirely.
I implemented this in my own crude scheduler by simply monitoring the battery_soc myself and changing the work mode when the target was reached.
- HughInDevon
- Posts: 63
- Joined: Wed Jul 31, 2024 4:50 pm
Thanks for the clarification. I have also devised my own, very crude, automation to use the normal battery soc to switch work modes. A shame that FDSoc isn’t exposed as it would be an elegant way to do it. Meanwhile I need to find out why my work mode switching away from Force Discharge failed and thus exported full, freshly charged, battery at 05:30 yesterday morning.
KH10 with 4 off ECS4800 batteries.
20 Jinko 435W panels in 2 strings. 10 on house, south facing, 10 on barn, east facing.
Solar installation active on 27/11/2024. Export MPAN active on 30.12/2024.
Zappi V2 charger and 2 EVs.
Currently on Octopus Intelligent Go tariff.
Home Assistant modbus integration (Now working - ish)
20 Jinko 435W panels in 2 strings. 10 on house, south facing, 10 on barn, east facing.
Solar installation active on 27/11/2024. Export MPAN active on 30.12/2024.
Zappi V2 charger and 2 EVs.
Currently on Octopus Intelligent Go tariff.
Home Assistant modbus integration (Now working - ish)
-
- Posts: 52
- Joined: Mon Nov 18, 2024 9:16 pm
My automation to turn off force discharge looks like this (very crude as mentioned
), it will be called every few minutes, plus whenever the battery soc etc changes. It has a specific section which looks to see if Force Discharge is running between 7am (when the cheap period finishes) and 9am and turns it off if so. In the afternoon/evening it will gradually let the battery draw down, alternating with a slow force discharge. During the day it will usually swap to Feed-in first, unless I'm doing a calibration run and need solar to top up to the target.
Lots of things I'd like to clean up, for example running the SoC targets from a list rather than hard wiring them into each automation, and merging the automations into a single one rather than having a different automation for each workmode.

Lots of things I'd like to clean up, for example running the SoC targets from a list rather than hard wiring them into each automation, and merging the automations into a single one rather than having a different automation for each workmode.
Code: Select all
alias: FoxESS Feed-in default during the day
description: ""
triggers:
- trigger: time_pattern
minutes: /15
- trigger: state
entity_id:
- input_boolean.eon_next_drive_cheap_period
to: "on"
- trigger: state
entity_id:
- sensor.battery_soc
- trigger: state
entity_id:
- input_boolean.foxess_calibrate_top_reached
to: "on"
- trigger: state
entity_id:
- input_boolean.foxess_calibrate_bottom_reached
to: "on"
conditions:
- condition: time
after: "07:00:00"
before: "23:59:59"
- condition: not
conditions:
- condition: state
entity_id: select.work_mode
state: Feed-in First
- condition: or
conditions:
- condition: not
conditions:
- condition: state
entity_id: select.work_mode
state: Force Discharge
- condition: state
entity_id: select.work_mode
state: Force Discharge
for:
hours: 0
minutes: 55
seconds: 0
- condition: and
conditions:
- condition: state
entity_id: select.work_mode
state: Force Discharge
- condition: or
conditions:
- condition: numeric_state
entity_id: sensor.battery_soc
below: input_number.foxess_calibrate_bottom_soc
- condition: and
conditions:
- condition: numeric_state
entity_id: sensor.battery_soc
below: 21
- condition: or
conditions:
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
- sun
- condition: state
entity_id: input_boolean.foxess_calibrate_bottom_reached
state: "on"
- condition: and
conditions:
- condition: state
entity_id: select.work_mode
state: Force Discharge
for:
hours: 0
minutes: 15
seconds: 0
- condition: time
before: "23:30:00"
- condition: numeric_state
entity_id: sensor.battery_soc
below: 26
- condition: and
conditions:
- condition: state
entity_id: select.work_mode
state: Force Discharge
for:
hours: 0
minutes: 20
seconds: 0
- condition: time
before: "23:00:00"
- condition: numeric_state
entity_id: sensor.battery_soc
below: 31
- condition: and
conditions:
- condition: state
entity_id: select.work_mode
state: Force Discharge
for:
hours: 0
minutes: 25
seconds: 0
- condition: time
before: "22:30:00"
- condition: numeric_state
entity_id: sensor.battery_soc
below: 36
- condition: and
conditions:
- condition: state
entity_id: select.work_mode
state: Force Discharge
for:
hours: 0
minutes: 25
seconds: 0
- condition: time
before: "22:00:00"
- condition: numeric_state
entity_id: sensor.battery_soc
below: 41
- condition: and
conditions:
- condition: state
entity_id: select.work_mode
state: Force Discharge
for:
hours: 0
minutes: 25
seconds: 0
- condition: time
before: "21:30:00"
- condition: numeric_state
entity_id: sensor.battery_soc
below: 44
- condition: and
conditions:
- condition: state
entity_id: select.work_mode
state: Force Discharge
for:
hours: 0
minutes: 25
seconds: 0
- condition: time
before: "21:00:00"
- condition: numeric_state
entity_id: sensor.battery_soc
below: 47
- condition: and
conditions:
- condition: state
entity_id: select.work_mode
state: Force Discharge
for:
hours: 0
minutes: 25
seconds: 0
- condition: time
before: "20:30:00"
- condition: numeric_state
entity_id: sensor.battery_soc
below: 51
- condition: and
conditions:
- condition: state
entity_id: select.work_mode
state: Force Discharge
for:
hours: 0
minutes: 25
seconds: 0
- condition: time
before: "20:00:00"
- condition: numeric_state
entity_id: sensor.battery_soc
below: 55
- condition: and
conditions:
- condition: state
entity_id: select.work_mode
state: Force Discharge
for:
hours: 0
minutes: 25
seconds: 0
- condition: time
before: "19:30:00"
- condition: numeric_state
entity_id: sensor.battery_soc
below: 58
- condition: and
conditions:
- condition: state
entity_id: select.work_mode
state: Force Discharge
for:
hours: 0
minutes: 25
seconds: 0
- condition: time
before: "19:00:00"
- condition: numeric_state
entity_id: sensor.battery_soc
below: 61
- condition: and
conditions:
- condition: state
entity_id: select.work_mode
state: Force Discharge
for:
hours: 0
minutes: 25
seconds: 0
- condition: time
before: "18:30:00"
- condition: numeric_state
entity_id: sensor.battery_soc
below: 64
- condition: and
conditions:
- condition: state
entity_id: select.work_mode
state: Force Discharge
for:
hours: 0
minutes: 25
seconds: 0
- condition: time
before: "18:00:00"
- condition: numeric_state
entity_id: sensor.battery_soc
below: 68
- condition: and
conditions:
- condition: state
entity_id: select.work_mode
state: Force Discharge
for:
hours: 0
minutes: 25
seconds: 0
- condition: time
before: "17:30:00"
- condition: numeric_state
entity_id: sensor.battery_soc
below: 71
- condition: and
conditions:
- condition: state
entity_id: select.work_mode
state: Force Discharge
for:
hours: 0
minutes: 25
seconds: 0
- condition: time
before: "17:00:00"
- condition: numeric_state
entity_id: sensor.battery_soc
below: 73
- condition: and
conditions:
- condition: state
entity_id: select.work_mode
state: Force Discharge
for:
hours: 0
minutes: 25
seconds: 0
- condition: time
before: "16:30:00"
- condition: numeric_state
entity_id: sensor.battery_soc
below: 75
- condition: and
conditions:
- condition: state
entity_id: select.work_mode
state: Force Discharge
for:
hours: 0
minutes: 25
seconds: 0
- condition: time
before: "16:00:00"
- condition: numeric_state
entity_id: sensor.battery_soc
below: 78
- condition: and
conditions:
- condition: state
entity_id: select.work_mode
state: Force Discharge
- condition: time
before: "09:00:00"
after: "07:00:00"
actions:
- action: select.select_option
metadata: {}
data:
option: Feed-in First
target:
entity_id: select.work_mode
- choose:
- conditions:
- condition: state
entity_id: input_boolean.foxess_calibrate_today
state: "on"
- condition: state
entity_id: input_boolean.foxess_calibrate_top_reached
state: "off"
- condition: template
value_template: >-
{{ states('sensor.solcast_pv_forecast_forecast_remaining_today')|
float > ((100.0 - (states('sensor.battery_Soc') | float)) *
(states('sensor.bms_kwh_remaining') | float) / 100.0 ) }}
sequence:
- action: select.select_option
metadata: {}
data:
option: Self Use
target:
entity_id: select.work_mode
default:
- action: select.select_option
metadata: {}
data:
option: Feed-in First
target:
entity_id: select.work_mode
mode: single
- HughInDevon
- Posts: 63
- Joined: Wed Jul 31, 2024 4:50 pm
Hi,
Thanks for the code. Looks very interesting! I will happily post mine when I finally get it working. Which I can't do just at the moment as good 'ol Fox are updating my firmware!

Thanks for the code. Looks very interesting! I will happily post mine when I finally get it working. Which I can't do just at the moment as good 'ol Fox are updating my firmware!



KH10 with 4 off ECS4800 batteries.
20 Jinko 435W panels in 2 strings. 10 on house, south facing, 10 on barn, east facing.
Solar installation active on 27/11/2024. Export MPAN active on 30.12/2024.
Zappi V2 charger and 2 EVs.
Currently on Octopus Intelligent Go tariff.
Home Assistant modbus integration (Now working - ish)
20 Jinko 435W panels in 2 strings. 10 on house, south facing, 10 on barn, east facing.
Solar installation active on 27/11/2024. Export MPAN active on 30.12/2024.
Zappi V2 charger and 2 EVs.
Currently on Octopus Intelligent Go tariff.
Home Assistant modbus integration (Now working - ish)