Teleinfo-js
Node module to read teleinformation frames from ErDF / Enedis main circuit breaker (in France).
Wrapped on serialport
module to read from a serial / USB port. Tested on RaspberryPi.
Based on Laurent HUET work.
Prerequisites
- A RaspberryPi or equivalent computer to plug adapter and run the module.
- An adapter (see tested hardware below) to plug between main circuit breaker TIC interface and your computer.
- This adapter should be able to connect to
serialport
module: sending serial data or emulate it from USB port. - A classical white ErDF circuit breaker, or a Linky.
- For Linky,
TIC
must be set toHistorique
mode.
Tested hardware
- RaspberryPi 2 with Raspbian.
- GCE Electronics USB.
- Tested on Linky (TIC History mode), use I1 and I2 outputs (no polarity).
Start with a simple example to try it.
mkdir teleinfo-test && cd teleinfo-testnpm install teleinfo-js ls /dev/tty*# this will scan serial ports. Plug/unplug your adapter to look after a change. # Then for example 'ttyUSB0', type: cd node_modules/teleinfo-js && npm run start -- /dev/ttyUSB0
You should receive more than 1 frame per minute. If so, you can start to write your own implementation.
First step to begin
const teleinfo = // use your own port here:const emitter = emitter emitter
For better events and parsed data
emitteremitteremitteremitter emitter
For less events
You can add inhibitors to your teleinfo instance. These will avoid too many change/diff events to be triggered.
For example, to trigger events when PAPP
value delta is above 30W, or HCHP
/HCHC
index delta are above 5Wh:
const emitter =
By default, inhibitors = { 'PAPP': 20 }
.
Adaptations and improvements (c) 2020 GXApplications. Based on Laurent HUET work. | License