Kostal PIKO and Kostal PIKO IQ support

I have another question, when I tried to find the sensor for the new Energy panel in HA, I found only these two sensors :
image

yeah, you can use the month sensor.
its naming is currently wrong and should be day - I will fix that too :slight_smile:

Ok I was not sure and was searching the daily …:joy:

You can find a new version in the repository.

Simply replace the files in the custom components folder and restart :slight_smile:

The new version does

  • round the values to two decimal digits
  • fixes the yield month issue
  • adds all (and more) discussed sensors :slight_smile:

Maybe you can help me with finding some icons, please?

Hi
thank you for this new version.
Here some proposals (mdi)
Kostal PIKO Own Consumption Day : home-lightning-bolt-outline
Kostal PIKO Home Consumption Solar : solar-power
Kostal PIKO Home Consumption Battery : home-battery
Kostal PIKO Home Consumption Grid : transmission-tower-export
Kostal PIKO Home (do we have export to Grid) : transmission-tower-import
Kostal PIKO Uptime : timer-outline
Kostal PIKO: Kostal PIKO Autarky Day : recycle-variant
Kostal PIKO : Input…Phase…Power : lightning-bolt
Kostal PIKO : for consumption…day : calendar-today
Kostal PIKO : for consumption… month : calendar-today
Kostal PIKO : for consimption…month : calendar-month
I will continue …
Best

Hi Stefan,

we are working on a official component for HA since a few months. You can find the first try for a custom component and the links to the git repos in the following thread:

https://community.home-assistant.io/t/kostal-piko-10-ba-custom-sensor

The official integration will be based on pykostal from DAMKE86 (https://github.com/DAMEK86/pykostal).
We already implemented some extension “scheidtdav” git repos:
GitHub - scheidtdav/pykostal: Python library for kostal piko devices

Maybe we can join forces to make the Kostal Piko component and official integration.

BR Michael

1 Like

To be honest I did this work for someone in a German user forum and I thought I share my work in the official HA forum too to get more testers because I do not have access to a PIKO inverter and it looked like there is a real need for that. Especially with the new energy dashboard. I wanted to give something back to the HA community since HA is for free too and I wanted to help. :slight_smile:

I own a PIKO IQ, but the API works completely different here. I have made an integration for that one as well and I also want to bring into the core rather than into HACS, but there development is still ongoing and not yet published.

Your solution looks pretty good and for me it does not make sense to invest more time into it in that case. Then I will continue with my PIKO IQ integration. I don’t think it makes sense to mix the PIKO and PIKO IQ because everything is different. The PIKO IQ is more like the current Plenticore integration, but it also slightly differs from that one.

1 Like

Hi Stefan,

thank you for the heads up. I didn’t know that Piko IQ is not using the same API as newer Piko inverters. Maybe it makes sense to discuss your requirement directly with the Plenticore developer to make it more compatibile :slight_smile:

I am trying my best to make the “old” Piko integration available. If someone wants to assist, please let me know :+1:

Hi Stefan

Some additional questions for the config of “energy” option in HACS :star_struck:

I am not sure to use the appropriate sensors:

Whats is the sensors for the daily :

Grid (external) consumption : Kostal PIKO Home Consumption Grid ?

Total production : Kostal PIKO Yied Day ?

Grid (ouput) – return to Grid : Kostal PIKO Grid Output Power ?

Thank you

Do you want others icons ?

I dont get the calendar thing :slight_smile:
Which month sensor do you mean?
Same for input phase power - which one do you mean?

BTW you can change the icons easily on your own in the const.py file. There you find the icon="…" stuff for each sensor. :slight_smile: I have uploaded a new version with some icon changes.

total production (on the solar settings) should be yield day.

grid external should be Home Consumption Day

grid output: this one is definetly wrong, because the one you choose is what your inverter currently provides to your house. here you would need a sensor that calculates the difference between what is provided by your inverter and what is consumed by your house. usually this is meassured by a energy meter. Do you have one?Next can you check the webinterface if you see any value there that tells you how much energy is currently returned tothegrid?

Have you found any issues with the units, formatting or stuff like that?

Hi I have the following errors in the log :star_struck:

Entity sensor.kostal_piko_own_consumption_quota_day from integration kostal_piko has state class total_increasing, but its state is not strictly increasing. Triggered by state 98.9 with last_updated set to 2022-01-30T08:49:12.541734+00:00. Please report it to the custom component author.

09:50:10 – (ATTENTION) Capteur

sensor.kostal_piko_current_self_consumption has unit kW which is unsupported for device_class energy

09:50:10 – (ATTENTION) Capteur

1 Like

I will fix that, no problem.

What about my question regarding the grid output? :slight_smile:

Hi

for live :

Production : Kostal PIKO Total DC Input
Consuption from Solar : Kostal PIKO Current Self Consumption
Output to Grid : Kostal PIKO Total DC Input - Kostal PIKO Current Self Consumption
Input from Grid : need 83886848

For day :
Production Solar : Kostal PIKO Yield Day
Consumption from Solar : Kostal PIKO Own Consumption Day
Home Consumption : Kostal PIKO Home Consumption Day
Total from Grid : not found
Out to Grid : Kostal PIKO Yield Day - Kostal PIKO Own Consumption Day ?

Hi I add these calculations in the YAML :star_struck:

  • platform: template
    sensors:
    kostal_outputgrid:
    friendly_name: “Kostal Piko Output Grid day”
    unit_of_measurement: “kWh”
    device_class: “energy”
    value_template: “{{ states(‘sensor.kostal_piko_yield_day’) |float - states(‘sensor.kostal_piko_own_consumption_day’) | float }}”

    kostal_inputgrid:
      friendly_name: "Kostal Piko Input Grid day"
      unit_of_measurement: "kWh"
      device_class: "energy"
      value_template: "{{ states('sensor.kostal_piko_home_consumption_day') |float - states('sensor.kostal_piko_own_consumption_day') | float }}"
    

but these two sensors are not available in the Enerygy config ?

I have fixed the warnings you have mentioned.

for live (my suggestion / correction):

Production : Kostal PIKO Total DC Input → this is the DC power that is currently coming from your solar panels to your inverter. This is not what the inverter produces but what is available for converting.
If you want to visualize what falls out off your inverter into your grid you have to use Kostal PIKO Grid Output Power. I am displaying this as “Available DC Input”.

This is how it looks like on my inverters webinterface:
image
1.9kW is the DC Input
1.8 is the Grid Output Power

BTW: I have renamed Kostal PIKO Total DC Input to Kostal PIKO Current DC Input because it was misleading with the “Total”. :slight_smile:

Output Inverter /Grid output :Kostal PIKO Grid Output Power

Consuption Self Consumption : Kostal PIKO Current Self Consumption (how does this one differ from Kostal PIKO Current Self Consumption? I think there are two sensors for the same value, is that possible?)

Input from Grid : need 83886848 → that is Kostal PIKO Home Consumption Grid

For day :
Production Solar : Kostal PIKO Yield Day
Consumption from Solar : Kostal PIKO Own Consumption Day
Home Consumption : Kostal PIKO Home Consumption Day

These two are not provided by your inverter, or have you found it somewhere in the webinterface?

Total from Grid : not found → it is not even easy to calculate this from the available Kostal PIKO Home Consumption Grid (83886848) sensor… :frowning:

Out to Grid : Kostal PIKO Yield Day - Kostal PIKO Own Consumption Day ? → yeah - that should work.

You are missing state_class: total_increasing in your template sensors.

platform: template
  sensors:
    kostal_outputgrid:
      friendly_name: “Kostal Piko Output Grid day”
      unit_of_measurement: “kWh”
      state_class: total_increasing
      device_class: energy
      value_template: “{{ states(‘sensor.kostal_piko_yield_day’) |float - states(‘sensor.kostal_piko_own_consumption_day’) | float }}”

    kostal_inputgrid:
      friendly_name: "Kostal Piko Input Grid day"
      unit_of_measurement: "kWh"
      state_class: total_increasing
      device_class: energy
      value_template: "{{ states('sensor.kostal_piko_home_consumption_day') |float - states('sensor.kostal_piko_own_consumption_day') | float }}"

@bedman Maybe the output to grid and total from grid thing is something you want to consider in your integration and provide it automatically as sensor?

BTW feel free to copy and of my code and use it in our integration. :slight_smile:
Looks like we are now on a good track and have found all the display / associatation issues in my code. :slight_smile:

@Larnak Does it work for you now?

Hi no I have the following error
Invalid config for [sensor.template]: [state_class] is an invalid option for [sensor.template]. Check: sensor.template->sensors->kostal_outputgrid->state_class. (See ?, line ?).

Hi in addition, in the configuration for the energy, I do not find the other sensors, I have only the following possibilities :

image

Moreover, it seems that two sensors have the same value :

sensor.kostal_piko_home_consumption_solar and sensor.kostal_piko_current_self_consumption

Hi any ideas with my last questions ?