Kostal Smart Energy Meter Integration

Integrating the Kostal Smart Energy Meter would be great so I could make use of all the data in my two smart meters. More details here: KSEM: smart recording of self-consumption

2 Likes

Not native integration but add this to your configuration.yaml, this is the quick and easy way.

modbus:
  - name: "KSEM" #can be anything you want
    type: tcp #modbus over tcp
    host: 192.168.1.100  #insert your KSEM ip address, eg "host: 192.168.1.100"
    port: 502 #insert your KSEM port, eg "port: 502"
    sensors:
    - name: networkreference_power_ksem #power from grid
      slave: 1
      device_class: power
      state_class: measurement
      unit_of_measurement: W
      scale: 0.1
      address: 0
      scan_interval: 10
      count: 2
      input_type: holding
      data_type: uint32

    - name: gridfeed_power_ksem #power to grid
      slave: 1
      device_class: power
      state_class: measurement
      unit_of_measurement: W
      scale: 0.1
      address: 2
      scan_interval: 10
      count: 2
      input_type: holding
      data_type: uint32

    - name: networkreference_energy_ksem #total energy from gird
      slave: 1
      scale: 0.0001
      precision: 3
      address: 512
      scan_interval: 60
      count: 4
      input_type: holding
      data_type: uint64
      device_class: energy
      state_class: total_increasing
      unit_of_measurement: kWh

    - name: gridfeed_energy_ksem #total energy to grid
      slave: 1
      scale: 0.0001
      precision: 3
      address: 516
      scan_interval: 60
      count: 4 
      input_type: holding
      data_type: uint64
      device_class: energy
      state_class: total_increasing
      unit_of_measurement: kWh

    - name: L1_powerpos_ksem #power sent to grid on L1
      slave: 1
      device_class: power
      state_class: measurement
      unit_of_measurement: W
      scale: 0.1
      address: 40
      scan_interval: 10
      count: 2
      input_type: holding
      data_type: uint32

    - name: L1_powerneg_ksem #power taken to grid on L1
      slave: 1
      device_class: power
      state_class: measurement
      unit_of_measurement: W
      scale: 0.1
      address: 42
      scan_interval: 10
      count: 2
      input_type: holding
      data_type: uint32

    - name: L2_powerpos_ksem #power sent to grid on L2
      slave: 1
      device_class: power
      state_class: measurement
      unit_of_measurement: W
      scale: 0.1
      address: 80
      scan_interval: 10
      count: 2
      input_type: holding
      data_type: uint32

    - name: L2_powerneg_ksem #power taken from grid on L2
      slave: 1
      device_class: power
      state_class: measurement
      unit_of_measurement: W
      scale: 0.1
      address: 82
      scan_interval: 10
      count: 2 
      input_type: holding
      data_type: uint32

    - name: L3_powerpos_ksem #power sent to grid on L3
      slave: 1
      device_class: power
      state_class: measurement
      unit_of_measurement: W
      scale: 0.1
      address: 120
      scan_interval: 10
      count: 2
      input_type: holding
      data_type: uint32

    - name: L3_powerneg_ksem #power taken from grid on L3
      slave: 1
      device_class: power
      state_class: measurement
      unit_of_measurement: W
      scale: 0.1
      address: 122
      scan_interval: 10
      count: 2
      input_type: holding
      data_type: uint32
1 Like

You can also use GitHub - CJNE/ha-sunspec: Home Assistant customcomponent for SunSpec modbus devices

is there also a power to grid available?
i tried it but i can’t find it :confused:

You want to know what is the exact output from house to grid?

The most exact way is to have all the sensors as i described above integrated and L1+L2+L3 pos (powe feed in to grid) and L1+L2+L3 neg (power taken from grid) added up via helper. This is at least how i did it with Plenticore Plus 10/BYD HVM 13.8 and KSEM combo.

but my neg are always 0…
pos are okay.

Whats your setup?

Penticore Plus 5.5 / BYD HVS 7.7 / KSEM

KOSTAL Smart Energy Meter
Gerätetyp hw0200
Software-Version 2.0.0

One or three phase connection to the grid?

should be 3 or? but everywhere 0.



Where is your Smart Energy Meter at ‘home consumption’ or at ‘grid connection point’?

what does it mean - or how can i check it?

i have both - home consumption and if i can’t store it or use it at home i sell it to the grid.

Here →

Its on home consumption and i cant change it :confused: should i ask to Change

It depends actually how its wired in to your electical panel.

Could be as easy, yes, as changing the setting - or it could require some work to be done in panel by electrician.

Can you check what the smart energy meter is reporting via its web interface?

I can check if you say me where :see_no_evil: sorry for that.

Can you tell me the difference between that setting? Why they do that configuratuon?

The cables on the top are connected to the plenti. I batched both Ethernet cable to the smart meter and plenticore

is this picture from current setup? do you have ethernet cable connection to the smart meter front LAN port?

Yes i need to Disconnect it to open it :slight_smile:

Is there an Thing Else i could check

I think that since you have KSEM positioned after Plenticore at ‘Home Consumption’ then it wont read negative values, as your house is not providing anything to the grid, only consuming.

You should use this Kostal Plenticore Solar Inverter - Home Assistant

It’ll work even better since you have only one inverter/battery combo. My situation is a bit more complicated as i have multiple inverters :slight_smile: