Git Product home page Git Product logo

python-teleinfo's Introduction

python-teleinfo

Read and parse teleinfo data from France EDF electricity provider

  • Build: CircleCI
  • Unit tests: codecov
  • package: PyPI version

Lors de l'installation, un outil CLI est installé : bin/teleinfo_json

Usage

Usage du module :

  from teleinfo import Parser
  from teleinfo.hw_vendors import RpiDom
  ti = Parser(RpiDom())
  print ti.get_frame()

Le parseur supporte aussi l'itération :

  from teleinfo import Parser
  from teleinfo.hw_vendors import RpiDom
  for frame in Parser(RpiDom()):
      do_something_with(frame)

Supported Devices

Example

>>> import teleinfo
>>> from teleinfo import Parser
>>> from teleinfo.hw_vendors import UTInfo2
>>> ti = Parser(UTInfo2())
>>> ti.get_frame()

{'PPOT': '00', 'MOTDETAT': '000000', 'OPTARIF': 'HC..', 'IMAX3': '060', 'IMAX1': '060', 'ADCO': '021876647540', 'HCHC': '002234766', 'PAPP': '08490', 'HHPHC': 'A', 'IINST1': '010', 'IMAX2': '060', 'IINST3': '016', 'IINST2': '008', 'PTEC': 'HP..', 'ISOUSC': '20', 'PMAX': '11690', 'HCHP': '011085557'}

>>> for frame in Parser(UTInfo2()):
...     print frame
...

Appel avec changement de port (ici /dev/ttyUSB0) pour un module Micro Teleinfo

#!/usr/bin/env python
from teleinfo import Parser
from teleinfo.hw_vendors import UTInfo2
ti = Parser(UTInfo2(port="/dev/ttyUSB0"))
print ti.get_frame()

Script avec changement de vitesse (ici 9600) pour un module PITInfo en mode standard sur un Linky

#!/usr/bin/env python
from teleinfo import Parser
from teleinfo.hw_vendors import PITInfo
ti = Parser(PITInfo(baudrate=9600))
print ti.get_frame()

python-teleinfo's People

Contributors

demikl avatar hallard avatar marcogabriel avatar thestaticturtle avatar

Watchers

 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.