gieljnssns / kostalpiko-sensor-homeassistant

A custom component to get the readings of a Kostal Piko inverter
MIT License
12 stars 18 forks source link

Error #6

Closed Larnak23 closed 4 years ago

Larnak23 commented 4 years ago

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

gieljnssns commented 4 years ago

Can you please format any errors or code? https://help.github.com/en/github/writing-on-github/creating-and-highlighting-code-blocks

Also post your config

gieljnssns commented 4 years ago

And what type of inverter are you using?

Larnak23 commented 4 years ago

Hello

I am using the Kostal Piko 5.5 and in the configuration I add ๐Ÿ‘ platform: kostal host: 'http://192.168.1.XX' username: 'abcd' password: 'efg' monitored_conditions:

gieljnssns commented 4 years ago

Can you please format any errors or code? https://help.github.com/en/github/writing-on-github/creating-and-highlighting-code-blocks

And try this

- platform: kostal
  host: 'http://192.168.1.XX'
  username: abcd
  password: efg
  monitored_conditions:
    - current_power
    - total_energy
    - daily_energy
    - string1_voltage
    - string1_current
    - string2_voltage
    - string2_current
Larnak23 commented 4 years ago

Hi

Unfortunately same errors :

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
Larnak23 commented 4 years ago

I add this information in the following configuration ?

sensor:
  - platform: kostal
molelightn commented 4 years ago

Hi, sry for not beeing able to format errors in a correct way, i have a similar problem as Larnak with my Kostal Plenticore Pico 5.5. Log writes out:

2020-03-18 05:53:08 ERROR (MainThread) [homeassistant.components.sensor] 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 80, in get_current_power
    if self._get_raw_content() is not None:
  File "/usr/local/lib/python3.7/site-packages/kostalpyko/kostalpyko.py", line 192, in _get_raw_content
    raise ConnectionError
ConnectionError
gieljnssns commented 4 years ago

Could you please have al look at this issue https://github.com/gieljnssns/kostalpiko-sensor-homeassistant/issues/5?

gieljnssns commented 4 years ago

If you have a plenticore inverter take a look at https://community.home-assistant.io/t/solar-inverter-kostal-plenticore-plus-integration/143874.

molelightn commented 4 years ago

ty

gieljnssns commented 4 years ago

@Larnak23 is yours a Plenticore?

benny0708 commented 4 years ago

Hi, I have the same issue. Using a Kostal Piko 8.5 bought in 2017.

Larnak23 commented 4 years ago

No kostal piko

gieljnssns commented 4 years ago

Can you guys post a screenshot when you paste this in your browser

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

You can also try to replace the sensor.py file in the .../config/custom_components/kostal/ map by this file https://gist.github.com/gieljnssns/57ca8351af89ed921fe8f83600164900

The add

logger:
  default: error
  logs:
    custom_components.kostal: debug

in your configuration.yaml and report your debug info here...

benny0708 commented 4 years ago

There is only this phrase: "Sorry, the requested file does not exist on this server." debug info will follow...

benny0708 commented 4 years ago

Thanks for the test file. Hope this what you was looking for: 2020-03-24 22:45:10 DEBUG (SyncWorker_9) [custom_components.kostal.sensor] [] 2020-03-24 22:45:10 DEBUG (SyncWorker_9) [custom_components.kostal.sensor] [] 2020-03-24 22:45:42 DEBUG (SyncWorker_10) [custom_components.kostal.sensor] [] 2020-03-24 22:45:42 DEBUG (SyncWorker_10) [custom_components.kostal.sensor] [] 2020-03-24 22:46:13 DEBUG (SyncWorker_16) [custom_components.kostal.sensor] [] 2020-03-24 22:46:13 DEBUG (SyncWorker_16) [custom_components.kostal.sensor] [] 2020-03-24 22:46:44 DEBUG (SyncWorker_12) [custom_components.kostal.sensor] [] 2020-03-24 22:46:44 DEBUG (SyncWorker_12) [custom_components.kostal.sensor] [] 2020-03-24 22:47:15 DEBUG (SyncWorker_3) [custom_components.kostal.sensor] [] 2020-03-24 22:47:15 DEBUG (SyncWorker_3) [custom_components.kostal.sensor] [] 2020-03-24 22:47:46 DEBUG (SyncWorker_1) [custom_components.kostal.sensor] [] 2020-03-24 22:47:46 DEBUG (SyncWorker_1) [custom_components.kostal.sensor] [] 2020-03-24 22:48:17 DEBUG (SyncWorker_2) [custom_components.kostal.sensor] [] 2020-03-24 22:48:17 DEBUG (SyncWorker_2) [custom_components.kostal.sensor] [] 2020-03-24 22:48:48 DEBUG (SyncWorker_6) [custom_components.kostal.sensor] [] 2020-03-24 22:48:48 DEBUG (SyncWorker_6) [custom_components.kostal.sensor] [] 2020-03-24 22:49:19 DEBUG (SyncWorker_19) [custom_components.kostal.sensor] [] 2020-03-24 22:49:19 DEBUG (SyncWorker_19) [custom_components.kostal.sensor] [] 2020-03-24 22:49:50 DEBUG (SyncWorker_3) [custom_components.kostal.sensor] [] 2020-03-24 22:49:50 DEBUG (SyncWorker_3) [custom_components.kostal.sensor] [] 2020-03-24 22:50:21 DEBUG (SyncWorker_10) [custom_components.kostal.sensor] [] 2020-03-24 22:50:21 DEBUG (SyncWorker_10) [custom_components.kostal.sensor] [] 2020-03-24 22:50:52 DEBUG (SyncWorker_8) [custom_components.kostal.sensor] [] 2020-03-24 22:50:52 DEBUG (SyncWorker_8) [custom_components.kostal.sensor] [] 2020-03-24 22:51:23 DEBUG (SyncWorker_9) [custom_components.kostal.sensor] [] 2020-03-24 22:51:23 DEBUG (SyncWorker_9) [custom_components.kostal.sensor] [] 2020-03-24 22:51:54 DEBUG (SyncWorker_17) [custom_components.kostal.sensor] [] 2020-03-24 22:51:54 DEBUG (SyncWorker_17) [custom_components.kostal.sensor] []

gieljnssns commented 4 years ago

@benny0708 Can you post a screenshot of your webserver when you are logged in.

benny0708 commented 4 years ago

Sure. Here ist comes... Screenshot_20200325-060320

gieljnssns commented 4 years ago

@benny0708 Please read carefully this error https://github.com/gieljnssns/kostalpiko-sensor-homeassistant/issues/5

benny0708 commented 4 years ago

OK. Thanks for the quick response. If I am understanding you right, the Interface of my kostal piko does not fit the requirements of this component. I will try some Others ways, maybe by Modus. Thanks again and Bye Bye

gieljnssns commented 4 years ago

@Larnak23 Can you also post a screenshot of your webserver when logged in?

Larnak23 commented 4 years ago

kostal

Kosygor commented 4 years ago

Hello all I have similar issue:

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

Gives me : "Sorry, the requested file does not exist on this server."

At firs i had same error as in the logs.

After switching files according to:

You can also try to replace the sensor.py file in the .../config/custom_components/kostal/ map by his file https://gist.github.com/gieljnssns/57ca8351af89ed921fe8f83600164900

i don`t have any errors in log, i can see sensor but sernsor values are "unknown".

This is how my webserver looks like: image

It would be great to have this working since we can`t relay on kostal portal.

gieljnssns commented 4 years ago

@Larnak23 @Kosygor This is how your webserver should look like

Schermafbeelding 2020-03-30 om 11 25 18

My custom_component uses this python package and that package uses the interface from the webserver as a source.

KostalPyko has been tested with a Kostal Piko 5.5. It should work with other Kostal inverters as well since they provide the same interface.

So when your web interface looks different as mine, I can not make this component work for you.

I'm sorry...

Larnak23 commented 4 years ago

Thank you I will use other way probably through api request (dx)

gieljnssns commented 4 years ago

@Larnak23 Can you show me a link or so to the api you are going to use?

Larnak23 commented 4 years ago

I already use it in jeedom

https://community.openhab.org/t/integrating-kostal-inverter-using-httpbinding-and-json/78980