Setting Feed in limitation for PIKO 17 (without KSEM)

  • Hello,


    I have been reading this forum for a while and it is the biggest knowledge base of Kostal products by far. But there is something that I couldn't find information about.

    Unfortunately I don't speak German, but you can write back in German if you feel more comfortable that way. Google does a good job translating it.


    I have PIKO 17 inverter and I am trying to achieve a grid feed in limit. It is something which is normally done in cooperation with the KSEM. I want to replicate same thing but without KSEM.

    I'm not sure about Germany, but in our country the electricity price can go negative for some periods of time and I want to limit the feed in to the grid on those hours. So that I would not need to pay money for my solar panels running on full power.

    I have implemented my own controller on Raspberry PI which already:

    - Knows about Feed in or purchase rate to/from the grid using an energy meter

    - Knows about electricity prices

    - Has data from the PIKO 17 inverter using its REST API (with dxsEntries)

    - Controls some of the big energy consumers like making hot water and charging an electric car


    But what I haven't been able to work out is setting the Feed in limit to PIKO inverter over TCP. As far as I know, the REST API of the inverter only works for getting data from the inverter. Setting the limit is something that KSEM normally does when set up over LAN/TCP, so there needs to be a way for it. And I want to replicate the same way, but just with my own controller instead of KSEM. But I have no idea how KSEM and PIKO are implemented to communicate with each other.

    I have tried implementing ModBus, but I couldn't find any official documentation for PIKO 17 about modbus. I have tried requesting different registry addresses with both ports 502 and 1502 but with no luck, always getting connection timeout. So I am thinking that maybe ModBus over TCP is not supported at all for PIKO. Even though it seems like a very logical way for communication between KSEM and PIKO.


    Does anyone have more information about this? As KSEM can do it, there needs to be a way for me to implement the same thing with my own controller..


    It would be very helpful for me.

    Kind regards,

    Oliver

  • Hi Oliver,


    I know that Parako (with installer code) can be used to set a hard limit for the inverter. This feature has been there since forever for Kostal inverters.


    The Piko NGs, like the Piko 10-20, officially support the KSEM and according to the docs, the KSEM can control the power. How is the question? I suppose Modbus TCP, but it seems that the inverter is not responding to requests like a Plenticore. Does anyone know know the KSEM controls power on these inverters?


    The REST API works, but to my knowledge only reading is supported.

  • Communication between KSEM and Piko ist proprietary (and not Modbus TCP). But the Piko supports Modbus TCP for sure. You can request the Modbus register description from Kostal.

  • I guess you mean: The PIKO Supports Modbus RTU (via RS485), but not Modbus TCP.


    Is it possible to get the documention for the KSEM communication? Or has anyone sniffed the data exchanges?

  • Sorry you are right. Modbus RTU it is - I have connected it to a raspberry pi which has mbusd running which makes Modbus tcp out of it ;).

    I use the Modbus rtu on my Piko 15. Piko 17 is the same I think. Kostal requires signing a NDA for giving away the Modbus spec. It can be sniffed easily be comparing register changes with values from the webinterface though. The set point registers can‘t be easily determined. The spec is needed for those I think.


    Edit: sorry you asked about the ksem communication. I sniffed that one with my managed switch. But I didn’t make any progress on that because what I needed was achievable via rs485/ Modbus rtu…

  • Thanks for replies, guys!! I think we're getting somewhere already.

    So, first of all, I got the confirmation that PIKO doesn't support ModBus TCP. That's good to know, so I don't need to run any additional tests for that.

    I have also briefly considered ModBus TCP to RTU gateway but I hadn't heard about mbusd open source project. That's certainly an option for me. Although it would require adding additional hardware near my PIKO. It is located far away from my existing Raspberry PI and only LAN network is available between those two right now.

    I have also considered sniffing KSEM - PIKO communication myself. I was hoping that perhaps someone has done it for me already :) I don't feel very comfortable with networking so I'm not confident I could make any sense out of the data that they might be sending to each other. But I have an understanding on how to set it up, so perhaps it's worth trying. This solution would be the most desired for me as I wouldn't need to add any additional hardware.


    I will think about those two options a bit.


    I actually have a third idea too.. which would be using the KSEM afterall. And just using my Raspberry PI to enable/disable the Feed-in limit in KSEM depending on the electricity price. But there are two problems with this idea:
    1) Modbus register of KSEM doesn't specify enabling/disabling the feed-in limit. Although, I was sniffing KSEM web interface a bit some time ago and I think there could be a way to enable/disable feed-in limit using http requests to KSEM. I didn't try it out yet though.

    2) In case I connect PIKO and KSEM in Settings of the KSEM, I am experiencing the very same problem as discussed in this thread: Neuer Piko15 startet morgens nicht von selbst, erst nach AC on/off

    It's happening pretty much in the same way as described in this thread. And only if KSEM and PIKO are configured to talk to each other. No matter if Feed-in is limited or not. As long as they don't have this integration enabled, PIKO works just fine. I was just thinking that maybe it is easier for me to make my own implementation of Feed-in, rather than try fixing this super annoying issue.

  • Zum Thema Kostal Piko 4.2-20 und Modbus TCP möchte ich gerne nochmals nachhaken.


    Im Dokument von Kostal Installationsleitfaden Verschaltung und Einrichtung mehrerer KOSTAL-Wechselrichter

    steht im Abschnitt Installation der Kommunikationsverbindung:

    Die Kommunikation zwischen dem KOSTAL Smart Energy Meter und den KOSTAL-Wechselrichter wird

    über das Modbus-Protokoll durchgeführt. Dazu muss das Modbus-Protokoll im Wechselrichter aktiviert

    werden.

    Für Piko IQ, PLENTICORE plus oder PLENTICORE BI wird beschrieben wie man Modbus TCP aktivieren kann. Es folgt:

    Beim PIKO MP plus, PIKO 4.2-20 (FW >= 05.00) oder PIKO EPC

    Bei diesen Wechselrichtern sind keine weiteren Einstellungen notwendig.

    Ich hätte es so gedeutet, dass diese WR seit Firmware 5.00 Modbus TCP sehr wohl unterstützen, man aber nichts einstellen kann und scheinbar auch ohne Transport Layer Security.

    Nun, gibt es im KSEM noch die Auswahl des Wechselrichters. Hier könnte natürlich Kostal für die Wechselrichter gänzlich unterschiedliche Protokolle zum Wechselrichter auswählen. Die Frage ist nun: Was für ein Protokoll ist das? Wie kann man hier dem WR den Hausverbrauch mitteilen bzw. die Leistung regeln?


    @Memphiz: Welche Features von Modbus RTU nutzt du, die die REST API nicht hat?

  • Ich benutze Modbus rtu deshalb, weil der WR morgens nicht aufwacht sowie ich den im Netzwerk habe. Daher habe ich den vom LAN getrennt und lese ihn komplett via Modbus rtu aus.


    Das ist der zugehörige Thread dazu:



    Was mir noch eingefallen ist. Der TCP Port auf dem der Piko für den KSEM ansprechbar ist erlaubt nur eine Verbindung. Sollte man also das Protokoll rausbekommen haben kann man entweder den KSEM mit dem Piko Verbinden - oder ein evtl. Entwickeltes custom tool. Beides geht dann nicht.


    Hier sieht es so aus als ob jemand ein offizielles Dokument zu dem Protokoll auf Port 81 hat … https://homematic-forum.de/forum/viewtopic.php?t=42398 - dort auf den Screenshots sieht man die messages die mit 0x62 losgehen … so da das zwischen ksem und Piko auch aus …

  • I use Modbus rtu because the WR doesn't wake up in the morning as I have it in the network. So I disconnected it from the LAN and read it completely via Modbus rtu.


    This is the related thread:


    That's exactly the same issue as I'm having. And why I'm looking into developing my own alternatives to KSEM. Only difference that for me, it is enough that I just removed the inverter from KSEM Settings interface. After that I can still use my own HTTP requests to get data from PIKO and if won't go "Off" any more.