Collect data from the CAN bus using the Elster protocol
- Python 3.9
- MySQL (optional)
- Grafana (optional)
- Raspberry Pi + CANable (or similar devices)
- Download the latest version
wget https://github.com/fknipp/canpicker/archive/refs/heads/main.zip
- Unzip the package
unzip canpicker-main.zip
- Change the directory
cd canpicker-main
- Install the dependencies
pipenv install
To collect the data every x minutes, it's necessary to create a cron job. This is an example to query the data every two minutes:
*/2 * * * * /home/pi/canpicker-main/bin/canpicker
Execute the seed file via MySQL command line or copy the query into your MySQL shell.
With Grafana you can create your own dashboard with widgets or use the existing template.
The configuration for the CAN bus and for the data to be queried is located in config.yml. The database configuration is located in .env.
File: config.yml
can:
interface: can0
sender: 680
interface
: CAN bus interfacecan0
sender
: Sender ID680
File: config.yml
See http://juerg5524.ch/data/ElsterTable.inc for the indexes.
data:
- name: AUSSENTEMPERATUR
index: 180.000c
format: dec_val
- name: QUELLENTEMPERATUR
index: 180.01d4
format: dec_val
- name: FEHLER
index: 180.0001
name
: Name for the data pointAUSSENTEMPERATUR
index
: Receiver and Register separated by a dot180.000c
format
(optional):dec_val
mil_val
little_endian
File: .env
Rename the .env.example
file to .env
and adapt it for your needs.
Otherwise create it with the content for your usecase.
Tha values are stored in the table sepicker. See the seed file for the data definition.
DB_DATABASE=heat-pump
DB_HOST=127.0.0.1
DB_USER=root
DB_PASSWORD=
The data is sent as GET request to a configurable URL.
The URL template allows the substitutions:
- $timestamp for the timestamp in the ISO format
- $name for the name as configured in config.yml
- $value for the value retrieved on the CAN bus
HTTP_URL_TEMPLATE=http://loxone.local/dev/sps/io/$name/$value
HTTP_USERNAME=
HTTP_PASSWORD=
This is helpful for debugging.
CONSOLE_OUT=1
- http://juerg5524.ch/list_data.php
- https://github.com/andig/goelster
- https://github.com/Andy2003/heat-pump-api
- https://github.com/danielbayerlein/sepicker
- Integration with Loxone: https://github.com/fknipp/python-can-loxone-heating-integration
© 2020-present Daniel Bayerlein
© 2023-present Franz Knipp
See LICENSE for details.