I’m writing this article because I was worried for a long time whether I would be able to integrate my PV system into Home Assistant. However, integrating the Sofar system works perfectly.
To integrate a HYD KTL-3PH inverter into Home Assistant, I use the ‘Solarman Stick Logger’ (https://github.com/davidrapan/ha-solarman) integration.
This can be easily installed via HACS. There are already enough instructions for this.
The integration is now configured as follows via Settings, Integrations:

A total of 139 entities are currently read out, so presumably all the sensors relevant to you.
I have created two sensors in configuration.yaml:
Today’s profit from the feed-in
- sensor:
- name: "sofar-export-today-gains"
unique_id: sofar.complete.gains.day
unit_of_measurement: "€"
state_class: measurement
device_class: monetary
state: >
{% set export = states('sensor.sofar_today_energy_export') | float(0) %}
{{ (export * 0.0794) | round(2) }}The complete profit from the PV system, i.e. including feed-in tariff and self-consumption.
- sensor:
- name: "sofar-today-gains"
unique_id: sofar.today.gains
unit_of_measurement: "€"
state: >
{% set produktion = states('sensor.sofar_today_production') | float(0) %}
{% set einspeisung = states('sensor.sofar_today_energy_export') | float(0) %}
{% set netzbezug = states('sensor.sofar_today_energy_import') | float(0) %}
{% set eigenverbrauch = produktion - einspeisung %}
{% set eigenwert = eigenverbrauch * 0.29 %}
{% set einspeisewert = einspeisung * 0.079 %}
{% set netzkosten = netzbezug * 0.29 %}
{{ (eigenwert + einspeisewert - netzkosten) | round(2) }}