GithubHelp home page GithubHelp logo

weltenwort / py-hpsu-monitor Goto Github PK

View Code? Open in Web Editor NEW
7.0 4.0 1.0 265 KB

A bridge between the Rotex HPSU CAN bus and MQTT-based monitoring systems.

License: MIT License

Python 98.38% Dockerfile 1.62%
mqtt home-assistant homeassistant heating-systems rotex

py-hpsu-monitor's Introduction

py-hpsu-monitor

license standard-readme compliant test-status

A bridge between the Rotex HPSU CAN bus and MQTT-based monitoring systems.

Table of Contents

Background

This is intended to be deployed on a device that has a physical CAN connection to a Rotex HPSU heating system. It polls a configurable set of registers via the Elster-Kromschröder protocol and forwards the received values via MQTT. It has only been tested with the following models:

  • Rotex HPSU compact 508

Please contribute experiences with this or other models in an issue.

Install

The application may be deployed from source or as a container. In both cases, make a copy of the default-config.toml file, change the settings to suit your deployment scenario, and specify the custom configuration file when starting the program.

From source

To deploy from source use poetry to install or build a wheel.

The program itself can started by specifying the run command. The recommended usage is via the systemd unit file described below. Usually only the --config-file option will have to be sepecified for it to use the correct mqtt settings:

Usage: py-hpsu-monitor run [OPTIONS]

Options:
  --can-interface TEXT            CAN bus interface to monitor  [default:
                                  can0]
  --config-file FILE
  --register-definition-file FILE
                                  [default: /home/py-hpsu-
                                  monitor/.local/lib/python3.9/site-packages/p
                                  y_hpsu_monitor/elster_protocol/register_defi
                                  nitions.toml]
  --log-frames
  --log-registers
  --help                          Show this message and exit.

The commandline arguments and configuration file allows for parameterization of various aspects:

  • the CAN connection
  • the MQTT connection
  • the Elster protocol registers to poll

As a container

The included Dockerfile contains build instructions for an image based on Alpine Linux. The recommended way to build and deploy it is podman:

$ podman build --rm -t py-hpsu-monitor:latest .

With systemd and CAN interface can0

If your OS uses [systemd] as the supervisor you can use the included systemd unit to let it supervise the container for you:

  • Copy etc/py-hpsu-monitor.service to ~/.config/systemd/user/py-hpsu-monitor.service and potentially adjust the path to the configuration file.

  • Copy etc/[email protected] to /etc/systemd/system/[email protected].

  • Enable both units:

    sudo systemctl enable --now [email protected]
    systemctl --user enable --now py-hpsu-monitor.service
    

Without systemd

To manually start the container without any supervision, make sure the socketcan interface is up and run sometime like:

$ podman run \
  --detach \
  --cgroups=no-conmon \
  --network=host \
  --volume $(pwd)/my-config.toml:/home/py-hpsu-monitor/config.toml:ro \
  localhost/py-hpsu-monitor:latest --config-file config.toml

Contributing

I welcome requests, bug reports and PRs.

Small note: If editing the Readme, please conform to the standard-readme specification.

License

MIT

py-hpsu-monitor's People

Contributors

dependabot[bot] avatar weltenwort avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

pdcemulator

py-hpsu-monitor's Issues

Installation help

Hello,
I tried to setup py-hpsu-monitor, but I can't get it running. Its installed on a RaspberryPi 2 running latest Bullseye. The dependencies are also installed.

root@raspberrypi:~/py-hpsu-monitor# poetry debug

Poetry
Version: 1.1.12
Python:  3.9.2

Virtualenv
Python:         3.9.2
Implementation: CPython
Path:           /root/.cache/pypoetry/virtualenvs/py-hpsu-monitor-oKw-sLrK-py3.9
Valid:          True

System
Platform: linux
OS:       posix
Python:   /usr

[removed]

Edit: got it running using the command poetry run py-hpsu-monitor run.

Which one is the name for the config file?
default-config.toml and config.toml dir not work, it tried to connect to broker on localhost even when I configured other server names. So I edited MQTT details in py_hpsu_monitor/config.py and finally got it running.
I will do some tests and then submit a PR with more installation details.

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.