Skip to main content

Senertec energy system gen2 interface.

Project description

py-senertec

License: MIT PyPI version

Description

The py-senertec library provides a way to communicate with senertec dachsportal2 to monitor your energy unit.

Requirements

  • Python 3.6+
  • productGroups.json from repo
  • Account for Senertec Dachsportal2/Remeha KWK

Supported devices

For now, these devices are supported:

  • Senertec Dachs 0.8
  • Remeha eLecta 300 (technically same as Senertec Dachs)

Support for other devices

This library uses Dachsportal2 to get information from your energy system. If you have a device which can be accessed from Dachsportal2 adding support should be pretty easy. You can open an feature request in the issues section and provide more information there.

Installation

$ pip install py-senertec

Usage

Login and initialization

from senertec.client import senertec
from senertec.canipValue import canipValue
import json
import os

# holds the datapoints which are fixed values parsed from Dachsportal
file = open(os.getcwd() + "\\productGroups.json")
supportedItems = json.load(file)
file.close()
senertec = senertec(supportedItems, "username", "password")
#set your callback function for messages
senertec.messagecallback = self.output
senertec.login()
senertec.init()

Requesting data

units = senertec.getUnits()
senertec.connectUnit(units[0].serial)
# request all available data from all boards
for points in senertec.boards:
            ids = points.getFullDataPointIds()
            # result will be received through callback function which was set above
            senertec.request(ids)
senertec.logout()

Using callback function

Once the websocket has been started, data will be transmitted through the websocket. In order for your to be alerted of such a change, you need to add a callback which was done above. The callback function could look like this:

def output(self, value: canipValue):
        print(value.friendlyDataName + ": " +
              value.dataValue.__str__() + value.dataUnit)

Errors of energy unit

Errors can also be read out with a simple function. The errors are read out on the connect function and only will be refreshed on a reconnect.

# values are returned directly from function
k = senertec.getErrors()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py-senertec-0.1.1.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

py_senertec-0.1.1-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file py-senertec-0.1.1.tar.gz.

File metadata

  • Download URL: py-senertec-0.1.1.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.8

File hashes

Hashes for py-senertec-0.1.1.tar.gz
Algorithm Hash digest
SHA256 20941b23402df922b958bfe7fd719aa5096c7dd401edb2142a39dd2c79250e1e
MD5 68c4862adbf4c633fb51a41ca9c06578
BLAKE2b-256 3507e2382a5816ba05acc9a46fda229579da19e14a6a9c01e7f6b8af6e029ed2

See more details on using hashes here.

File details

Details for the file py_senertec-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: py_senertec-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.8

File hashes

Hashes for py_senertec-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 eb0bf2c1ff9f176bdf66820f9e86d4e9a797451cb4250bb519979272f8f3f2eb
MD5 79e473f92acf74443f01c4ae05a9c4ea
BLAKE2b-256 4f8f4afe4a3ad383d7c0c48b52f5248ecf57ed5d0f1faa018661dd5444b9abac

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page