diff --git a/teleinfo.py b/teleinfo.py index 8003ce8..39bd56a 100644 --- a/teleinfo.py +++ b/teleinfo.py @@ -32,7 +32,59 @@ # clés téléinfo -INT_MESURE_KEYS = ['BASE', 'IMAX', 'HCHC', 'IINST', 'PAPP', 'ISOUSC', 'ADCO', 'HCHP'] +# http://www.erdf.fr/sites/default/files/ERDF-NOI-CPT_02E.pdf +# Tableau 4 et 5 à page 32 et 33 +VALID_KEYS = [ + 'ADC0', + 'ADPS', + 'BASE', + 'BBRHCJB', + 'BBRHCJR', + 'BBRHCJW', + 'BBRHPJB', + 'BBRHPJR', + 'BBRHPJW', + 'DEMANI', + 'EJPHN', + 'EJPHPM', + 'HCHC', + 'HCHP', + 'HHPHC', + 'IINST', + 'IINST1', + 'IINST2', + 'IINST3', + 'IMAX', + 'IMAX1', + 'IMAX2', + 'IMAX3', + 'ISOUSC', + 'MOTDETAT', + 'OPTARIF', + 'PAPP', + 'PEJP', + 'PMAX', + 'PPOT', + 'PTEC', +] + +INT_MESURE_KEYS = [ + 'ADCO', + 'BASE', + 'HCHC', + 'HCHP', + 'IINST', + 'IINST1', + 'IINST2', + 'IINST3', + 'IMAX', + 'IMAX1', + 'IMAX2', + 'IMAX3', + 'ISOUSC', + 'PAPP', + 'PMAX', +] # création du logguer logging.basicConfig(filename='/var/log/teleinfo/releve.log', level=logging.INFO, format='%(asctime)s %(message)s') @@ -61,6 +113,8 @@ def add_measures(measures, time_measure): points = [] for measure, value in measures.items(): + if not measure in VALID_KEYS: + continue point = { "measurement": measure, "tags": {