Kostal PIKO and Kostal PIKO IQ support

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 ?

have you checked the docs at Template - Home Assistant about template sensors? there it is said that using value_template is the old legacy format and that does not support state_class.

Try changing value_template to state should work, but I am not an expert on that field, I am guessing too :wink:

About
sensor.kostal_piko_home_consumption_solar and sensor.kostal_piko_current_self_consumption: The sensors are using a different dsxId - I dont know why there are two different IDs exposing the same value :thinking:

For which sensor are you looking for / which one are you missing? I dont speak French so I dont understand which value you are trying to configure :disappointed_relieved:

Have any of your experience that the inverter “dies” when the local web page is polled by HA?
Since I have installed the integration I have seen that inverter stops responding and then just stay in Poweroff mode or standby. I then have to remove power from it a power it back on.
I never had this before the HA integration was started to poll the local web page.
Any ideas to avoid this ?

is there anything in the logsof your inverter?
maybe there is a newer firmware available too?

@TwIXx does it work now for you? :slight_smile:

Yes, its working. It was my mistake when I tried to set it up.
I’m using your plugin and also the other one for the old Piko. They can work both together.

1 Like

Hi Stefan,

hope all well on your end?
I´m quite new in that community and came across this channel as I´m trying to get my Kostal Piko IQ integrated into HA. Well, its not as easy as i thought…looks like the Piko Iq os not supporting “dxsId”. Took me hours to get to that point :slight_smile: A question I got to you: You`ve mentioned you got a Kostal Piko IQ integration ready? Would you mind and share that with me? My approaches using the REST API i.e. https://192.168.178.x/api/v1/processdata failed so far :slight_smile:

Thanks for your help,
Patrick

Hey Patrick,

of course, I will upload it to https://github.com/sla89/hassio-kostal-piko-iq this weekend. :slight_smile:

I will let you know when it is there.

Update
I have uploaded the sources and some instructions. Can you please try it out? It works on my HA instance. If you need any additional sensor data let me know - I can add them for you. Currently it only supports a small set of values because I saw no need in querying everything that is possible. Next my inverter does not know anything about how much my house consumes and how much flows back into the grid. If you need that let me know.
You can use Kostal Yield Day sensor in the energy dashboard. :slight_smile:

@pazo2303 Welcome to Home Assistant :slight_smile: Let me know if you need anything else.

Hello,
I am using @sla89 s Integration, and i have the Entitys, but they are just “Unavailable”.

Maybe I have to define the Password?

-I have a PIKO 4.2 SWAG running
-The webinterface just looks like the one from pergola.fabio

if someone could help me i would be very grateful :smiley:

@Maaarc can you please do the following:

  • Open chrome or edge browser
  • open the developer console in Google Chrome/edge: open the menu in the upper-right-hand corner of the browser window and select More Tools > Developer Tools .
  • Select the network tab
  • Open the webinterface of your inverter

Now please check the network view and look for the api calls, like the one you have tried to open.

I dont know the swag edition. Have googled if it exposes the data by dxs.json or rest api? When you have tested my instructions above we know more :slight_smile:

Maybe we need an extra layer of authetication in sour case. So far I only know that this is necessary for IQ and Plenticore Plus inverters.

Hey @sla89 ,
I uploaded a Video to show all Information I get, because i am not quite sure for what we are looking.

Also, as said, i had/have to insert my password and username when opening the Website.

I hope i providet all information, you need.

Okay, I see.

Do you know if there are some default credentials?

I think adding authentication isnt a big deal.
Would you test my implementation since I have no device I can use for testing ^^

Yes there are default credentials, which I use to login into the Webinterface.

Username: pvserver
Password: pvwr
Btw. password can be changed in the Settings.

Or do you mean other credentials?

And of course I would like to test your implemetation :slight_smile:

Thanks, so I can use them in my code too for those that don’t change the password.

I think I will have some time till the end of the week.

1 Like

@Maaarc I have implemented the authentication mechanism in a branch. Can you give it a try please?

Simply copy the code as you have already done it.

Here is the code: https://github.com/sla89/hassio-kostal-piko/tree/add_authentication

Hi @sla89,

first of all - thanks a lot for all the work you are putting into this, really great and highly appreciated!

I downloaded the repository via HACS, restarted and eddited the configuration.yaml with

sensor:
- platform: kostal_piko
host: IP_OF_MY_INVERTER

If I search for “Piko” in the entities I now find quite a number of them, however, they all show as status that they do not have a unique ID and hence cannot be accessed.

Any idea what I am doing wrong here?

Thanks a lot fro your help in advance.
Best
Bastian