Examples of changing discharge current on KH inverters

Post Reply
User avatar
markcarline
Posts: 8
Joined: Sun Aug 04, 2024 10:34 pm

Long story but because of the way that we plan to have the EV charger (granny socket) & Hybrid inverter (H or K series) in the garage on the opposite side of the house (fed by a 16mm 3 core evultra cable) we don't have the option to place a CT clamp so it avoids the EV charger. So...

Hopefully around October time we're be in the situation to get a hybrid inverter with a few batteries and i'm looking to ensure that as i'm on intelligent octopus go I don't want the EV charging to drain from a charged battery (which potentially could happen at any 1/2 hour in the 24 hour period. My plan would be to charge the house battery (fox cube system) during the cheap off peak rate of between 23:30 / 05:30.

I have managed to create a couple of automations which work today to detect when the EV is charging by looking at the power draw from the Eastron SDM230 modbox connected via a EW11 wifi adapter and these work great. The emails match up perfectly with the actual performed charging plan from octopus:

EV charge start detected :

Code: Select all

- id: '1725986901136'
  alias: EV charge start detected
  description: ''
  trigger:
  - platform: numeric_state
    entity_id:
    - sensor.sdm120_active_power
    above: 2
  condition: []
  action:
  - action: notify.me_gmail_com
    metadata: {}
    data:
      message: EV charge start detected at {{now().strftime("%Y-%m-%d %H:%M:%S")}},
        we are seeing {{ states('sensor.sdm120_active_power') }}kW so will now set
        the KH battery discharge current to zero
      title: EV charge start detected at {{now().strftime("%Y-%m-%d %H:%M:%S")}},
        we are seeing {{ states('sensor.sdm120_active_power') }}kW so will now set
        the KH Battery Discharge Current to zero
      target: me@btinternet.com
  mode: single
EV charge finish detected

Code: Select all

- id: '1725986972966'
  alias: EV charge finish detected
  description: ''
  trigger:
  - platform: numeric_state
    entity_id:
    - sensor.sdm120_active_power
    below: 0.01
  condition: []
  action:
  - action: notify.me_gmail_com
    metadata: {}
    data:
      message: EV charge finish detected at {{now().strftime("%Y-%m-%d %H:%M:%S")}},
        we are seeing {{ states('sensor.sdm120_active_power') }}kW so will now set
        the KH Battery Discharge Current to normal rate
      title: EV charge finish detected at {{now().strftime("%Y-%m-%d %H:%M:%S")}},
        we are seeing {{ states('sensor.sdm120_active_power') }}kW so will now set
        the KH Battery Discharge Current to normal rate
      target: me@btinternet.com
  mode: single
My plan is to connect the K series inverter via the RS485 A/B connector to the same A/B bus which feeds the EW11 wifi adapter/Eastron SDM120M (I assume this is ok as I have set the modbus ID on the SDM120M to "100" and the modbus.yaml uses "slave: 100" for all of the entities. Anyone confirm this ?I

Also - The big question i have is does anyone have any examples of controlling the discharge current of the K series inverter so I can set this in the automations above?

I'm still 50/50 about the H vs K series at the moment so not sure if that influences anything here.

Thanks in advance :)
Equipment Currently installed: Nothing (yet!)

Mark Carline
https://www.markcarline.co.uk
Dave Foster
Posts: 1328
Joined: Thu Oct 13, 2022 7:21 pm

markcarline wrote: Wed Sep 11, 2024 6:01 pm My plan is to connect the K series inverter via the RS485 A/B connector to the same A/B bus which feeds the EW11 wifi adapter/Eastron SDM120M (I assume this is ok as I have set the modbus ID on the SDM120M to "100" and the modbus.yaml uses "slave: 100" for all of the entities. Anyone confirm this ?I
This is possible but you may be asking a lot of the wifi link to the EW11 - it's not massive traffic but it is very regular and being wifi the latency will decrease considerably when busy, so best to keep on its own dedicated AP or drop in an ethernet cable (and use a Waveshare) and keep it all cabled.
markcarline wrote: Wed Sep 11, 2024 6:01 pm
Also - The big question i have is does anyone have any examples of controlling the discharge current of the K series inverter so I can set this in the automations above?

I'm still 50/50 about the H vs K series at the moment so not sure if that influences anything here.

Thanks in advance :)
Yep i've done that a few times for people with the KH, because it doesn't have charge periods exposed it has to be done using the 'Force Charge' work mode and as the inverter doesn't respect maxsoc when using this you have to modify charge current to fix that.

Code: Select all

action: number.set_value
metadata: {}
data:
  value: "20"
target:
  entity_id: number.max_charge_current
That's the action to change the charge current to 20A (i.e. multiply by battery volts by 20A to get your power in watts).

This is a typical test for exceeding the battery charge limit (hard coded here to 75%)

Code: Select all

if:
  - condition: numeric_state
    entity_id: sensor.battery_soc
    above: 75
then:
  - data:
      name: KH Charge
      message: Battery above 75%, charge current set to 0A
    action: logbook.log
  - action: number.set_value
    metadata: {}
    data:
      value: "0"
    target:
      entity_id: number.max_charge_current
else:
  - if:
      - condition: numeric_state
        entity_id: sensor.max_charge_current
        below: 5
    then:
      - action: number.set_value
        data:
          value: "20"
        target:
          entity_id: number.max_charge_current
      - action: logbook.log
        metadata: {}
        data:
          name: KH Charge
          message: >-
            Battery SoC fallen below 75% start charging, set charge current to
            20A

Both the H (G2) and KH are excellent inverters, but i'd recommend the KH over the G2
User avatar
markcarline
Posts: 8
Joined: Sun Aug 04, 2024 10:34 pm

brill thanks Dave!

one small comment - You talk about changing "charge current", my use case is to prevent EV charging from draining the battery so don't you mean "discharge current" ?
Equipment Currently installed: Nothing (yet!)

Mark Carline
https://www.markcarline.co.uk
Dave Foster
Posts: 1328
Joined: Thu Oct 13, 2022 7:21 pm

markcarline wrote: Thu Sep 12, 2024 12:42 pm brill thanks Dave!

one small comment - You talk about changing "charge current", my use case is to prevent EV charging from draining the battery so don't you mean "discharge current" ?
It's one of the great wonders of Fox, if you set the inverter to Force Charge but then limit the charge current at 0A the batteries will neither charge or discharge.

Typically when you are charging your EV you are on low tariff, so this makes the most of that in that you can charge whilst your are charging - but when you set the charge current to zero your batteries will be in 'idle'
User avatar
markcarline
Posts: 8
Joined: Sun Aug 04, 2024 10:34 pm

This is great thanks.

My overall idea is:

House:
23:30 to 05:30 - House batteries/inverter to set to charge from grid to 100%
05:30 to 23:30 - House batteries/inverter to set to discharge/supply house

Car:
Car setup with Octopus intelligent Go to 8:00am and 80% charge needed
Car will be plugged in at any time during the day/evening/night and due to IOG they could start/stop charge at any time.

Then have an automation which would only be triggered if the time is between 05:30 to 23:30 which
- detects car start charge and sets max_charge_current = zero
- detects car finish charge and sets max_charge_current = normal rate

I think the only two slight issues are at exactly the times:

23:30 - if car is charging and max_charge_current = zero then set max_charge_current to normal rate
- This would ensure the house battery starts charging

05:30 - if car is charging and max_charge_current = normal then set max_charge_current to zero
- This would ensure the car charging past 05:30 does not drain the house battery.

Seem ok ?

I'll circle back when I have my installation up and running (give me a few months) and will share the final HA YAML.
Equipment Currently installed: Nothing (yet!)

Mark Carline
https://www.markcarline.co.uk
Dave Foster
Posts: 1328
Joined: Thu Oct 13, 2022 7:21 pm

Yes looks good, I have something very similar timewise.

The only thing to say is you must switch to force charge work mode when you set charge current to zero - that will neither charge or discharge, or if you set it low you can trickle charge the batteries whilst your car is charging.

If you want to leave your inverter in Self Use just set the discharge current to zero (as you first said)
User avatar
Will
Site Admin
Posts: 278
Joined: Thu Oct 13, 2022 5:56 pm

I do something similar but I have a HA automation set to when the energy price is <10p (off peak rate) provided by the octopus integration then set the inverte minsoc on grid to 100% so the inverter will slowly charge the battery every time a cheap rate is detected.
It's worked well for me for many months.
Community Admin / FoxESS Elite Professional

Buy me a coffee or Book a zoom meeting for remote consultancy

FoxESS Tri Inverter Installation
2 x KH Series Inverters
24 x HV2600 (62.4kWh)
32 x 490w across 4 arrays
Dual Tesla Household
Heatpump & Low Carbon Housebuild
User avatar
markcarline
Posts: 8
Joined: Sun Aug 04, 2024 10:34 pm

Thanks Will & Dave - *super* helpful! :) will update when I havbe something installed
Equipment Currently installed: Nothing (yet!)

Mark Carline
https://www.markcarline.co.uk
User avatar
Will
Site Admin
Posts: 278
Joined: Thu Oct 13, 2022 5:56 pm

Most welcome, enjoy your solar journey
Community Admin / FoxESS Elite Professional

Buy me a coffee or Book a zoom meeting for remote consultancy

FoxESS Tri Inverter Installation
2 x KH Series Inverters
24 x HV2600 (62.4kWh)
32 x 490w across 4 arrays
Dual Tesla Household
Heatpump & Low Carbon Housebuild
Post Reply