Kostal Piko 10 BA - Custom Sensor

Hello Home Assistant Community,

I use Home Assistant since a few year, but only recently started to extend the functionality.

With the Energy management feature released, I was triggered to get my solar inverter integrated with Home Assistant.
As there is no official integration for Kostal Piko inverters yet, I started to gather the information and setup an integration based on the Restful / template sensors.

Currently I am getting deeper into the setup of custom components, though I would still need some time to get this running. Until then I would share my configuration.yaml and groups.yaml so that anyone with a similar setup can try it out and give me suggestion on what to optimize :slight_smile:

Basic setup:

  • Kostal Piko inverters share there information locally through an undocumented Rest API
  • The API URL: http://<inverter-ip/api/dxs.json?dxsEntries=&dxsEntries=…
  • Overview about the dxsIds I sniffed from the local website
#Kostal Piko Inverter Rest sensor
#dxsIds Overview:
#  General:
#   16780544 - Inverter type
#   16777984 - Inverter name
#   33556736 - DC Input - Total (W)
#   67109120 - Output power (W)
#   83888128 - Self-consumption (W)
#   16780032 - Operation Status 0- , 1- , 2- , 3-Feed in (MPP)
#  PV-Generator:
#   33555202 - DC Input 1 - Voltage (V)
#   33555201 - DC Input 1 - Current (A)
#   33555203 - DC Input 1 - Power (W)
#   33555458 - DC Input 2 - Voltage (V)
#   33555457 - DC Input 2 - Current (A)
#   33555459 - DC Input 2 - Power (W)
#  Battery:
#   33556226 - Battery voltage (V)
#   33556229 - Battery charging level (%)
#   33556238 - Battery current (A)
#   33556230 - Battery Status 0-Charging 1-Discharging
#   33556228 - Battery loading cycles
#   33556227 - Battery temperature (°C)
#  Home:
#   83886336 - Current home consumption solar (W)
#   83886592 - Current home consumption battery (W)
#   83886848 - Current home consumption external (W)
#   83887106 - Home consumption phase 1 (W)
#   83887362 - Home consumption phase 2 (W)
#   83887618 - Home consumption phase 3 (W)
#  Grid:
#   67109120 - Grid Output power (W)
#   67110400 - Grid frequency (%)
#   67110656 - Grid Cos phi
#   67110144 - Grid Limitation on (%)
#   67109378 - Grid Voltage phase 1 (V)
#   67109377 - Grid Current phase 1 (A)
#   67109379 - Grid Power phase 1 (W)
#   67109634 - Grid Voltage phase 2 (V)
#   67109633 - Grid Current phase 2 (A)
#   67109635 - Grid Power phase 2 (W)
#   67109890 - Grid Voltage phase 3 (V)
#   67109889 - Grid Current phase 3 (A)
#   67109891 - Grid Power phase 3 (W)
#  Statistics Day:
#   251658754 - Yield (kWh)
#   251659010 - Home-consumption (kWh)
#   251659266 - Self-consumption (kWh)
#   251659278 - Self-consumption rate (%)
#   251659279 - Degree of self-sifficiency (%)
#  Statistics Total:
#   251658753 - Yield (kWh)
#   251659009 - Home-consumption (kWh)
#   251659265 - Self-consumption (kWh)
#   251659280 - Self-consumption rate (%)
#   251659281 - Degree of self-sufficiency (%)
#   251658496 - Operation time (h)
  • the maximum number of dxsIds per Rest sensor is 25 → Therefore I separated them into 3 rest sensor

Afterwards the JSON response is parsed into seperate template entities and group together into 3 groups.

The energy values are gather for daily and total from the inverter statistics directly. Additionally the Power values for output power, solar, battery and external consumption are summed up by the integration platforms.

Be careful, the calculations for the energy board are not perfect right now and needs to be verified against the kostal web portal and the calculation logic of the Home Assistant Energy Dashboard.

Configuration YAML:

Rest & Template sensors:

#Kostal Piko Inverter Rest sensor
#dxsIds Overview:
#  General:
#   16780544 - Inverter type
#   16777984 - Inverter name
#   33556736 - DC Input - Total (W)
#   67109120 - Output power (W)
#   83888128 - Self-consumption (W)
#   16780032 - Operation Status 0- , 1- , 2- , 3-Feed in (MPP)
#  PV-Generator:
#   33555202 - DC Input 1 - Voltage (V)
#   33555201 - DC Input 1 - Current (A)
#   33555203 - DC Input 1 - Power (W)
#   33555458 - DC Input 2 - Voltage (V)
#   33555457 - DC Input 2 - Current (A)
#   33555459 - DC Input 2 - Power (W)
#  Battery:
#   33556226 - Battery voltage (V)
#   33556229 - Battery charging level (%)
#   33556238 - Battery current (A)
#   33556230 - Battery Status 0-Charging 1-Discharging
#   33556228 - Battery loading cycles
#   33556227 - Battery temperature (°C)
#  Home:
#   83886336 - Current home consumption solar (W)
#   83886592 - Current home consumption battery (W)
#   83886848 - Current home consumption external (W)
#   83887106 - Home consumption phase 1 (W)
#   83887362 - Home consumption phase 2 (W)
#   83887618 - Home consumption phase 3 (W)
#  Grid:
#   67109120 - Grid Output power (W)
#   67110400 - Grid frequency (%)
#   67110656 - Grid Cos phi
#   67110144 - Grid Limitation on (%)
#   67109378 - Grid Voltage phase 1 (V)
#   67109377 - Grid Current phase 1 (A)
#   67109379 - Grid Power phase 1 (W)
#   67109634 - Grid Voltage phase 2 (V)
#   67109633 - Grid Current phase 2 (A)
#   67109635 - Grid Power phase 2 (W)
#   67109890 - Grid Voltage phase 3 (V)
#   67109889 - Grid Current phase 3 (A)
#   67109891 - Grid Power phase 3 (W)
#  Statistics Day:
#   251658754 - Yield (kWh)
#   251659010 - Home-consumption (kWh)
#   251659266 - Self-consumption (kWh)
#   251659278 - Self-consumption rate (%)
#   251659279 - Degree of self-sifficiency (%)
#  Statistics Total:
#   251658753 - Yield (kWh)
#   251659009 - Home-consumption (kWh)
#   251659265 - Self-consumption (kWh)
#   251659280 - Self-consumption rate (%)
#   251659281 - Degree of self-sufficiency (%)
#   251658496 - Operation time (h)

rest:
  - scan_interval: 10
    resource: "http://192.168.178.86/api/dxs.json?\
            dxsEntries=16780544\
            &dxsEntries=16777984\
            &dxsEntries=33556736\
            &dxsEntries=67109120\
            &dxsEntries=83888128\
            &dxsEntries=16780032\
            &dxsEntries=33555202\
            &dxsEntries=33555201\
            &dxsEntries=33555203\
            &dxsEntries=33555458\
            &dxsEntries=33555457\
            &dxsEntries=33555459\
            &dxsEntries=33556226\
            &dxsEntries=33556229\
            &dxsEntries=33556238\
            &dxsEntries=33556230\
            &dxsEntries=33556228\
            &dxsEntries=33556227\
            &dxsEntries=83886336\
            &dxsEntries=83886592\
            &dxsEntries=83886848\
            &dxsEntries=83887106\
            &dxsEntries=83887362\
            &dxsEntries=83887618"
    sensor:
    - name: "kostal_piko"
      value_template: "{{ value_json.dxsEntries[0]['value'] }}"
      json_attributes:
        - dxsEntries
  - scan_interval: 60
    resource: "http://192.168.178.86/api/dxs.json?\
            dxsEntries=67109120\
            &dxsEntries=67110400\
            &dxsEntries=67110656\
            &dxsEntries=67110144\
            &dxsEntries=67109378\
            &dxsEntries=67109377\
            &dxsEntries=67109379\
            &dxsEntries=67109634\
            &dxsEntries=67109633\
            &dxsEntries=67109635\
            &dxsEntries=67109890\
            &dxsEntries=67109889\
            &dxsEntries=67109891"
    sensor:
    - name: "kostal_piko_grid"
      value_template: "{{ value_json.dxsEntries[0]['value'] }}"
      json_attributes:
        - dxsEntries
  - scan_interval: 60
    resource: "http://192.168.178.86/api/dxs.json?\
            dxsEntries=251658754\
            &dxsEntries=251659010\
            &dxsEntries=251659266\
            &dxsEntries=251659278\
            &dxsEntries=251659279\
            &dxsEntries=251658753\
            &dxsEntries=251659009\
            &dxsEntries=251659265\
            &dxsEntries=251659280\
            &dxsEntries=251659281\
            &dxsEntries=251658496"
    sensor:
    - name: "kostal_piko_statistic"
      value_template: "{{ value_json.dxsEntries[0]['value'] }}"
      json_attributes:
        - dxsEntries

template:
    unique_id: "kostal_"
    sensor:
    #  General:
      - name: "Kostal Inverter type"
        state: "{{ state_attr('sensor.kostal_piko', 'dxsEntries')[0]['value'] }}"
        unique_id: "kostal_inverter_type"
      - name: "Kostal Inverter Name"
        state: "{{ state_attr('sensor.kostal_piko', 'dxsEntries')[1]['value'] }}"
        unique_id: "kostal_inverter_name"
      - name: "DC-Input Total"
        state: "{{ state_attr('sensor.kostal_piko', 'dxsEntries')[2]['value'] | float | round(2) }}"
        device_class: power
        state_class: measurement
        unit_of_measurement: "W"
        unique_id: "kostal_dc_input_total"
      - name: "Output Power"
        state: "{{ state_attr('sensor.kostal_piko', 'dxsEntries')[3]['value'] | float | round(2) }}"
        device_class: power
        state_class: measurement
        unit_of_measurement: "W"
        unique_id: "kostal_output_power"
      - name: "Self Consumption"
        state: "{{ state_attr('sensor.kostal_piko', 'dxsEntries')[4]['value'] | float | round(2) }}"
        device_class: power
        state_class: measurement
        unit_of_measurement: "W"
        unique_id: "kostal_self_consumption"
      - name: "Feed external"
        state: "{{ (state_attr('sensor.kostal_piko', 'dxsEntries')[3]['value'] | float | round(2)) - (state_attr('sensor.kostal_piko', 'dxsEntries')[4]['value'] | float | round(2)) }}"
        device_class: power
        state_class: measurement
        unit_of_measurement: "W"
        unique_id: "kostal_feed_external"
      - name: "Operation Status"
        state: "{{ state_attr('sensor.kostal_piko', 'dxsEntries')[5]['value'] }}"
        unique_id: "operation_status"
    #  PV-Generator:
      - name: "DC Input 1 - Voltage"
        state: "{{ state_attr('sensor.kostal_piko', 'dxsEntries')[6]['value'] | float | round(2) }}"
        device_class: voltage
        state_class: measurement
        unit_of_measurement: "V"
        unique_id: "kostal_dc_input_1_voltage"
      - name: "DC Input 1 - Current"
        state: "{{ state_attr('sensor.kostal_piko', 'dxsEntries')[7]['value'] | float | round(2) }}"
        device_class: current
        state_class: measurement
        unit_of_measurement: "A"
        unique_id: "kostal_dc_input_1_current"
      - name: "DC Input 1 - Power"
        state: "{{ state_attr('sensor.kostal_piko', 'dxsEntries')[8]['value'] | float | round(2) }}"
        device_class: power
        state_class: measurement
        unit_of_measurement: "W"
        unique_id: "kostal_dc_input_1_power"
      - name: "DC Input 2 - Voltage"
        state: "{{ state_attr('sensor.kostal_piko', 'dxsEntries')[9]['value'] | float | round(2) }}"
        device_class: voltage
        state_class: measurement
        unit_of_measurement: "V"
        unique_id: "kostal_dc_input_2_voltage"
      - name: "DC Input 2 - Current"
        state: "{{ state_attr('sensor.kostal_piko', 'dxsEntries')[10]['value'] | float | round(2) }}"
        device_class: current
        state_class: measurement
        unit_of_measurement: "A"
        unique_id: "kostal_dc_input_2_current"
      - name: "DC Input 2 - Power"
        state: "{{ state_attr('sensor.kostal_piko', 'dxsEntries')[11]['value'] | float | round(2) }}"
        device_class: power
        state_class: measurement
        unit_of_measurement: "W"
        unique_id: "kostal_dc_input_2_power"
    #  Battery:
      - name: "Battery voltage"
        state: "{{ state_attr('sensor.kostal_piko', 'dxsEntries')[12]['value'] | float | round(2) }}"
        device_class: voltage
        state_class: measurement
        unit_of_measurement: "V"
        unique_id: "kostal_battery_voltage"
      - name: "Battery charging level"
        state: "{{ state_attr('sensor.kostal_piko', 'dxsEntries')[13]['value'] | float | round(2) }}"
        device_class: power_factor
        state_class: measurement
        unit_of_measurement: "%"
        unique_id: "kostal_battery_charging_level"
      - name: "Battery current"
        state: "{{ state_attr('sensor.kostal_piko', 'dxsEntries')[14]['value'] | float | round(2) }}"
        device_class: current
        state_class: measurement
        unit_of_measurement: "A"
        unique_id: "kostal_battery_current"
      - name: "Battery status"
        state: "{{ state_attr('sensor.kostal_piko', 'dxsEntries')[15]['value'] }}"
        unique_id: "kostal_battery_status"
      - name: "Battery loading cycles"
        state: "{{ state_attr('sensor.kostal_piko', 'dxsEntries')[16]['value']}}"
        unique_id: "kostal_battery_loading_cycles" 
      - name: "Battery temperature"
        state: "{{ state_attr('sensor.kostal_piko', 'dxsEntries')[17]['value'] | float | round(2) }}"
        device_class: temperature
        state_class: measurement
        unit_of_measurement: "°C"
        unique_id: "kostal_battery_temperature"
    #  Home:
      - name: "Current home consumption solar"
        state: "{{ state_attr('sensor.kostal_piko', 'dxsEntries')[18]['value'] | float | round(2) }}"
        device_class: power
        state_class: measurement
        unit_of_measurement: "W"
        unique_id: "kostal_home_consumption_solar"        
      - name: "Current home consumption battery"
        state: "{{ state_attr('sensor.kostal_piko', 'dxsEntries')[19]['value'] | float | round(2) }}"
        device_class: power
        state_class: measurement
        unit_of_measurement: "W"
        unique_id: "kostal_home_consumption_battery"        
      - name: "Current home consumption external"
        state: "{{ state_attr('sensor.kostal_piko', 'dxsEntries')[20]['value'] | float | round(2) }}"
        device_class: power
        state_class: measurement
        unit_of_measurement: "W"
        unique_id: "kostal_home_consumption_external"      
      - name: "Home consumption phase 1"
        state: "{{ state_attr('sensor.kostal_piko', 'dxsEntries')[21]['value'] | float | round(2) }}"
        device_class: power
        state_class: measurement
        unit_of_measurement: "W"
        unique_id: "kostal_home_consumption_phase_1" 
      - name: "Home consumption phase 2"
        state: "{{ state_attr('sensor.kostal_piko', 'dxsEntries')[22]['value'] | float | round(2) }}"
        device_class: power
        state_class: measurement
        unit_of_measurement: "W"
        unique_id: "kostal_home_consumption_phase_2" 
      - name: "Home consumption phase 3"
        state: "{{ state_attr('sensor.kostal_piko', 'dxsEntries')[23]['value'] | float | round(2) }}"
        device_class: power
        state_class: measurement
        unit_of_measurement: "W"
        unique_id: "kostal_home_consumption_phase_3"
    #  Statistics Day:
      - name: "Yield - Total per Day"
        state: "{{ state_attr('sensor.kostal_piko_statistic', 'dxsEntries')[0]['value'] | float | round(2) }}"
        device_class: energy
        state_class: total_increasing 
        unit_of_measurement: "Wh"
        unique_id: "kostal_yield_daily"
      - name: "Home consumption - Total per Day"
        state: "{{ state_attr('sensor.kostal_piko_statistic', 'dxsEntries')[1]['value'] | float | round(2) }}"
        device_class: energy
        state_class: total_increasing 
        unit_of_measurement: "Wh"
        unique_id: "kostal_home_consumption_daily"
      - name: "Self consumption - Total per Day"
        state: "{{ state_attr('sensor.kostal_piko_statistic', 'dxsEntries')[2]['value'] | float | round(2) }}"
        device_class: energy
        state_class: total_increasing 
        unit_of_measurement: "Wh"
        unique_id: "kostal_self_consumption_daily"
      - name: "Grid consumption - Total per Day"
        state: "{{ state_attr('sensor.kostal_piko_statistic', 'dxsEntries')[1]['value'] - state_attr('sensor.kostal_piko_statistic', 'dxsEntries')[2]['value'] | float | round(2) }}"
        device_class: energy
        state_class: total_increasing 
        unit_of_measurement: "Wh"
        unique_id: "kostal_grid_consumption_daily"
      - name: "Grid feed - Total per Day"
        state: "{{ state_attr('sensor.kostal_piko_statistic', 'dxsEntries')[0]['value'] - state_attr('sensor.kostal_piko_statistic', 'dxsEntries')[2]['value'] | float | round(2) }}"
        device_class: energy
        state_class: total_increasing 
        unit_of_measurement: "Wh"
        unique_id: "kostal_grid_feed_daily"
      - name: "Self consumption rate - per Day"
        state: "{{ state_attr('sensor.kostal_piko_statistic', 'dxsEntries')[3]['value'] | float | round(2) }}"
        device_class: power_factor
        state_class: measurement
        unit_of_measurement: "%"
        unique_id: "kostal_self_consumption_rate_daily"
      - name: "Degree of self-sufficiency - per Day"
        state: "{{ state_attr('sensor.kostal_piko_statistic', 'dxsEntries')[4]['value'] | float | round(2) }}"
        device_class: power_factor
        state_class: measurement
        unit_of_measurement: "%"
        unique_id: "kostal_degree_self_sufficiency_daily"
    #  Statistics Total:
      - name: "Yield - Total"
        state: "{{ state_attr('sensor.kostal_piko', 'dxsEntries')[3]['value'] | float / 60 | round(2) }}"
        device_class: energy
        state_class: total_increasing 
        unit_of_measurement: "kWh"
        unique_id: "kostal_yield_total"
      - name: "Home consumption - Total"
        state: "{{ state_attr('sensor.kostal_piko_statistic', 'dxsEntries')[6]['value'] | float | round(2) }}"
        device_class: energy
        state_class: total_increasing 
        unit_of_measurement: "kWh"
        unique_id: "kostal_home_consumption_total"
      - name: "Self consumption - Total"
        state: "{{ state_attr('sensor.kostal_piko_statistic', 'dxsEntries')[7]['value'] | float | round(2) }}"
        device_class: energy
        state_class: total_increasing 
        unit_of_measurement: "kWh"
        unique_id: "kostal_self_consumption_total"
      - name: "Grid consumption - Total"
        state: "{{ state_attr('sensor.kostal_piko', 'dxsEntries')[20]['value'] | float  / 60 | round(2) }}"
        device_class: energy
        state_class: total_increasing 
        unit_of_measurement: "Wh"
        unique_id: "kostal_grid_consumption_total"
      - name: "Battery consumption - Total"
        state: "{{ state_attr('sensor.kostal_piko', 'dxsEntries')[19]['value'] | float  / 60 | round(2) }}"
        device_class: energy
        state_class: total_increasing 
        unit_of_measurement: "Wh"
        unique_id: "kostal_battery_consumption_total"
      - name: "Self consumption rate - Total"
        state: "{{ state_attr('sensor.kostal_piko_statistic', 'dxsEntries')[8]['value'] | float | round(2) }}"
        device_class: power_factor
        state_class: measurement
        unit_of_measurement: "%"
        unique_id: "self_consumption_rate_total"
      - name: "Degree of self-sufficiency - Total"
        state: "{{ state_attr('sensor.kostal_piko_statistic', 'dxsEntries')[9]['value'] | float | round(2) }}"
        device_class: power_factor
        state_class: measurement
        unit_of_measurement: "%"
        unique_id: "degree_self_sufficiency_total"
      - name: "Operation time"
        state: "{{ state_attr('sensor.kostal_piko_statistic', 'dxsEntries')[10]['value'] }}"
        unit_of_measurement: "h"
        unique_id: "operation_time"

Sensor Platform Integration:

  - platform: integration
    source: sensor.kostal_output_power
    name: Output power Total
    unit_prefix: k
    round: 2
  - platform: integration
    source: sensor.kostal_home_consumption_solar
    name: Consumption solar Total
    unit_prefix: k
    round: 2
  - platform: integration
    source: sensor.kostal_home_consumption_battery
    name: Consumption battery Total
    unit_prefix: k
    round: 2
  - platform: integration
    source: sensor.kostal_home_consumption_external
    name: Consumption external Total
    unit_prefix: k
    round: 2
  - platform: integration
    source: sensor.kostal_self_consumption
    name: Self consumption Total
    unit_prefix: k
    round: 2
  - platform: integration
    source: sensor.kostal_feed_external
    name: Feed external Total
    unit_prefix: k
    round: 2

Group YAML:

photovoltaik:
    name: Photovoltaik
    entities:
      - sensor.kostal_inverter_type
      - sensor.kostal_inverter_name
      - sensor.kostal_dc_input_total
      - sensor.kostal_output_power
      - sensor.kostal_inverter_type
      - sensor.kostal_operation_status
      - sensor.kostal_dc_input_1_voltage
      - sensor.kostal_dc_input_1_current
      - sensor.kostal_dc_input_1_power
      - sensor.kostal_dc_input_2_voltage
      - sensor.kostal_dc_input_2_current
      - sensor.kostal_dc_input_2_power
      - sensor.kostal_operation_time
homebattery:
    name: Hausbatterie
    entities:
      - sensor.kostal_battery_charging_level
      - sensor.kostal_battery_status
      - sensor.kostal_battery_voltage
      - sensor.kostal_battery_current
      - sensor.kostal_battery_loading_cycles
      - sensor.kostal_battery_temperature
      - sensor.kostal_battery_charging_daily
      - sensor.kostal_battery_consumption_total
homeenergy:
    name: Hausenergie
    entities:
      - sensor.kostal_self_consumption
      - sensor.kostal_self_consumption_rate_daily
      - sensor.kostal_self_consumption_rate_total
      - sensor.kostal_self_consumption_daily
      - sensor.kostal_self_consumption_total
      - sensor.kostal_feed_external
      - sensor.kostal_home_consumption_solar
      - sensor.kostal_home_consumption_battery
      - sensor.kostal_home_consumption_external
      - sensor.kostal_home_consumption_phase_1
      - sensor.kostal_home_consumption_phase_2
      - sensor.kostal_home_consumption_phase_3
      - sensor.kostal_home_consumption_daily
      - sensor.kostal_degree_self_sufficiency_daily
      - sensor.kostal_degree_self_sufficiency_total
      - sensor.kostal_yield_daily
      - sensor.kostal_grid_consumption_daily
      - sensor.kostal_grid_consumption_total

I am open to any optimization potential and support in creating a custom component out of it.

Be aware that this was only tested with a Piko 10 BA inverter based on a newer Software version offering the Rest API. It should work on other Piko inverters with the same API available as well. But the dxsIds maybe different.

Thanks and happy trying!

2 Likes

Hi @bedman ,

thanks for sharing this!
I am sort of in a similar position. A while back I built a custom integration for my Kostal PIKO 8.0 BA.
The code is certainly not up to the quality required to get this into Home Assistant Core, but the energy dashboard gave me some motivation to eventually achieve that.

While building this there has been some confusion about the apis through which the inverters are accessible. In this case it seems like we’re both on the same api. Those dxs.jsons look oddly familiar.
Most of the stuff I did was trying to reverse-engineer the content of the inverters website, as its using the api itself.

I am wondering how to get this going properly:
Would this be a new integration or an extension to the Kostal Plenticore integration, eventually leading to a Kostal integration?

Side note: Has anyone checked the variety of python packages (see a list here) available for the PIKO line of inverters?

Cheers

David

1 Like

Hi David,

thanks for letting me know, that you already have a working custom component. I will definitely check it out. It is funny, I took quite some time, to check if there are available components or libraries, but I was not able to find it. :slight_smile:

My goal is the same as yours, getting the Kostal Piko to work with the energy dashboard and calculating the correct figures for it. If it is ok for you, I would like to contribute to your custom component.

In regards to the integration topic, I would suggest to focus on a separate integration first. The reason is simple, I don’t own a Plenticore inverter and if we would merge Piko and Plenticore API, we need to distinguish them from each other in an automated way. That is not easily achieveable with the lack of actual hardware. Maybe this would be a later step, as soon as the integration is on a good quality level!?

I had a brief look at the libraries. Most of them are focused on either the HTML scrapping integration for “old” Piko versions or on Plenticore integrations. Only the DAMEK86/pykostal: Python library for kostal piko devices (github.com) library is using the dxs.json API. Maybe we can use it as a base for an official integration.

BR,

Michael

Hey,

good point with the two apis. I fully agree, its probably best to keep them separate for now.

The library you’ve linked does look like its doing most of the stuff required.
I will check it out further and compare the IDs I have found to the ones provided by the library.
In case there are some missing, I’d contribute it to the library before removing it from the custom component.
Next up would be checking out the docs and other similar integrations that already support the energy dashboard. It should just be a matter of using a different library while keeping the overall structure the same as other integrations :grinning_face_with_smiling_eyes:

Cheers

David

1 Like

Good news, I just checked the library: All of the ids I figured out are also in the library, so we are good to use it (also from the license perspective).
Potentially there are even more in the lib (I only checked in one direction).

Will start working on embedding this into a component hopefully soon.

I setup my dev environment as well. Looking now into your custom component to make it running with my Piko as well.
In parallel I check the setup of the Plenticore integration. I hope that we can use the same parameter logic for populating the energy dashboard.

How should we align our parallel developments? Should I fork from your custom component?

Hi,

sorry for the late reply.
I have been checking the plenticore integration and reading the docs and started working on the config flow.

Sure, forking my component would work. Alternatively I could invite you to the repo as a contributor, just need your github :slight_smile:
Lmk what you prefer.

Just a quick heads up: Since I am working more on the project and its probably going to be used with other Piko inverters, I have renamed the repository:

1 Like

Hi, this is a great discussion.
I just got my Piko 8.5 installed and now I’m really curious to see if there is a good integration with Home Assistant.
Is there already a public version for this?

Thanks a lot and thanks for your efforts with this!

Hello
is it possible to include your Rest & Template sensors: through an !include …yaml file ?
Thank you

Hello
I tried to implement such very interesting approach for Kostal PIKO but I have these errors

Integration: RESTful (documentation, issues)
First occurred: 13:59:35 (9 occurrences)
Last logged: 14:00:09

with the following Configuration. yaml

rest:

  • authentication : basic
    username: “YYYYYY”
    password: “XXXXXX”
    scan_interval: 10
    resource: “http://192.168.178/api/dxs.json?
    dxsEntries=16780544
    &dxsEntries=16777984
    &dxsEntries=33556736
    &dxsEntries=67109120
    &dxsEntries=83888128
    &dxsEntries=16780032
    &dxsEntries=33555202
    &dxsEntries=33555201
    &dxsEntries=33555203
    &dxsEntries=33555458
    &dxsEntries=33555457
    &dxsEntries=33555459
    &dxsEntries=33556226
    &dxsEntries=33556229
    &dxsEntries=33556238
    &dxsEntries=33556230
    &dxsEntries=33556228
    &dxsEntries=33556227
    &dxsEntries=83886336
    &dxsEntries=83886592
    &dxsEntries=83886848
    &dxsEntries=83887106
    &dxsEntries=83887362
    &dxsEntries=83887618”
    sensor:
    • name: “kostal_piko”
      value_template: “{{ value_json.dxsEntries[0][‘value’] }}”
      json_attributes:
      • dxsEntries

Do you have any idea to solve this ?
Thank you

Hi Larnak,

I think the issue comes from the IP address, that should match your Inverter IP address. “192.168.178” is wrong and should be replaced with your local IP.

Hope this helps!

BR Michael

Hi Thomas,

we are working on a official integration which is still in an early development stage. You can find a first draft in the pull request with scheidtdav’s repository:

Hey,

sorry for the long inactivity with this project. Hope to come back to it soon!
Life is really busy right now.

If you feel adventurous, you can try out an older version of the repository which I have been running for quite some time now.
To install, copy and paste the project into your custom_components folder and set it up in the configuration.yaml (told you its adventurous) as described in the usage section of the README.

Hope that helps!

Edit: Finally have figured out how to enable proper notifications for this thread, I hope to see replies quicker now.

For everyone interested, I now have finally (after a long time, sorry about that. Life happens) created an official integration.

A pull request can be found here: Add integration for Kostal Piko solar inverters by scheidtdav · Pull Request #82391 · home-assistant/core · GitHub

Reviews are appreciated and help bring this into the official Home Assistant!

Hi @scheidtdav , thanks for the integration. I would like to test it, but I am quite new here and I am not sure what to add to my configuration.yaml for getting it to work.

I downloaded the Integration from Git and copied the kostal_piko folder to the custom_components.
To the configuration.yaml I added:
kostal_piko:
host: http://192.168.178.31/

But I get: Integration error: kostal_piko - Integration ‘kostal_piko’ not found.
When checking the yaml.
I guess the user and passtwort are optional paremters, right?

Thx.

Hey @Nacken,

the integration does not require you to do anything in the configuration.yaml (as long as you did download a current version).
Once installed successfully, you can just configure it like any other integration.
Username and password are not optional.

I just fixed a couple of issues with the existing code so it might be worth giving it another try.
Please see the github page and issues for more detail.

Cheers

Hi
I tried to install this new version. I add this custom repository and install itvthrough the integration but I had this error :slight_smile:

Could you help me ?

Hi,

this may sound like a silly question, but is this exactl what you typed in for the host?
That’s not a valid ip address, so I cannot work like this. Username and password are required.

Cheers

Hi
The system put directly the real adress and add xyz. I tried with it, removibg xyz, with username and password but always the same result.

For info I have a piko 5.5