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
  • Senertec Dachs Gen2 F5.5
  • 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.2.1.tar.gz (8.6 kB view hashes)

Uploaded Source

Built Distribution

py_senertec-0.2.1-py3-none-any.whl (10.1 kB view hashes)

Uploaded Python 3

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