teleinfo-exporter (1.0.0)

Published 2023-12-17 20:07:18 +01:00 by d3vyce

Installation

pip install --index-url  teleinfo-exporter

About this package

Simple prometheus exporter for Linky teleinfo.

Teleinfo Exporter

Simple prometheus exporter for Linky teleinfo. Teleinfo Tasmota project : https://github.com/NicolasBernaerts/tasmota/tree/master/teleinfo

Installation

Pip

python3 -m pip install teleinfo-exporter
teleinfo-exporter --help

Docker

docker pull teleinfo-exporter

Minimal Docker compose:

services:
  web:
    image: teleinfo_exporter:latest
    environment:
      - BROKER_HOSTNAME=10.10.0.10
    ports: 
      - 8000:8000
    restart: always

Architectures

Architecture Available Tag
x86-64 amd64-<version tag>
arm64 arm64-<version tag>

Version Tags

Tag Available Description
latest Latest version

Variables

Argument Variable Description Default
--http_port -e HTTP_PORT HTTP Port 8000
--auth_user -e AUTH_USER Basic Auth User
--auth_hash -e AUTH_HASH Basic Auth Hash
--http_cert -e HTTP_CERT HTTP Certificate
--http_key -e HTTP_KEY HTTP Key
--broker_host -e BROKER_HOST MQTT Host
--broker_port -e BROKER_PORT MQTT Port 1883
--broker_user -e BROKER_USER MQTT User
--broker_password -e BROKER_PASSWORD MQTT Password
--broker_topic -e BROKER_TOPIC Teleinfo Topic teleinfo/tele/SENSOR

Configuration

HTTP Authentication

To generate the password hash use the following command:

htpasswd -bnBC 10 "" PASSWORD | tr -d ':'

Prometheus

Config example:

scrape_configs:
  - job_name: 'Teleinfo'
    scheme: https
    tls_config:
      ca_file: teleinfo.crt
    basic_auth:
      username: USER
      password: PASSWORD
    static_configs:
      - targets:
        - 192.168.1.2:8000

Dev

Environement

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python3 src/teleinfo_exporter

Build image

docker build -t teleinfo_exporter .

Start

docker compose up -d
  - BROKER_PORT=1883
  - BROKER_USER=user
  - BROKER_PASSWORD=12345
  - BROKER_TOPIC=teleinfo/tele/SENSOR

Requirements

Requires Python: >=3.8
Details
PyPI
2023-12-17 20:07:18 +01:00
20
MIT License Copyright (c) 2023 d3vyce Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
13 KiB
Assets (2)
Versions (1) View all
1.0.0 2023-12-17