This project is an HTTP(s) interface to the Velbus domotica system.
On debian:
python3
3.7 or higher (default on buster, not supported on stretch)build-essential
, python3-dev
to compile C-extensions for some of the Python dependenciesnodejs
and npm
for the React Web FrontendClone this repository
git clone https://github.com/niobos/velbuspy.git
cd velbuspy
Create a new Python VirtualEnv (optional, but highly recommended) and make sure you have current setuptools and wheels:
$ python3 -m venv venv
$ source venv/bin/activate
(venv) $ pip install setuptools wheel
Install structattr
:
(venv) $ pip install git+https://github.com/niobos/structattr.git
Install velbuspy
:
(venv) $ pip install -e .
(Optional): install and build the React Web Frontend:
(venv) $ git clone https://github.com/niobos/velbusjs.git
(venv) $ cd velbusjs
(venv) $ $EDITOR public/index.html
(venv) $ npm install
(venv) $ npm run build
Run the daemon for /dev/ttyUSB0
(substitute for the port actually in use)
(venv) $ python src/run.py --static-dir velbusjs/build /dev/ttyUSB0
Point your browser to http://localhost:8080/
You can fake a serial port with socat
: socat -d -d PTY -
VelbusMessages could also be dataclasses. They are currently slotted attr-classes for performance reasons: A simple serialize-deserialize roundtrip with timeit gives:
bit manipulation is done via bitstrings. It's significantly faster than bitstruct.