Requirements:
- A RaspberryPI
- A teleinformation kit (e.g. http://www.domot-mx.com/domotmx/shop/materiel/4-kit-teleinfo.html)
- RRDTool
- Perl
- FastCGI (optional)
For graphs:
- A web server (typically lighttpd)
- The Highcharts library (www.highcharts.com)
- The JQuery and JQuery-UI libraries (www.jquery.com)
Installation on a system using Systemd (typically Archlinux):
- Create a user 'teleinfo' with home directory /var/lib/teleinfo:
(root) useradd -b /var/lib -G uucp -m teleinfo
- Install rc-local.service and add the following line to /etc/rc.local:
(root) stty -F /dev/ttyAMA0 1200 sane evenp parenb cs7 -crtscts
- Start rc-local.service:
(root) systemctl enable rc-local.service
- Create the RRD database that will hold the data:
(teleinfo) rrdtool create edf.rrd --step 60 \
DS:hchc:COUNTER:600:U:U DS:hchp:COUNTER:600:U:U \
RRA:AVERAGE:0.25:1:43200 RRA:AVERAGE:0.25:60:88800 RRA:AVERAGE:0.25:1440:3700
If "Option Tempo": (jw == Jour Blanc, jr == Jour Route, jb = Jour Bleu)
(teleinfo) rrdtool create edftempo.rrd --step 60 \
DS:hcjb:COUNTER:600:U:U DS:hcjw:COUNTER:600:U:U DS:hcjr:COUNTER:600:U:U \
DS:hpjb:COUNTER:600:U:U DS:hpjw:COUNTER:600:U:U DS:hpjr:COUNTER:600:U:U \
RRA:AVERAGE:0.25:1:43200 RRA:AVERAGE:0.25:60:88800 RRA:AVERAGE:0.25:1440:3700
This will allow storing data:
- for 30 days with a precision of 1 minute
- for 10 years with a precision of 1 hour
- for 10 years with a precision of 1 day
- Install lighttpd and configure it:
- Look at lighttpd/lighttpd.conf for an example (uses FastCGI)
- Untar the web_libraries.tar.gz file to the root of the web server
- Copy the web/ directory content to the web server
- If using FastCGI, copy bin/fastcgi.pl to the web server (outside its root!)
- Create a crontab entry for user teleinfo and copy the content of the crontab file
See also: https://www.magdiblog.fr/gpio/teleinfo-edf-suivi-conso-de-votre-compteur-electrique/