gieljnssns / kostalpiko-sensor-homeassistant

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

Cannot get component running #5

Closed frittes closed 4 years ago

frittes commented 4 years ago

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"

gieljnssns commented 4 years ago

Please format your code

tripple backticks (`) - new line
code  - new line
tripple backticks (`)

Are you using the correct host?

frittes commented 4 years ago

Yes, the host is correct.

Bildschirmfoto 2019-12-15 um 11 35 10
gieljnssns commented 4 years ago

Which inverter are you using?

frittes commented 4 years ago

Kostal Piko IQ 7.0

gieljnssns commented 4 years ago

You can post a screenshot of when you are logged in

gieljnssns commented 4 years ago

this is mine

Schermafbeelding 2019-12-15 om 11 59 22
frittes commented 4 years ago

Mine is different:

Bildschirmfoto 2019-12-15 um 12 02 27
frittes commented 4 years ago

The infos:

Bildschirmfoto 2019-12-15 um 12 03 54
gieljnssns commented 4 years ago

Mine is different:

Thats the problem... This package uses the interface from the webserver as 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.

gieljnssns commented 4 years ago

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

Larnak23 commented 4 years ago

Hello the laist errors 👍 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 177, in _get_raw_content r = requests.get(url, auth=(login, pwd), timeout=15) File "/usr/local/lib/python3.7/site-packages/requests/api.py", line 76, in get return request('get', url, params=params, kwargs) File "/usr/local/lib/python3.7/site-packages/requests/api.py", line 61, in request return session.request(method=method, url=url, **kwargs) File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 516, in request prep = self.prepare_request(req) File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 459, in prepare_request hooks=merge_hooks(request.hooks, self.hooks), File "/usr/local/lib/python3.7/site-packages/requests/models.py", line 314, in prepare self.prepare_url(url, params) File "/usr/local/lib/python3.7/site-packages/requests/models.py", line 388, in prepare_url raise MissingSchema(error) requests.exceptions.MissingSchema: Invalid URL '192.168.1.178/index.fhtml': No schema supplied. Perhaps you meant http://192.168.1.178/index.fhtml?