sla89 / hassio-kostal-piko

Home Assistant Kostal PIKO Inverter Integration
MIT License
13 stars 4 forks source link

Kostal Pico in Master/Slave configuration #17

Open Boxer0815 opened 3 weeks ago

Boxer0815 commented 3 weeks ago

Hello, is it also possible to integrate a Master/Slave configuration where both devices have a seperate IP-Adresse?

sla89 commented 2 weeks ago

Hey,

mhm I have no information about how that works in your Inverter.

You could run the plugin twice an get the values of both inverters, if that is what you want?

Boxer0815 commented 2 weeks ago

Hi, I tried to run it twice (i added the other inverter with IP-Adress). Unfortunately it is not possible as I can't assign a name to each instance.

sla89 commented 2 weeks ago

You can run two ibstances for different IP addresses easily, but you need to adapt the code a little bit.

Here are the instructions:

  1. First install the integration as usual for your master inverter
  2. Now make a copy of that folder in the custom_components folder an rename it to, e.g kostal_piko_slave

When this is done change the following files in that folder:

  1. change the domain to kodtal_piko_slave in zhe manifest.json, see here https://github.com/sla89/hassio-kostal-piko/blob/74900d8690ff2b4509fd1ed14a70fc0b6fb46ddd/custom_components/kostal_piko/manifest.json#L2 This new domain needs to be used in the configuration.yaml and you will have there something like this:
sensor:
  - platform: kostal_piko
    host: IP_OF_YOUR_master
  - platform: kostal_piko_slave
    host: IP_OF_YOUR_slave

Now the most tricky part:

  1. open the const.py file in your slave folder, this one: https://github.com/sla89/hassio-kostal-piko/blob/74900d8690ff2b4509fd1ed14a70fc0b6fb46ddd/custom_components/kostal_piko/const.py
  2. search for key="kostal_piko and teplace it with key="kostal_piko_slave - there should be 40 hits. this will rename the sensors to kpstal_piko_slave_XXX.

Ensure config is valid and reboot. Zhen check the logs.

Anyhow it should be easy to extend the integration to support it out of the box but currently I dont have time the next 2-3 weeks.

Boxer0815 commented 2 weeks ago

Thanks a lot - I had also to replace the Sensor name from "Kostal Piko xxx" to "Kostal Piko Slave xxx" in the const.py file. To Identify the Integration I changed in the manifest.json file the name of teh integration to "Kostal PIKO Solar Inverter Slave"

{ "domain": "kostal_piko_slave", "name": "Kostal PIKO Solar Inverter Slave", "documentation": "https://github.com/sla89/hassio-kostal-piko", "issue_tracker": "https://github.com/sla89/hassio-kostal-piko", "requirements": [], "codeowners": ["sla89"], "version": "1.10", "iot_class": "local_polling" }

sla89 commented 2 weeks ago

So it is working for you? :)

Boxer0815 commented 2 weeks ago

Yes - perfect!