GithubHelp home page GithubHelp logo

kostalpiko-sensor-homeassistant's Introduction

I will archive this custom component since my Kostal inverter is broken and I can not test any changes, you should try https://github.com/rcasula/kostalpiko-homeassistant

kostalpiko-sensor-homeassistant

A custom component to get the readings of a Kostal Piko inverter NOT the Plenticore inverter

Since the component is based on web scraping from the web server interface, your web server should look like this. You can try like this

http://pvserver:<YOUR_PASSWORD>@<YOUR_INVERTER_IP>/index.fhtml

Otherwise it will not work

Alt text

sensor:
  - platform: kostal
    host: !secret kostal_host  # "http://192.168.xx.xx"
    username: !secret kostal_username
    password: !secret kostal_password
    monitored_conditions:
      - solar_generator_power  # only available when using a BA sensor
      - consumption_phase_1    # only available when using a BA sensor
      - consumption_phase_2    # only available when using a BA sensor
      - consumption_phase_3    # only available when using a BA sensor
      - current_power
      - total_energy
      - daily_energy
      - string1_voltage
      - string1_current
      - string2_voltage
      - string2_current
      - l1_voltage
      - l1_power
      - l2_voltage
      - l2_power
      - l3_voltage
      - l3_power
      - status

kostalpiko-sensor-homeassistant's People

Contributors

feutl avatar gieljnssns avatar guille-mas-coll avatar vedeneb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

kostalpiko-sensor-homeassistant's Issues

Error while setting up kostal platform for sensor - IndexError: list index out of range

I'm getting the following error in the log after adding kostal platform in my config file
Device seems to be a PIKO 10.1

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 178, in _async_setup_platform
    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/kostal/sensor.py", line 65, in setup_platform
    dev.append(PikoInverter(data, sensor, config[CONF_NAME]))
  File "/config/custom_components/kostal/sensor.py", line 82, in __init__
    self.update()
  File "/config/custom_components/kostal/sensor.py", line 106, in update
    self.piko.update()
  File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 239, in wrapper
    result = method(*args, **kwargs)
  File "/config/custom_components/kostal/sensor.py", line 237, in update
    self.data = self.piko._get_raw_content()
  File "/usr/local/lib/python3.7/site-packages/kostalpyko/kostalpyko.py", line 198, in _get_raw_content
    status = response.xpath("/html/body/form/font/table[2]/tr[8]/td[3]")[0].text.strip()
IndexError: list index out of range

Config yaml

- platform: kostal
   host: !secret kostal_host
   username: !secret kostal_user
   password: !secret kostal_password
   monitored_conditions:
     - current_power
     - total_energy
     - daily_energy
     - string1_voltage
     - string1_current
     - string2_voltage
     - string2_current
     - l1_voltage
     - l1_power
     - l2_voltage
     - l2_power
     - l3_voltage
     - l3_power
     - status

Screenshot of the PIKO webserver
Capture d'écran 2020-05-26 20 21 36

Cannot get component running

home-assistant.log

2019-12-14 21:49:25 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform kostal
Traceback (most recent call last):
  File "/opt/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 150, in _async_setup_platform
    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
  File "/usr/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
    return fut.result()
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/homeassistant/.homeassistant/custom_components/kostal/sensor.py", line 65, in setup_platform
    dev.append(PikoInverter(piko, sensor))
  File "/home/homeassistant/.homeassistant/custom_components/kostal/sensor.py", line 81, in __init__
    self.update()
  File "/home/homeassistant/.homeassistant/custom_components/kostal/sensor.py", line 114, in update
    self._state = self.piko.get_current_power()
  File "/opt/homeassistant/lib/python3.6/site-packages/kostalpyko/kostalpyko.py", line 80, in get_current_power
    if self._get_raw_content() is not None:
  File "/opt/homeassistant/lib/python3.6/site-packages/kostalpyko/kostalpyko.py", line 192, in _get_raw_content
    raise ConnectionError
ConnectionError

Config

sensors.yaml

- platform: kostal
host: !secret kostal_host
username: !secret kostal_username
password: !secret kostal_password
monitored_conditions:
- current_power
- total_energy
- daily_energy
- string1_voltage
- string1_current
- string2_voltage
- string2_current
- l1_voltage
- l1_power
- l2_voltage
- l2_power
- l3_voltage
- l3_power

secret.yaml

kostal_host: "http://172.22.40.107"
kostal_username: "pvwr"
kostal_password: "pvserver"

No data retrived from my Kostal piko 4,2

I have followed your fine description, but I cant get any data in my HA. I can see all the entities, but they all say "Unknown" in the UI

I dont get other errors

Config yaml

sensor:

  • platform: kostal
    host: "http://192.168.1.110"
    username: !secret kostal_username
    password: !secret kostal_password
    monitored_conditions:
    • total_energy
    • daily_energy
    • string1_voltage
    • string1_current
    • string2_voltage
    • string2_current
    • l1_voltage
    • l1_power
    • l2_voltage
    • l2_power
    • l3_voltage
    • l3_power
    • status

Screenshots
If applicable, add screenshots to help explain your problem.
image

Hope you can help, I am new to this.

Better support for multiple Piko's and adding the status as a sensor

Hi,

first of all, thanks for this integration, it works flawlessly!
I have two suggestions/feature requests:

First, I have three identical Kostal Pikos (because we have a huge roof with lots of Solar Panels :)). I added them all the same way to the config:

- platform: kostal
  host: http://192.168.178.251
  username: pvserver
  password: aaa
  monitored_conditions:
    - current_power
    - ....
- platform: kostal
  host: http://192.168.178.252
  username: pvserver
  password: aaa
  monitored_conditions:
    - current_power
    - ....
- platform: kostal
  host: http://192.168.178.253
  username: pvserver
  password: aaa
  monitored_conditions:
    - current_power
    - ....

It does work, all entities have been registered successfully. However, they are called like this:
sensor.kostal_piko_current_power
sensor.kostal_piko_current_power_2
sensor.kostal_piko_current_power_3

which is ok, however I think a little configuration option for a custom name would be the better solution. So if I would set up the integration like this:

- platform: kostal
  name: Solar 1
  host: http://192.168.178.251
  username: pvserver
  password: aaa
  monitored_conditions:
    - current_power
    - ....

the entities would be called
sensor.solar_1_current_power
and so on.

The second that would be great if you could add it would be a sensor exposing the current status of the Piko.
image

That way one could easily build automations to send notifications e.g. if the state changes to an error.

Thanks in advance and thanks again for the integration!

Vedeneb

Error while setting up Kostal component

Hello,
after I installed your kostal component via hacs, and configured it in sensors.yaml, I restarted homeassistant. Now I got this in the logs:

2019-11-12 17:39:09 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform kostal
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 150, in _async_setup_platform
    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
  File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/homeassistant/.homeassistant/custom_components/kostal/sensor.py", line 57, in setup_platform
    from kostalpyko.kostalpyko import Piko
  File "/srv/homeassistant/lib/python3.7/site-packages/kostalpyko/kostalpyko.py", line 6, in <module>
    from lxml import html
ModuleNotFoundError: No module named 'lxml'

Anything I could try? I'm running on hassbian, with latest homeassistant version.

Platform error sensor.kostal - Integration 'kostal' not found.

After last update geting this error.And entity are anaveliable.

Platform error sensor.kostal - Integration 'kostal' not found.

HA core-2021.6.3

  • platform: kostal
    host: myhost
    username: myusername
    password: mypass
    monitored_conditions:
    • solar_generator_power # only available when using a BA sensor
    • consumption_phase_1 # only available when using a BA sensor
    • consumption_phase_2 # only available when using a BA sensor
    • consumption_phase_3 # only available when using a BA sensor
    • current_power
    • total_energy
    • daily_energy
    • string1_voltage
    • string1_current
    • string2_voltage
    • string2_current
    • string3_voltage
    • string3_current
    • l1_voltage
    • l1_power
    • l2_voltage
    • l2_power
    • l3_voltage
    • l3_power
    • status

String No 3 it is not showing ok.

Describe the bug
The strings 1 and 2 showing normal as they are at my costal device.The string 3 it is showing much more current as must be.for example. Must be 4A and showing 4000A.

curent

kostal_piko_daily_energy vs utility_meter

Describe the bug
I don't understand why the values of utility_meter (daily) do not match the kostal_piko_daily_energy?
The values of the utility_meter sensor are much higher than those of the kostal_piko_daily_energy?

sensor kWh
sensor.ertrag_photovolatik_tag 24.35
sensor.kostal_piko_daily_energy 15.65

Config yaml

sensor:
  - platform: kostal
    host: !secret kostal_host  # "http://192.168.xx.xx"
    username: !secret kostal_username
    password: !secret kostal_password
    monitored_conditions:
      - current_power
      - total_energy
      - daily_energy
      - string1_voltage
      - string1_current
      - string2_voltage
      - string2_current
      - l1_voltage
      - l1_power
      - l2_voltage
      - l2_power
      - l3_voltage
      - l3_power
      - status

utility_meter:
  ertrag_photovolatik_day:
    source: sensor.kostal_piko_current_power
    cycle: daily
  ertrag_photovolatik_month:
    source: sensor.kostal_piko_current_power
    cycle: monthly
ertrag_photovolatik_year:
    source: sensor.kostal_piko_current_power
    cycle: yearly

Additional context

I am doing something wrong in the configuration.

Error

Dear all

I have the following messages in HASSIO 👍

Error while setting up kostal platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 179, in _async_setup_platform
    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/kostal/sensor.py", line 65, in setup_platform
    dev.append(PikoInverter(piko, sensor))
  File "/config/custom_components/kostal/sensor.py", line 81, in __init__
    self.update()
  File "/config/custom_components/kostal/sensor.py", line 114, in update
    self._state = self.piko.get_current_power()
  File "/usr/local/lib/python3.7/site-packages/kostalpyko/kostalpyko.py", line 81, in get_current_power
    return int(self._get_raw_content()[0])
IndexError: list index out of range

Could you please help me

PIKO MP plus 1.5

Hi,
I’m have one PIKO 1.5-1 MP plus and don’t portal to connect on this.
when open connection on piko MP plus I’m arrive directly on screen remote control.

How to set up the parameters to activate the sensors?

thk’s for your help.

No data retrived

Hello,

I manage to install and see the sensor in the interface but I have no information retrieved.

This is my configuration.yaml sensor section

sensor:
- platform: kostal 
  host: 'http://192.168.1.36'
  username: pvwr
  password: pvserver
  monitored_conditions:
    - solar_generator_power
    - consumption_phase_1
    - consumption_phase_2
    - consumption_phase_3
    - current_power
    - total_energy
    - daily_energy

and as you can see below no datas... and believe me right now we have a lot of sun!
image

I'm using hassio version and I can't use PIP or at least I don't know how to do that...

I hope you can help me with that :) I'm super excited to integrate my little PV production to my Home Assistant interface.

Version numbering?

Latest version is called v0.3. Should be v2.3, right?
What changed here? Could not find it in the version description.
Thanx for maintaining, gieljnssns!

Kostal visible as device

The Hacs Integration works
and some Entities are visible after Installation.
Many Thanks to your work to make it happen.

However there is no Devcie shown as a Device ID is missing . Would that be possible to add into the .yaml definition?

IndexError

Describe the bug
I am trying to set this plugin but a get an error IndexError. I use PIKO 10.1 Namenlos (255)
When i open the web page with myurl/index.fhtml, it wotking ok.

Any errors

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 178, in _async_setup_platform
    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/kostal/sensor.py", line 65, in setup_platform
    dev.append(PikoInverter(data, sensor, config[CONF_NAME]))
  File "/config/custom_components/kostal/sensor.py", line 82, in __init__
    self.update()
  File "/config/custom_components/kostal/sensor.py", line 106, in update
    self.piko.update()
  File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 240, in wrapper
    result = method(*args, **kwargs)
  File "/config/custom_components/kostal/sensor.py", line 237, in update
    self.data = self.piko._get_raw_content()
  File "/usr/local/lib/python3.7/site-packages/kostalpyko/kostalpyko.py", line 198, in _get_raw_content
    status = response.xpath("/html/body/form/font/table[2]/tr[8]/td[3]")[0].text.strip()
IndexError: list index out of range

Config yaml

sensor:
  - platform: kostal
    host: !secret kostal_host
    username: !secret kostal_username
    password: !secret kostal_password
    monitored_conditions:
      - solar_generator_power  # only available when using a BA sensor
      - consumption_phase_1    # only available when using a BA sensor
      - consumption_phase_2    # only available when using a BA sensor
      - consumption_phase_3    # only available when using a BA sensor
      - current_power
      - total_energy
      - daily_energy
      - string1_voltage
      - string1_current
      - string2_voltage
      - string2_current
      - l1_voltage
      - l1_power
      - l2_voltage
      - l2_power
      - l3_voltage
      - l3_power
      - status

secret:
  kostal_host: http://192.168.5.168/index.fhtml
  kostal_username: pvserver
  kostal_password: pvwr

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Unexpectedd Error when trying to connect

Describe the bug
When I try to enter the IP adress as the host and the password, I only get an error message that says "Unexpected error".

Any errors

Unexpected error

Config yaml

# Loads default set of integrations. Do not remove.
default_config:

# Text to speech
tts:
  - platform: google_translate

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
I installed it via HACS in Home Assistant.
Accessing it via the IP works and the interface looks like the one shown in the readme.

Detected I/O inside event loop

This warning was shown in the logs after integrating the kostal custom component:

Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for kostal doing I/O at custom_components/kostal/sensor.py, line 250: self.info = self.piko._get_info()

Propably this should be moved outside the ui thread.

No 'version' key in the manifest file for custom integration 'kostal'.

Describe the bug
At HA startup, I see an error in the log:
Logger: homeassistant.loader Source: loader.py:794 First occurred: 07:49:09 (1 occurrences) Last logged: 07:49:09 No 'version' key in the manifest file for custom integration 'kostal'. As of Home Assistant 2021.6, this integration will no longer be loaded. Please report this to the maintainer of 'kostal'

Any errors

see above

Config yaml

N/A

Screenshots
N/A

Additional context
Home Assistant 2021.5.3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.