Git Product home page Git Product logo

kaco's Introduction

Kaco

Adds a sensor to Home Assistant that displays several information of a Kaco / Schueco SGI-9k or similar

This component will set up the following platforms.

Platform Description
sensor Show date and remaining days to event

Example

Features

  • Shows all values from the webinterface
  • Status is parsed and shown as text
  • Tracks maximal seen power
  • Configurable update interval

Installation

HACS

The easiest way to add this to your Homeassistant installation is using [HACS].

It's recommended to restart Homeassistent directly after the installation without any change to the Configuration. Homeassistent will install the dependencies during the next reboot. After that you can add and check the configuration without error messages. This is nothing special to this Integration but the same for all custom components.

Manual

  1. Using the tool of choice open the directory (folder) for your HA configuration (where you find configuration.yaml).
  2. If you do not have a custom_components directory (folder) there, you need to create it.
  3. In the custom_components directory (folder) create a new folder called kaco.
  4. Download all the files from the custom_components/kaco/ directory (folder) in this repository.
  5. Place the files you downloaded in the new directory (folder) you created.
  6. Follow the instructions under Configuration below.

Using your HA configuration directory (folder) as a starting point you should now also have this:

custom_components/kaco/translations/en.json
custom_components/kaco/__init__.py
custom_components/kaco/manifest.json
custom_components/kaco/sensor.py
custom_components/kaco/config_flow.py
custom_components/kaco/const.py

Setup

All you need to have the ip adress of the inverter. This is show on the actual device display.

Configuration options

Key Type Required Default Description
url string true None The IP of the inverter, e.g. 192.168.2.194
name string false kaco The friendly name of the sensor
kwh_interval int false 120 The interval of the kwh update
interval int false 20 The interval of all other updates (my inverter crashes if I set it below 5 for more than a day)
generator_voltage bool false false Import generator voltage as entity
generator_current bool false false Import generator current as entity
grid_voltage bool false false Import grid voltage as entity
grid_current bool false false Import grid current as entity

GUI configuration (recommended)

Config flow is supported and is the prefered way to setup the integration. (No need to restart Home-Assistant)

Manual configuration

To enable the sensor, add the following lines to your configuration.yaml file and replace the link accordingly:

# Example entry for configuration.yaml
sensor:
  - platform: kaco
    name: Solar Power
    url: 192.168.2.194

However grouping via devices are not supported if you using configuration via yaml

kaco's People

Contributors

kcinnayste avatar koljawindeler avatar rfpronk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

kaco's Issues

KACO Integration Error

Version of the custom_component

Configuration

generals

DOMAIN = "kaco"
PLATFORM = "sensor"
VERSION = "0.1.0"
ISSUE_URL = "https://github.com/KoljaWindeler/kaco/issues"
SCAN_INTERVAL = datetime.timedelta(seconds=5)

Add your logs here.

Describe the bug

A clear and concise description of what the bug is.

Debug log

Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 174, in _new_conn conn = connection.create_connection( File "/usr/local/lib/python3.10/site-packages/urllib3/util/connection.py", line 95, in create_connection raise err File "/usr/local/lib/python3.10/site-packages/urllib3/util/connection.py", line 85, in create_connection sock.connect(sa) OSError: [Errno 113] Host is unreachable During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 703, in urlopen httplib_response = self._make_request( File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 398, in _make_request conn.request(method, url, **httplib_request_kw) File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 239, in request super(HTTPConnection, self).request(method, url, body=body, headers=headers) File "/usr/local/lib/python3.10/http/client.py", line 1282, in request self._send_request(method, url, body, headers, encode_chunked) File "/usr/local/lib/python3.10/http/client.py", line 1328, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/usr/local/lib/python3.10/http/client.py", line 1277, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/usr/local/lib/python3.10/http/client.py", line 1037, in _send_output self.send(msg) File "/usr/local/lib/python3.10/http/client.py", line 975, in send self.connect() File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 205, in connect conn = self._new_conn() File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 186, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0xffff7aadb8e0>: Failed to establish a new connection: [Errno 113] Host is unreachable During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 489, in send resp = conn.urlopen( File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 787, in urlopen retries = retries.increment( File "/usr/local/lib/python3.10/site-packages/urllib3/util/retry.py", line 592, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='192.168.18.10', port=80): Max retries exceeded with url: /realtime.csv (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0xffff7aadb8e0>: Failed to establish a new connection: [Errno 113] Host is unreachable')) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/config/custom_components/kaco/__init__.py", line 111, in async_get_datas d = await hass.async_add_executor_job( File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/usr/local/lib/python3.10/site-packages/requests/api.py", line 73, in get return request("get", url, params=params, **kwargs) File "/usr/local/lib/python3.10/site-packages/requests/api.py", line 59, in request return session.request(method=method, url=url, **kwargs) File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 587, in request resp = self.send(prep, **send_kwargs) File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 701, in send r = adapter.send(request, **kwargs) File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 565, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPConnectionPool(host='192.168.18.10', port=80): Max retries exceeded with url: /realtime.csv (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0xffff7aadb8e0>: Failed to establish a new connection: [Errno 113] Host is unreachable'))
thanks, Kolja
============= KACO Integration Error ================

Index Out of Range

Logger: custom_components.kaco.sensor
Source: custom_components/kaco/sensor.py:118
Integration: kaco (documentation, issues)
First occurred: 12:00:20 AM (1398 occurrences)
Last logged: 8:28:04 AM

Traceback (most recent call last): File "/config/custom_components/kaco/sensor.py", line 164, in get_data kwh = float(ds.split(';')[4]) IndexError: list index out of range

Timeouts

Version of the custom_component

0.5.1

Configuration

  • All polling options activated
  • Poll times default 20 / 120

Describe the bug

Basically the component works fine but I have a lot of the above entries in my log.
Whenever I try to access the WebIF it works. I know the WebIF is slow as hell and refreshing it like 3 times shortly in a row will make it crash.

Is there a way to increase the timeout?

Debug log


2022-08-23 20:40:12.270 ERROR (MainThread) [custom_components.kaco] Timeout fetching kaco_192.168.178.14 data
2022-08-23 20:40:42.256 WARNING (MainThread) [custom_components.kaco] KACO Panel with IP 192.168.178.14 doesn't answer

Error adding entities for domain sensor with platform kaco

Version of the custom_component

I am using the latest version pulled by Home Asisstant from git i.e. version
d498e4d

Configuration

sensor:
  - platform: kaco
    name: Solar Power 1
    url: 192.168.0.50

sensor:
  - platform: kaco
    name: Solar Power 2
    url: 192.168.0.51

Describe the bug

When I try to add one of my Kaco inverters I am getting success, but no sensors appear and lot's of errors are logged.
This error happens only with one and the same inverter 'Solar South' Solar Power 1.
Both inverters are blueplanet 5.0 TL3 SW version 5.53

Debug log


2022-02-15 15:20:41 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.kaco
2022-02-15 15:20:41 DEBUG (MainThread) [custom_components.kaco.sensor] Config via Storage/UI
2022-02-15 15:20:41 DEBUG (MainThread) [custom_components.kaco] initialize the date coordinator for IP 192.168.0.50
2022-02-15 15:20:41 DEBUG (MainThread) [custom_components.kaco.sensor] KACO config: 
2022-02-15 15:20:41 DEBUG (MainThread) [custom_components.kaco.sensor] 	name: Inverter South
2022-02-15 15:20:41 DEBUG (MainThread) [custom_components.kaco.sensor] 	url: 192.168.0.50
2022-02-15 15:20:41 DEBUG (MainThread) [custom_components.kaco.sensor] 	icon: mdi:solar-power
2022-02-15 15:20:41 DEBUG (MainThread) [custom_components.kaco.sensor] KACO config: 
2022-02-15 15:20:41 DEBUG (MainThread) [custom_components.kaco.sensor] 	name: Inverter South
2022-02-15 15:20:41 DEBUG (MainThread) [custom_components.kaco.sensor] 	url: 192.168.0.50
2022-02-15 15:20:41 DEBUG (MainThread) [custom_components.kaco.sensor] 	icon: mdi:solar-power
2022-02-15 15:20:41 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform kaco
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 442, in _async_add_entity
    if entity.unique_id is not None:
  File "/config/custom_components/kaco/sensor.py", line 91, in unique_id
    return self.coordinator.data["extra"]["serialno"] + self._valueKey
TypeError: 'NoneType' object is not subscriptable
2022-02-15 15:20:41 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up kaco platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 257, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 442, in _async_add_entity
    if entity.unique_id is not None:
  File "/config/custom_components/kaco/sensor.py", line 91, in unique_id
    return self.coordinator.data["extra"]["serialno"] + self._valueKey
TypeError: 'NoneType' object is not subscriptable


Manifest file update

2021-03-15 19:58:57 WARNING (MainThread) [homeassistant.loader] No 'version' key in the manifest file for custom integration 'kaco'. This will not be allowed in a future version of Home Assistant. Please report this to the maintainer of 'kaco'

Current Power no longer available with HA 2023.02

Version of the custom_component

0.1.0

Configuration

Configuration was done through the UI so I do not have any YAML file here. Kept all default values and checked all boxes that can be enabled in the UI.

Describe the bug

After upgrading my HA to version 2023.02 I do no longer see the current power being created. The sensor has become unavailable and I have no more option to view how much power is currently created.

Debug log


Logger: homeassistant.components.sensor
Source: util/unit_conversion.py:91
Integration: Sensor (documentation, issues)
First occurred: 09:17:53 (3 occurrences)
Last logged: 09:17:53

Error adding entities for domain sensor with platform kaco
Error while setting up kaco platform for sensor
kaco: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 442, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 717, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 814, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 566, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 607, in _async_write_ha_state
    state = self._stringify_state(available)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 572, in _stringify_state
    if (state := self.state) is None:
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 641, in state
    converter.get_unit_ratio(
  File "/usr/src/homeassistant/homeassistant/util/unit_conversion.py", line 91, in get_unit_ratio
    return cls._UNIT_CONVERSION[from_unit] / cls._UNIT_CONVERSION[to_unit]
KeyError: None


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.