├── .pylintrc ├── README.md ├── setup.cfg ├── .gitignore ├── teleinfo.py ├── LICENSE └── grafana_dashboard_teleinfo.json /.pylintrc: -------------------------------------------------------------------------------- 1 | [FORMAT] 2 | # Maximum number of characters on a single line. 3 | max-line-length=119 -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Téléinfo Linky avec un Raspberry Pi 2 | Surveiller sa consommation électrique en temps réel avec un compteur Linky et un Raspberry 3 | 4 | ![Monitorer son compteur Linky avec Grafana](https://sebastienreuiller.fr/blog/wp-content/uploads/2019/10/capture_teleinfo_avec_tarif.png) 5 | 6 | 7 | 8 | ## Documentation 9 | 10 | Tuto pas à pas sur mon blog : [Monitorer son compteur Linky avec Grafana, c’est possible.. et ça tourne sur un Raspberry Pi!](https://sebastienreuiller.fr/blog/monitorer-son-compteur-linky-avec-grafana-cest-possible-et-ca-tourne-sur-un-raspberry-pi/) 11 | 12 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | # - https://timothycrosley.github.io/isort/ 2 | # - https://github.com/timothycrosley/isort#configuring-isort 3 | # - https://github.com/timothycrosley/isort/wiki/isort-Settings 4 | 5 | [isort] 6 | combine_as_imports = True 7 | ensure_newline_before_comments = True 8 | force_grid_wrap = 0 9 | include_trailing_comma = True 10 | known_first_party = itou 11 | lines_after_imports = 2 12 | line_length = 119 13 | multi_line_output = 3 14 | use_parentheses = True 15 | 16 | # - https://www.flake8rules.com 17 | # - http://flake8.pycqa.org/en/3.1.1/user/ignoring-errors.html#changing-the-ignore-list 18 | 19 | [flake8] 20 | # E203: Whitespace before ':', used to please Black in `yield items[i : i + n]` 21 | # E266: Too many leading '#' for block comment 22 | # W503: Line break occurred before a binary operator 23 | ignore = E203, E266, W503 24 | max-line-length = 119 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | MANIFEST 27 | 28 | # PyInstaller 29 | # Usually these files are written by a python script from a template 30 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 31 | *.manifest 32 | *.spec 33 | 34 | # Installer logs 35 | pip-log.txt 36 | pip-delete-this-directory.txt 37 | 38 | # Unit test / coverage reports 39 | htmlcov/ 40 | .tox/ 41 | .coverage 42 | .coverage.* 43 | .cache 44 | nosetests.xml 45 | coverage.xml 46 | *.cover 47 | .hypothesis/ 48 | .pytest_cache/ 49 | 50 | # Translations 51 | *.mo 52 | *.pot 53 | 54 | # Django stuff: 55 | *.log 56 | local_settings.py 57 | db.sqlite3 58 | 59 | # Flask stuff: 60 | instance/ 61 | .webassets-cache 62 | 63 | # Scrapy stuff: 64 | .scrapy 65 | 66 | # Sphinx documentation 67 | docs/_build/ 68 | 69 | # PyBuilder 70 | target/ 71 | 72 | # Jupyter Notebook 73 | .ipynb_checkpoints 74 | 75 | # pyenv 76 | .python-version 77 | 78 | # celery beat schedule file 79 | celerybeat-schedule 80 | 81 | # SageMath parsed files 82 | *.sage.py 83 | 84 | # Environments 85 | .env 86 | .venv 87 | env/ 88 | venv/ 89 | ENV/ 90 | env.bak/ 91 | venv.bak/ 92 | 93 | # Spyder project settings 94 | .spyderproject 95 | .spyproject 96 | 97 | # Rope project settings 98 | .ropeproject 99 | 100 | # mkdocs documentation 101 | /site 102 | 103 | # mypy 104 | .mypy_cache/ 105 | -------------------------------------------------------------------------------- /teleinfo.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # __author__ = "Sébastien Reuiller" 4 | # __licence__ = "Apache License 2.0" 5 | 6 | # Python 3, prérequis : pip install pySerial influxdb 7 | # 8 | # Exemple de trame: 9 | # { 10 | # 'BASE': '123456789' # Index heure de base en Wh 11 | # 'OPTARIF': 'HC..', # Option tarifaire HC/BASE 12 | # 'IMAX': '007', # Intensité max 13 | # 'HCHC': '040177099', # Index heure creuse en Wh 14 | # 'IINST': '005', # Intensité instantanée en A 15 | # 'PAPP': '01289', # Puissance Apparente, en VA 16 | # 'MOTDETAT': '000000', # Mot d'état du compteur 17 | # 'HHPHC': 'A', # Horaire Heures Pleines Heures Creuses 18 | # 'ISOUSC': '45', # Intensité souscrite en A 19 | # 'ADCO': '000000000000', # Adresse du compteur 20 | # 'HCHP': '035972694', # index heure pleine en Wh 21 | # 'PTEC': 'HP..' # Période tarifaire en cours 22 | # } 23 | 24 | 25 | import logging 26 | import time 27 | from datetime import datetime 28 | 29 | import requests 30 | import serial 31 | from influxdb import InfluxDBClient 32 | 33 | 34 | # clés téléinfo 35 | INT_MESURE_KEYS = ['BASE', 'IMAX', 'HCHC', 'IINST', 'PAPP', 'ISOUSC', 'ADCO', 'HCHP'] 36 | 37 | # création du logguer 38 | logging.basicConfig(filename='/var/log/teleinfo/releve.log', level=logging.INFO, format='%(asctime)s %(message)s') 39 | logging.info("Teleinfo starting..") 40 | 41 | # connexion a la base de données InfluxDB 42 | client = InfluxDBClient('localhost', 8086) 43 | DB_NAME = "teleinfo" 44 | connected = False 45 | while not connected: 46 | try: 47 | logging.info("Database %s exists?" % DB_NAME) 48 | if not {'name': DB_NAME} in client.get_list_database(): 49 | logging.info("Database %s creation.." % DB_NAME) 50 | client.create_database(DB_NAME) 51 | logging.info("Database %s created!" % DB_NAME) 52 | client.switch_database(DB_NAME) 53 | logging.info("Connected to %s!" % DB_NAME) 54 | except requests.exceptions.ConnectionError: 55 | logging.info('InfluxDB is not reachable. Waiting 5 seconds to retry.') 56 | time.sleep(5) 57 | else: 58 | connected = True 59 | 60 | 61 | def add_measures(measures, time_measure): 62 | points = [] 63 | for measure, value in measures.items(): 64 | point = { 65 | "measurement": measure, 66 | "tags": { 67 | # identification de la sonde et du compteur 68 | "host": "raspberry", 69 | "region": "linky" 70 | }, 71 | "time": datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%SZ"), 72 | "fields": { 73 | "value": value 74 | } 75 | } 76 | points.append(point) 77 | 78 | client.write_points(points) 79 | 80 | 81 | def verif_checksum(data, checksum): 82 | data_unicode = 0 83 | for caractere in data: 84 | data_unicode += ord(caractere) 85 | sum_unicode = (data_unicode & 63) + 32 86 | return (checksum == chr(sum_unicode)) 87 | 88 | 89 | def main(): 90 | with serial.Serial(port='/dev/ttyS0', baudrate=1200, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, 91 | bytesize=serial.SEVENBITS, timeout=1) as ser: 92 | 93 | logging.info("Teleinfo is reading on /dev/ttyS0..") 94 | 95 | trame = dict() 96 | 97 | # boucle pour partir sur un début de trame 98 | line = ser.readline() 99 | while b'\x02' not in line: # recherche du caractère de début de trame 100 | line = ser.readline() 101 | 102 | # lecture de la première ligne de la première trame 103 | line = ser.readline() 104 | 105 | while True: 106 | line_str = line.decode("utf-8") 107 | logging.debug(line) 108 | 109 | try: 110 | # separation sur espace /!\ attention le caractere de controle 0x32 est un espace aussi 111 | [key, val, *_] = line_str.split(" ") 112 | 113 | # supprimer les retours charriot et saut de ligne puis selectionne le caractere 114 | # de controle en partant de la fin 115 | checksum = (line_str.replace('\x03\x02', ''))[-3:-2] 116 | 117 | if verif_checksum(f"{key} {val}", checksum): 118 | # creation du champ pour la trame en cours avec cast des valeurs de mesure en "integer" 119 | trame[key] = int(val) if key in INT_MESURE_KEYS else val 120 | 121 | if b'\x03' in line: # si caractère de fin dans la ligne, on insère la trame dans influx 122 | del trame['ADCO'] # adresse du compteur : confidentiel! 123 | time_measure = time.time() 124 | 125 | # insertion dans influxdb 126 | add_measures(trame, time_measure) 127 | 128 | # ajout timestamp pour debugger 129 | trame["timestamp"] = int(time_measure) 130 | logging.debug(trame) 131 | 132 | trame = dict() # on repart sur une nouvelle trame 133 | except Exception as e: 134 | logging.error("Exception : %s" % e, exc_info=True) 135 | logging.error("%s %s" % (key, val)) 136 | line = ser.readline() 137 | 138 | 139 | if __name__ == '__main__': 140 | if connected: 141 | main() 142 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /grafana_dashboard_teleinfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "__inputs": [ 3 | { 4 | "name": "DS_TELEINFO", 5 | "label": "Teleinfo", 6 | "description": "", 7 | "type": "datasource", 8 | "pluginId": "influxdb", 9 | "pluginName": "InfluxDB" 10 | } 11 | ], 12 | "__requires": [ 13 | { 14 | "type": "grafana", 15 | "id": "grafana", 16 | "name": "Grafana", 17 | "version": "5.1.4" 18 | }, 19 | { 20 | "type": "panel", 21 | "id": "graph", 22 | "name": "Graph", 23 | "version": "5.0.0" 24 | }, 25 | { 26 | "type": "datasource", 27 | "id": "influxdb", 28 | "name": "InfluxDB", 29 | "version": "5.0.0" 30 | }, 31 | { 32 | "type": "panel", 33 | "id": "singlestat", 34 | "name": "Singlestat", 35 | "version": "5.0.0" 36 | } 37 | ], 38 | "annotations": { 39 | "list": [ 40 | { 41 | "builtIn": 1, 42 | "datasource": "-- Grafana --", 43 | "enable": true, 44 | "hide": true, 45 | "iconColor": "rgba(0, 211, 255, 1)", 46 | "name": "Annotations & Alerts", 47 | "type": "dashboard" 48 | } 49 | ] 50 | }, 51 | "editable": true, 52 | "gnetId": null, 53 | "graphTooltip": 0, 54 | "id": null, 55 | "links": [], 56 | "panels": [ 57 | { 58 | "cacheTimeout": null, 59 | "colorBackground": false, 60 | "colorValue": false, 61 | "colors": [ 62 | "#299c46", 63 | "rgba(237, 129, 40, 0.89)", 64 | "#d44a3a" 65 | ], 66 | "datasource": "${DS_TELEINFO}", 67 | "decimals": 6, 68 | "format": "watth", 69 | "gauge": { 70 | "maxValue": 100, 71 | "minValue": 0, 72 | "show": false, 73 | "thresholdLabels": false, 74 | "thresholdMarkers": true 75 | }, 76 | "gridPos": { 77 | "h": 3, 78 | "w": 5, 79 | "x": 0, 80 | "y": 0 81 | }, 82 | "id": 10, 83 | "interval": null, 84 | "links": [], 85 | "mappingType": 1, 86 | "mappingTypes": [ 87 | { 88 | "name": "value to text", 89 | "value": 1 90 | }, 91 | { 92 | "name": "range to text", 93 | "value": 2 94 | } 95 | ], 96 | "maxDataPoints": 100, 97 | "nullPointMode": "connected", 98 | "nullText": null, 99 | "postfix": "", 100 | "postfixFontSize": "50%", 101 | "prefix": "", 102 | "prefixFontSize": "50%", 103 | "rangeMaps": [ 104 | { 105 | "from": "null", 106 | "text": "N/A", 107 | "to": "null" 108 | } 109 | ], 110 | "sparkline": { 111 | "fillColor": "rgba(31, 118, 189, 0.18)", 112 | "full": false, 113 | "lineColor": "rgb(31, 120, 193)", 114 | "show": false 115 | }, 116 | "tableColumn": "", 117 | "targets": [ 118 | { 119 | "groupBy": [], 120 | "measurement": "HCHC", 121 | "orderByTime": "ASC", 122 | "policy": "default", 123 | "refId": "A", 124 | "resultFormat": "time_series", 125 | "select": [ 126 | [ 127 | { 128 | "params": [ 129 | "value" 130 | ], 131 | "type": "field" 132 | }, 133 | { 134 | "params": [], 135 | "type": "last" 136 | } 137 | ] 138 | ], 139 | "tags": [] 140 | } 141 | ], 142 | "thresholds": "", 143 | "title": "Index Heure Creuse", 144 | "type": "singlestat", 145 | "valueFontSize": "80%", 146 | "valueMaps": [ 147 | { 148 | "op": "=", 149 | "text": "N/A", 150 | "value": "null" 151 | } 152 | ], 153 | "valueName": "avg" 154 | }, 155 | { 156 | "cacheTimeout": null, 157 | "colorBackground": true, 158 | "colorValue": false, 159 | "colors": [ 160 | "#299c46", 161 | "rgb(185, 141, 18)", 162 | "#d44a3a" 163 | ], 164 | "datasource": "${DS_TELEINFO}", 165 | "format": "currencyEUR", 166 | "gauge": { 167 | "maxValue": 100, 168 | "minValue": 0, 169 | "show": false, 170 | "thresholdLabels": false, 171 | "thresholdMarkers": true 172 | }, 173 | "gridPos": { 174 | "h": 3, 175 | "w": 5, 176 | "x": 5, 177 | "y": 0 178 | }, 179 | "id": 15, 180 | "interval": null, 181 | "links": [], 182 | "mappingType": 1, 183 | "mappingTypes": [ 184 | { 185 | "name": "value to text", 186 | "value": 1 187 | }, 188 | { 189 | "name": "range to text", 190 | "value": 2 191 | } 192 | ], 193 | "maxDataPoints": 100, 194 | "nullPointMode": "connected", 195 | "nullText": null, 196 | "postfix": "", 197 | "postfixFontSize": "50%", 198 | "prefix": "", 199 | "prefixFontSize": "50%", 200 | "rangeMaps": [ 201 | { 202 | "from": "null", 203 | "text": "N/A", 204 | "to": "null" 205 | } 206 | ], 207 | "sparkline": { 208 | "fillColor": "rgba(31, 118, 189, 0.18)", 209 | "full": false, 210 | "lineColor": "rgb(31, 120, 193)", 211 | "show": false 212 | }, 213 | "tableColumn": "", 214 | "targets": [ 215 | { 216 | "alias": "HP", 217 | "groupBy": [ 218 | { 219 | "params": [ 220 | "$__interval" 221 | ], 222 | "type": "time" 223 | }, 224 | { 225 | "params": [ 226 | "null" 227 | ], 228 | "type": "fill" 229 | } 230 | ], 231 | "measurement": "HCHC", 232 | "orderByTime": "ASC", 233 | "policy": "default", 234 | "refId": "A", 235 | "resultFormat": "time_series", 236 | "select": [ 237 | [ 238 | { 239 | "params": [ 240 | "value" 241 | ], 242 | "type": "field" 243 | }, 244 | { 245 | "params": [], 246 | "type": "mean" 247 | }, 248 | { 249 | "params": [ 250 | "*0.00007380" 251 | ], 252 | "type": "math" 253 | } 254 | ] 255 | ], 256 | "tags": [] 257 | } 258 | ], 259 | "thresholds": "", 260 | "title": "Tarif HC Période", 261 | "transparent": false, 262 | "type": "singlestat", 263 | "valueFontSize": "80%", 264 | "valueMaps": [ 265 | { 266 | "op": "=", 267 | "text": "N/A", 268 | "value": "null" 269 | } 270 | ], 271 | "valueName": "diff" 272 | }, 273 | { 274 | "cacheTimeout": null, 275 | "colorBackground": false, 276 | "colorValue": false, 277 | "colors": [ 278 | "#299c46", 279 | "rgba(237, 129, 40, 0.89)", 280 | "#d44a3a" 281 | ], 282 | "datasource": "${DS_TELEINFO}", 283 | "format": "watth", 284 | "gauge": { 285 | "maxValue": 100, 286 | "minValue": 0, 287 | "show": false, 288 | "thresholdLabels": false, 289 | "thresholdMarkers": true 290 | }, 291 | "gridPos": { 292 | "h": 3, 293 | "w": 4, 294 | "x": 10, 295 | "y": 0 296 | }, 297 | "id": 12, 298 | "interval": null, 299 | "links": [], 300 | "mappingType": 1, 301 | "mappingTypes": [ 302 | { 303 | "name": "value to text", 304 | "value": 1 305 | }, 306 | { 307 | "name": "range to text", 308 | "value": 2 309 | } 310 | ], 311 | "maxDataPoints": 100, 312 | "nullPointMode": "connected", 313 | "nullText": null, 314 | "postfix": "", 315 | "postfixFontSize": "50%", 316 | "prefix": "", 317 | "prefixFontSize": "50%", 318 | "rangeMaps": [ 319 | { 320 | "from": "null", 321 | "text": "N/A", 322 | "to": "null" 323 | } 324 | ], 325 | "sparkline": { 326 | "fillColor": "rgba(31, 118, 189, 0.18)", 327 | "full": false, 328 | "lineColor": "rgb(31, 120, 193)", 329 | "show": false 330 | }, 331 | "tableColumn": "", 332 | "targets": [ 333 | { 334 | "groupBy": [], 335 | "measurement": "PTEC", 336 | "orderByTime": "ASC", 337 | "policy": "default", 338 | "refId": "A", 339 | "resultFormat": "time_series", 340 | "select": [ 341 | [ 342 | { 343 | "params": [ 344 | "value" 345 | ], 346 | "type": "field" 347 | }, 348 | { 349 | "params": [], 350 | "type": "last" 351 | } 352 | ] 353 | ], 354 | "tags": [] 355 | } 356 | ], 357 | "thresholds": "", 358 | "title": "Tarif en cours", 359 | "type": "singlestat", 360 | "valueFontSize": "80%", 361 | "valueMaps": [ 362 | { 363 | "op": "=", 364 | "text": "N/A", 365 | "value": "null" 366 | } 367 | ], 368 | "valueName": "avg" 369 | }, 370 | { 371 | "cacheTimeout": null, 372 | "colorBackground": true, 373 | "colorValue": false, 374 | "colors": [ 375 | "#299c46", 376 | "#508642", 377 | "#d44a3a" 378 | ], 379 | "datasource": "${DS_TELEINFO}", 380 | "format": "currencyEUR", 381 | "gauge": { 382 | "maxValue": 100, 383 | "minValue": 0, 384 | "show": false, 385 | "thresholdLabels": false, 386 | "thresholdMarkers": true 387 | }, 388 | "gridPos": { 389 | "h": 3, 390 | "w": 5, 391 | "x": 14, 392 | "y": 0 393 | }, 394 | "id": 14, 395 | "interval": null, 396 | "links": [], 397 | "mappingType": 1, 398 | "mappingTypes": [ 399 | { 400 | "name": "value to text", 401 | "value": 1 402 | }, 403 | { 404 | "name": "range to text", 405 | "value": 2 406 | } 407 | ], 408 | "maxDataPoints": 100, 409 | "nullPointMode": "connected", 410 | "nullText": null, 411 | "postfix": "", 412 | "postfixFontSize": "50%", 413 | "prefix": "", 414 | "prefixFontSize": "50%", 415 | "rangeMaps": [ 416 | { 417 | "from": "null", 418 | "text": "N/A", 419 | "to": "null" 420 | } 421 | ], 422 | "sparkline": { 423 | "fillColor": "rgba(31, 118, 189, 0.18)", 424 | "full": false, 425 | "lineColor": "rgb(31, 120, 193)", 426 | "show": false 427 | }, 428 | "tableColumn": "", 429 | "targets": [ 430 | { 431 | "alias": "HP", 432 | "groupBy": [ 433 | { 434 | "params": [ 435 | "$__interval" 436 | ], 437 | "type": "time" 438 | }, 439 | { 440 | "params": [ 441 | "null" 442 | ], 443 | "type": "fill" 444 | } 445 | ], 446 | "measurement": "HCHP", 447 | "orderByTime": "ASC", 448 | "policy": "default", 449 | "refId": "A", 450 | "resultFormat": "time_series", 451 | "select": [ 452 | [ 453 | { 454 | "params": [ 455 | "value" 456 | ], 457 | "type": "field" 458 | }, 459 | { 460 | "params": [], 461 | "type": "mean" 462 | }, 463 | { 464 | "params": [ 465 | "*0.00009790" 466 | ], 467 | "type": "math" 468 | } 469 | ] 470 | ], 471 | "tags": [] 472 | } 473 | ], 474 | "thresholds": "", 475 | "title": "Tarif HP Période", 476 | "transparent": false, 477 | "type": "singlestat", 478 | "valueFontSize": "80%", 479 | "valueMaps": [ 480 | { 481 | "op": "=", 482 | "text": "N/A", 483 | "value": "null" 484 | } 485 | ], 486 | "valueName": "diff" 487 | }, 488 | { 489 | "cacheTimeout": null, 490 | "colorBackground": false, 491 | "colorValue": false, 492 | "colors": [ 493 | "#299c46", 494 | "rgba(237, 129, 40, 0.89)", 495 | "#d44a3a" 496 | ], 497 | "datasource": "${DS_TELEINFO}", 498 | "decimals": 6, 499 | "format": "watth", 500 | "gauge": { 501 | "maxValue": 100, 502 | "minValue": 0, 503 | "show": false, 504 | "thresholdLabels": false, 505 | "thresholdMarkers": true 506 | }, 507 | "gridPos": { 508 | "h": 3, 509 | "w": 5, 510 | "x": 19, 511 | "y": 0 512 | }, 513 | "id": 11, 514 | "interval": null, 515 | "links": [], 516 | "mappingType": 1, 517 | "mappingTypes": [ 518 | { 519 | "name": "value to text", 520 | "value": 1 521 | }, 522 | { 523 | "name": "range to text", 524 | "value": 2 525 | } 526 | ], 527 | "maxDataPoints": 100, 528 | "nullPointMode": "connected", 529 | "nullText": null, 530 | "postfix": "", 531 | "postfixFontSize": "50%", 532 | "prefix": "", 533 | "prefixFontSize": "50%", 534 | "rangeMaps": [ 535 | { 536 | "from": "null", 537 | "text": "N/A", 538 | "to": "null" 539 | } 540 | ], 541 | "sparkline": { 542 | "fillColor": "rgba(31, 118, 189, 0.18)", 543 | "full": false, 544 | "lineColor": "rgb(31, 120, 193)", 545 | "show": false 546 | }, 547 | "tableColumn": "", 548 | "targets": [ 549 | { 550 | "groupBy": [], 551 | "measurement": "HCHP", 552 | "orderByTime": "ASC", 553 | "policy": "default", 554 | "refId": "A", 555 | "resultFormat": "time_series", 556 | "select": [ 557 | [ 558 | { 559 | "params": [ 560 | "value" 561 | ], 562 | "type": "field" 563 | }, 564 | { 565 | "params": [], 566 | "type": "last" 567 | } 568 | ] 569 | ], 570 | "tags": [] 571 | } 572 | ], 573 | "thresholds": "", 574 | "title": "Index Heure Pleine", 575 | "type": "singlestat", 576 | "valueFontSize": "80%", 577 | "valueMaps": [ 578 | { 579 | "op": "=", 580 | "text": "N/A", 581 | "value": "null" 582 | } 583 | ], 584 | "valueName": "avg" 585 | }, 586 | { 587 | "aliasColors": {}, 588 | "bars": false, 589 | "dashLength": 10, 590 | "dashes": false, 591 | "datasource": "${DS_TELEINFO}", 592 | "fill": 1, 593 | "gridPos": { 594 | "h": 9, 595 | "w": 12, 596 | "x": 0, 597 | "y": 3 598 | }, 599 | "id": 8, 600 | "legend": { 601 | "alignAsTable": true, 602 | "avg": false, 603 | "current": true, 604 | "max": true, 605 | "min": true, 606 | "rightSide": false, 607 | "show": true, 608 | "total": false, 609 | "values": true 610 | }, 611 | "lines": true, 612 | "linewidth": 1, 613 | "links": [], 614 | "nullPointMode": "null", 615 | "percentage": false, 616 | "pointradius": 5, 617 | "points": false, 618 | "renderer": "flot", 619 | "seriesOverrides": [], 620 | "spaceLength": 10, 621 | "stack": false, 622 | "steppedLine": false, 623 | "targets": [ 624 | { 625 | "alias": "pleines", 626 | "groupBy": [], 627 | "hide": false, 628 | "measurement": "HCHP", 629 | "orderByTime": "ASC", 630 | "policy": "default", 631 | "query": "SELECT mean(\"value\")::integer AS value FROM \"HCHC\" WHERE $timeFilter GROUP BY time(1s) fill(linear)", 632 | "rawQuery": false, 633 | "refId": "B", 634 | "resultFormat": "time_series", 635 | "select": [ 636 | [ 637 | { 638 | "params": [ 639 | "value" 640 | ], 641 | "type": "field" 642 | }, 643 | { 644 | "params": [], 645 | "type": "difference" 646 | } 647 | ] 648 | ], 649 | "tags": [] 650 | }, 651 | { 652 | "alias": "creuses", 653 | "groupBy": [], 654 | "measurement": "HCHC", 655 | "orderByTime": "ASC", 656 | "policy": "default", 657 | "refId": "A", 658 | "resultFormat": "time_series", 659 | "select": [ 660 | [ 661 | { 662 | "params": [ 663 | "value" 664 | ], 665 | "type": "field" 666 | }, 667 | { 668 | "params": [], 669 | "type": "difference" 670 | } 671 | ] 672 | ], 673 | "tags": [] 674 | } 675 | ], 676 | "thresholds": [], 677 | "timeFrom": null, 678 | "timeShift": null, 679 | "title": "Evolution Index", 680 | "tooltip": { 681 | "shared": true, 682 | "sort": 0, 683 | "value_type": "cumulative" 684 | }, 685 | "type": "graph", 686 | "xaxis": { 687 | "buckets": null, 688 | "mode": "time", 689 | "name": null, 690 | "show": true, 691 | "values": [] 692 | }, 693 | "yaxes": [ 694 | { 695 | "format": "watth", 696 | "label": null, 697 | "logBase": 1, 698 | "max": null, 699 | "min": null, 700 | "show": true 701 | }, 702 | { 703 | "format": "short", 704 | "label": null, 705 | "logBase": 1, 706 | "max": null, 707 | "min": null, 708 | "show": false 709 | } 710 | ], 711 | "yaxis": { 712 | "align": true, 713 | "alignLevel": null 714 | } 715 | }, 716 | { 717 | "aliasColors": {}, 718 | "bars": false, 719 | "dashLength": 10, 720 | "dashes": false, 721 | "datasource": "${DS_TELEINFO}", 722 | "fill": 1, 723 | "gridPos": { 724 | "h": 9, 725 | "w": 12, 726 | "x": 12, 727 | "y": 3 728 | }, 729 | "id": 6, 730 | "interval": "10s", 731 | "legend": { 732 | "alignAsTable": true, 733 | "avg": false, 734 | "current": true, 735 | "max": true, 736 | "min": true, 737 | "rightSide": false, 738 | "show": true, 739 | "total": false, 740 | "values": true 741 | }, 742 | "lines": true, 743 | "linewidth": 1, 744 | "links": [], 745 | "nullPointMode": "connected", 746 | "percentage": false, 747 | "pointradius": 5, 748 | "points": false, 749 | "renderer": "flot", 750 | "seriesOverrides": [], 751 | "spaceLength": 10, 752 | "stack": false, 753 | "steppedLine": false, 754 | "targets": [ 755 | { 756 | "alias": "puissance_apparente", 757 | "groupBy": [ 758 | { 759 | "params": [ 760 | "$__interval" 761 | ], 762 | "type": "time" 763 | }, 764 | { 765 | "params": [ 766 | "none" 767 | ], 768 | "type": "fill" 769 | } 770 | ], 771 | "hide": false, 772 | "measurement": "PAPP", 773 | "orderByTime": "ASC", 774 | "policy": "default", 775 | "query": "SELECT mean(\"value\")::integer AS value FROM \"HCHC\" WHERE $timeFilter GROUP BY time(1s) fill(linear)", 776 | "rawQuery": false, 777 | "refId": "B", 778 | "resultFormat": "time_series", 779 | "select": [ 780 | [ 781 | { 782 | "params": [ 783 | "value" 784 | ], 785 | "type": "field" 786 | }, 787 | { 788 | "params": [], 789 | "type": "mode" 790 | } 791 | ] 792 | ], 793 | "tags": [] 794 | }, 795 | { 796 | "alias": "intensite", 797 | "groupBy": [ 798 | { 799 | "params": [ 800 | "$__interval" 801 | ], 802 | "type": "time" 803 | }, 804 | { 805 | "params": [ 806 | "none" 807 | ], 808 | "type": "fill" 809 | } 810 | ], 811 | "hide": false, 812 | "measurement": "IINST", 813 | "orderByTime": "ASC", 814 | "policy": "default", 815 | "query": "SELECT mean(\"value\")::integer AS value FROM \"HCHC\" WHERE $timeFilter GROUP BY time(1s) fill(linear)", 816 | "rawQuery": false, 817 | "refId": "A", 818 | "resultFormat": "time_series", 819 | "select": [ 820 | [ 821 | { 822 | "params": [ 823 | "value" 824 | ], 825 | "type": "field" 826 | }, 827 | { 828 | "params": [], 829 | "type": "mode" 830 | } 831 | ] 832 | ], 833 | "tags": [] 834 | } 835 | ], 836 | "thresholds": [], 837 | "timeFrom": null, 838 | "timeShift": null, 839 | "title": "Puissance apparante / Intensité", 840 | "tooltip": { 841 | "shared": true, 842 | "sort": 0, 843 | "value_type": "individual" 844 | }, 845 | "type": "graph", 846 | "xaxis": { 847 | "buckets": null, 848 | "mode": "time", 849 | "name": null, 850 | "show": true, 851 | "values": [] 852 | }, 853 | "yaxes": [ 854 | { 855 | "format": "short", 856 | "label": "Puissance", 857 | "logBase": 1, 858 | "max": null, 859 | "min": null, 860 | "show": true 861 | }, 862 | { 863 | "decimals": null, 864 | "format": "short", 865 | "label": "Intensité", 866 | "logBase": 1, 867 | "max": null, 868 | "min": null, 869 | "show": true 870 | } 871 | ], 872 | "yaxis": { 873 | "align": false, 874 | "alignLevel": null 875 | } 876 | }, 877 | { 878 | "aliasColors": {}, 879 | "bars": false, 880 | "dashLength": 10, 881 | "dashes": false, 882 | "datasource": "${DS_TELEINFO}", 883 | "fill": 1, 884 | "gridPos": { 885 | "h": 9, 886 | "w": 12, 887 | "x": 0, 888 | "y": 12 889 | }, 890 | "id": 5, 891 | "legend": { 892 | "alignAsTable": true, 893 | "avg": false, 894 | "current": true, 895 | "max": true, 896 | "min": true, 897 | "rightSide": false, 898 | "show": true, 899 | "total": false, 900 | "values": true 901 | }, 902 | "lines": true, 903 | "linewidth": 1, 904 | "links": [], 905 | "nullPointMode": "connected", 906 | "percentage": false, 907 | "pointradius": 5, 908 | "points": false, 909 | "renderer": "flot", 910 | "seriesOverrides": [], 911 | "spaceLength": 10, 912 | "stack": true, 913 | "steppedLine": false, 914 | "targets": [ 915 | { 916 | "alias": "hc", 917 | "groupBy": [], 918 | "hide": false, 919 | "measurement": "HCHC", 920 | "orderByTime": "ASC", 921 | "policy": "default", 922 | "query": "SELECT mean(\"value\")::integer AS value FROM \"HCHC\" WHERE $timeFilter GROUP BY time(1s) fill(linear)", 923 | "rawQuery": false, 924 | "refId": "B", 925 | "resultFormat": "time_series", 926 | "select": [ 927 | [ 928 | { 929 | "params": [ 930 | "value" 931 | ], 932 | "type": "field" 933 | } 934 | ] 935 | ], 936 | "tags": [] 937 | } 938 | ], 939 | "thresholds": [], 940 | "timeFrom": null, 941 | "timeShift": null, 942 | "title": "Heures creuses", 943 | "tooltip": { 944 | "shared": true, 945 | "sort": 0, 946 | "value_type": "individual" 947 | }, 948 | "type": "graph", 949 | "xaxis": { 950 | "buckets": null, 951 | "mode": "time", 952 | "name": null, 953 | "show": true, 954 | "values": [] 955 | }, 956 | "yaxes": [ 957 | { 958 | "format": "watth", 959 | "label": null, 960 | "logBase": 1, 961 | "max": null, 962 | "min": null, 963 | "show": true 964 | }, 965 | { 966 | "format": "short", 967 | "label": null, 968 | "logBase": 1, 969 | "max": null, 970 | "min": null, 971 | "show": false 972 | } 973 | ], 974 | "yaxis": { 975 | "align": true, 976 | "alignLevel": null 977 | } 978 | }, 979 | { 980 | "aliasColors": {}, 981 | "bars": false, 982 | "dashLength": 10, 983 | "dashes": false, 984 | "datasource": "${DS_TELEINFO}", 985 | "fill": 1, 986 | "gridPos": { 987 | "h": 9, 988 | "w": 12, 989 | "x": 12, 990 | "y": 12 991 | }, 992 | "id": 2, 993 | "legend": { 994 | "alignAsTable": true, 995 | "avg": false, 996 | "current": true, 997 | "max": true, 998 | "min": true, 999 | "rightSide": false, 1000 | "show": true, 1001 | "total": false, 1002 | "values": true 1003 | }, 1004 | "lines": true, 1005 | "linewidth": 1, 1006 | "links": [], 1007 | "nullPointMode": "null", 1008 | "percentage": false, 1009 | "pointradius": 5, 1010 | "points": false, 1011 | "renderer": "flot", 1012 | "repeat": null, 1013 | "seriesOverrides": [], 1014 | "spaceLength": 10, 1015 | "stack": false, 1016 | "steppedLine": false, 1017 | "targets": [ 1018 | { 1019 | "alias": "pl", 1020 | "groupBy": [], 1021 | "hide": false, 1022 | "measurement": "HCHP", 1023 | "orderByTime": "ASC", 1024 | "policy": "default", 1025 | "query": "SELECT mean(\"value\")::integer AS value FROM \"HCHC\" WHERE $timeFilter GROUP BY time(1s) fill(linear)", 1026 | "rawQuery": false, 1027 | "refId": "B", 1028 | "resultFormat": "time_series", 1029 | "select": [ 1030 | [ 1031 | { 1032 | "params": [ 1033 | "value" 1034 | ], 1035 | "type": "field" 1036 | } 1037 | ] 1038 | ], 1039 | "tags": [] 1040 | } 1041 | ], 1042 | "thresholds": [], 1043 | "timeFrom": null, 1044 | "timeShift": null, 1045 | "title": "Heures pleines", 1046 | "tooltip": { 1047 | "shared": true, 1048 | "sort": 0, 1049 | "value_type": "cumulative" 1050 | }, 1051 | "type": "graph", 1052 | "xaxis": { 1053 | "buckets": null, 1054 | "mode": "time", 1055 | "name": null, 1056 | "show": true, 1057 | "values": [] 1058 | }, 1059 | "yaxes": [ 1060 | { 1061 | "format": "watth", 1062 | "label": null, 1063 | "logBase": 1, 1064 | "max": null, 1065 | "min": null, 1066 | "show": true 1067 | }, 1068 | { 1069 | "format": "short", 1070 | "label": null, 1071 | "logBase": 1, 1072 | "max": null, 1073 | "min": null, 1074 | "show": false 1075 | } 1076 | ], 1077 | "yaxis": { 1078 | "align": true, 1079 | "alignLevel": null 1080 | } 1081 | } 1082 | ], 1083 | "refresh": "10s", 1084 | "schemaVersion": 16, 1085 | "style": "dark", 1086 | "tags": [], 1087 | "templating": { 1088 | "list": [] 1089 | }, 1090 | "time": { 1091 | "from": "now-1h", 1092 | "to": "now" 1093 | }, 1094 | "timepicker": { 1095 | "refresh_intervals": [ 1096 | "5s", 1097 | "10s", 1098 | "30s", 1099 | "1m", 1100 | "5m", 1101 | "15m", 1102 | "30m", 1103 | "1h", 1104 | "2h", 1105 | "1d" 1106 | ], 1107 | "time_options": [ 1108 | "5m", 1109 | "15m", 1110 | "1h", 1111 | "6h", 1112 | "12h", 1113 | "24h", 1114 | "2d", 1115 | "7d", 1116 | "30d" 1117 | ] 1118 | }, 1119 | "timezone": "", 1120 | "title": "Conso Elec", 1121 | "uid": "vrq6Vgigz", 1122 | "version": 37 1123 | } 1124 | --------------------------------------------------------------------------------