Code Monkey home page Code Monkey logo

py-senertec's Introduction

py-senertec

License: MIT PyPI version

Description

The py-senertec library provides a way to communicate with Senertec Dachsportal2 to monitor your energy unit. This library supports read-only communication. So changing values for your energy unit isn't implemented and not planned yet.

Requirements

  • Python 3.10+
  • Account for Senertec Dachsportal2/Remeha KWK

Tested with this devices

I could test with this devices but others should also work:

  • Senertec Dachs 0.8
  • Senertec Dachs InnoGen
  • Senertec Dachs Gen2 F5.5
  • Remeha eLecta 300 (technically same as Senertec Dachs 0.8)

Installation

$ pip install py-senertec

Usage

Login and initialization

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

#this example uses no filtering, read below how to use a filter instead of None as first parameter.
senertec = senertec(None)
#set your callback function for messages
senertec.messagecallback = self.output
senertec.login("username", "password")
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. To get the websocket data, 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 will only be refreshed on a reconnect.

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

A full example can be found here

Filtering (recommended)

If you specify a json string in the senertec contructor you can limit what datapoints should be received. This is pretty usefull if you know what data you want from your heating system e.g. power, temperature. By default all datapoints are included which are more than 400 in most cases and receiving them takes some time. This json string should look like this. The json string contains the productGroup at the top and below the datapoints which should be included. You get the productGroup from the getUnits() function.

What are these datapoints?

Take a look at this manual from Remeha (Page 39). There is already a good explanation of how these datapoints are composed.

py-senertec's People

Contributors

kleinrotti avatar

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.