MErci pour la réponse.
Pourrais-tu expliquer ce que tu entends par : « avec mise à jour via automatisation cependant »
MErci pour la réponse.
Pourrais-tu expliquer ce que tu entends par : « avec mise à jour via automatisation cependant »
L’info du Lixee via ZHA n’est pas remontée directement, il y a un peu de boulot d’intégration, c’est documenté quelque part mais je n’ai plus le lien.
Pouvez vous me dire pourquoi le flow de calcul de la puissance Index - Index il y a 2 min diviser par le temps pour convertir un échantillon de Wh en W instantanés finalement un peu retardé. Pourquoi ne pas simplement utiliser la PAPP directement ? Ce sont des VA donc au cos Phi près des Watts ?
Bonjour,
Bonjour,
Jusqu’à présent j’utilisait l’ancienne version du tuto sans problème (Mode Historique), dernièrement j’ai commandé une clé Atome et mon Linky a été passé en mode Standard, je me suis dit pas de souci, mon module GCE est compatible avec les deux modes, j’ai donc basculé dans un premier temps la vitesse de 1200 à 9600 mais ça n’a pas marché avec les ancien flow du précédent tuto, du coup, je me suis lancé dans ce tuto (merci) mais je rencontre plusieurs problème :
Je suis donc en mode Standard, tarif Base, j’ai utilisé le Flow de @fredarro (merci) qui inclus tout les flow.
[{"id":"e696907b37e7e85e","type":"tab","label":"teleinfo","disabled":false,"info":""},{"id":"febd8ca7ce62062d","type":"group","z":"e696907b37e7e85e","name":"Set l'index de chaque période à l'index courant au début de période","style":{"label":true},"nodes":["83801c775f3c3764","ee902c8c2450430d","f1a27f03854a4322","e720d8dc8c97cce6","65816f0f67af7c93","88c3675a91ec7b0b","e0309afc949f64ea"],"x":14,"y":939,"w":832,"h":202},{"id":"2b2fa39a512f535c","type":"group","z":"e696907b37e7e85e","name":"Compte le nombre d'indexes passé depuis le début de chaque période (toutes les minutes)","style":{"label":true},"nodes":["f1de51170f1fbc33","77377368081ff759","5642c3efb86a8e34","c955a35bcd602643","6eb9026986d19685","ae63f8e588661688","a0c0626b97739c0a","99aed81b18d589ed","ef06e9b85b8ca9be","9b747fb74062a489","201a2786812e35b5","fe0d6e3f9c842e2e","78829ff3a4c25467","859532bf22a1c8da","e5d4a8bf41762695","f250b3686a9f4cdf"],"x":14,"y":1159,"w":1372,"h":202},{"id":"eb7446bac0d2fd87","type":"group","z":"e696907b37e7e85e","name":"Reçoit index et stocke dans flow.index_wh","style":{"label":true},"nodes":["09e5d3d2a6443001","71ec73fa5f9965d7","51e6b072daefeebc"],"x":244,"y":19,"w":332,"h":122},{"id":"7b5248e7a4f0be4e","type":"group","z":"e696907b37e7e85e","name":"calcul pinst","style":{"label":true},"nodes":["25170f0082f1c6b2","f220f64ca4e68362","991d5e433636b5a0","a6febed86cc41563","17164269d1fb5bb8","b851f050af096007","9b23af35afdc4331","3584e64894563655","4f94ced32ce12610","3b19b1a1b023096a","928ba4948daffb74","e0eacbd20878ddef","afb5126fd7f39255","a9c26856092ca80e"],"x":14,"y":579,"w":1312,"h":262},{"id":"e0d9a650b246bdcb","type":"serial in","z":"e696907b37e7e85e","name":"","serial":"d563729e7bf63bcb","x":130,"y":200,"wires":[["fba460c6ec5e1275"]]},{"id":"fba460c6ec5e1275","type":"delay","z":"e696907b37e7e85e","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"minute","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"allowrate":false,"outputs":1,"x":150,"y":380,"wires":[["9525660fbb667de3"]]},{"id":"9525660fbb667de3","type":"function","z":"e696907b37e7e85e","name":"","func":"var test = msg.payload.charCodeAt(0) ;\nvar msge = {payload: msg.payload.toString()};\nif (test === 2)\n{\n // var outputMsgs = [];\n var index ;\n var intensite ;\n var indexJour = flow.get(\"index_wh_start_day\");\n var indexMois = flow.get(\"index_wh_start_month\");\n var indexHeure = flow.get(\"index_wh_start_hour\");\n var puissance ;\n var tension ;\n var PuissMaxJour;\n var PuissMaxHier ;\n var words = msge.payload.split(\"\\r\\n\");\n for (var w in words) {\n\n \n if (words[w].indexOf('EAST') == 0) {\n index = {payload: Number(words[w].substring(5,14)),\n measurement: \"Wh\",\n topic: \"Index\"\n };\n indexJour= {payload: index.payload-indexJour};\n indexMois= {payload: index.payload-indexMois};\n indexHeure = {payload: index.payload-indexHeure};\n }\n if (words[w].indexOf('IRMS1') == 0) {\n intensite = {payload: Number(words[w].substring(6,9)),\n measurement: \"A\",\n topic: \"Intensite\"\n };\n }\n if (words[w].indexOf('SINSTS') == 0) {\n puissance = {payload: Number(words[w].substring(7,12)),\n measurement: \"VA\",\n topic: \"puissance\"\n };\n }\n if (words[w].indexOf('URMS1') == 0) {\n tension = {payload: Number(words[w].substring(6,9)),\n measurement: \"V\",\n topic: \"tension\"\n };\n }\n if (words[w].replace(\"SMAXSN-1\",\"SSSSSS\").indexOf('SMAXSN') == 0) {\n PuissMaxJour = {payload: Number(words[w].substring(21,26)),\n measurement: \"VA\",\n heure: words[w].substring(14,16)+\":\"+words[w].substring(16,18)+\":\"+words[w].substring(18,20),\n topic: \"PuissMaxJour\"\n };\n }\n if (words[w].replace(\"-1\",\"H\").indexOf(\"SMAXSNH\") == 0) {\n PuissMaxHier = {payload: Number(words[w].substring(23,28)),\n measurement: \"VA\",\n heure: words[w].substring(16,18)+\":\"+words[w].substring(18,20)+\":\"+words[w].substring(20,22),\n topic: \"PuissMaxHier\"\n };\n }\n \n \n \n }\n return [index,intensite,puissance,tension,PuissMaxJour,PuissMaxHier,indexHeure,indexJour,indexMois];\n \n\n}\n\n\n","outputs":9,"noerr":0,"initialize":"","finalize":"","libs":[],"x":300,"y":380,"wires":[["8420610a00780181","23cb633fa1b2fee2","d3c7ea4fdf95e5fe"],["8420610a00780181","dc654a17d288215d"],["8420610a00780181","55f4a36e812a06bb"],["8420610a00780181"],["a6aa402a9b5d6d3a"],["257ab7a9df69312f"],["64705c4cb6f96343"],["9dfc0278e41d17e8"],["aee8608e9a0debb4"]]},{"id":"8420610a00780181","type":"function","z":"e696907b37e7e85e","name":"","func":"var INDEX = msg.payload;\nmsg.payload = [];\nfields = {\"value\":INDEX};\ntags = {\"entity\":\"teleinfo\"};\nmsg.payload = [fields,tags];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":160,"y":540,"wires":[["a456eb659f24299d"]]},{"id":"09e5d3d2a6443001","type":"link in","z":"e696907b37e7e85e","g":"eb7446bac0d2fd87","name":"index Wh in","links":["b8657ce5.66446","27470988.aa5696","e120179b.3c3678","7f1fb71e.2021f8","23cb633fa1b2fee2","9437b7a7.39e738"],"x":285,"y":100,"wires":[["71ec73fa5f9965d7","51e6b072daefeebc"]]},{"id":"71ec73fa5f9965d7","type":"debug","z":"e696907b37e7e85e","g":"eb7446bac0d2fd87","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":420,"y":60,"wires":[]},{"id":"51e6b072daefeebc","type":"change","z":"e696907b37e7e85e","g":"eb7446bac0d2fd87","name":"","rules":[{"t":"set","p":"index_wh","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":100,"wires":[[]]},{"id":"23cb633fa1b2fee2","type":"link out","z":"e696907b37e7e85e","name":"","links":["09e5d3d2a6443001","c85c85f7d26f3747"],"x":395,"y":240,"wires":[]},{"id":"25170f0082f1c6b2","type":"influxdb in","z":"e696907b37e7e85e","g":"7b5248e7a4f0be4e","influxdb":"ebaa14d3d3724a8b","name":"2min ago index","query":"SELECT distinct(\"value\") FROM \"Wh\" WHERE (\"entity\" = 'teleinfo') AND time >= now() - 120s GROUP BY time(1s) fill(null)","rawOutput":false,"precision":"","retentionPolicy":"","org":"","x":300,"y":660,"wires":[["991d5e433636b5a0","e0eacbd20878ddef"]]},{"id":"f220f64ca4e68362","type":"influxdb in","z":"e696907b37e7e85e","g":"7b5248e7a4f0be4e","influxdb":"ebaa14d3d3724a8b","name":"last index","query":"SELECT distinct(\"value\") FROM \"Wh\" WHERE (\"entity\" = 'teleinfo') AND time >= now() - 1m GROUP BY time(1s) fill(null) ORDER BY time DESC","rawOutput":false,"precision":"","retentionPolicy":"","org":"","x":280,"y":760,"wires":[["9b23af35afdc4331","afb5126fd7f39255"]]},{"id":"991d5e433636b5a0","type":"function","z":"e696907b37e7e85e","g":"7b5248e7a4f0be4e","name":"","func":"msg2 = {};\nmsg2.payload = {};\ntopic = 'old';\nmsg2.payload.old_state = parseFloat(msg.payload[0].distinct);\nmsg2.payload.old_date = new Date(msg.payload[0].time);\nmsg2.topic = topic;\nreturn msg2;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":470,"y":660,"wires":[["a6febed86cc41563","4f94ced32ce12610"]]},{"id":"a6febed86cc41563","type":"join","z":"e696907b37e7e85e","g":"7b5248e7a4f0be4e","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":610,"y":700,"wires":[["17164269d1fb5bb8"]]},{"id":"17164269d1fb5bb8","type":"function","z":"e696907b37e7e85e","g":"7b5248e7a4f0be4e","name":"","func":"old = msg.payload.old.old_state;\ncurrent = msg.payload.new.new_state;\ndiff_index = current - old;\ndiff_seconds = (msg.payload.new.new_date - msg.payload.old.old_date) / 1000;\nif (diff_seconds == 0) {\n conso = 0;\n} else {\n coeff = diff_seconds / 3600\n conso = diff_index / coeff\n conso = Math.round(conso*100)/100\n}\nmsg2 = {};\nmsg2.payload = {};\nmsg2.payload.conso = conso;\nmsg2.payload.diff_sec = diff_seconds;\nmsg2.payload.old_time = msg.payload.old.old_date;\nmsg2.payload.new_time = msg.payload.new.new_date;\nreturn msg2;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":750,"y":700,"wires":[["3584e64894563655"]]},{"id":"b851f050af096007","type":"inject","z":"e696907b37e7e85e","g":"7b5248e7a4f0be4e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"90","crontab":"","once":true,"onceDelay":"30","topic":"","payload":"","payloadType":"date","x":130,"y":720,"wires":[["25170f0082f1c6b2","f220f64ca4e68362"]]},{"id":"9b23af35afdc4331","type":"function","z":"e696907b37e7e85e","g":"7b5248e7a4f0be4e","name":"","func":"msg3 = {};\nmsg3.payload = {};\ntopic = 'new';\nmsg3.payload.new_state = parseFloat(msg.payload[0].distinct);\nmsg3.payload.new_date = new Date(msg.payload[0].time);\nmsg3.topic = topic;\nreturn msg3;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":470,"y":760,"wires":[["a6febed86cc41563","3b19b1a1b023096a"]]},{"id":"3584e64894563655","type":"function","z":"e696907b37e7e85e","g":"7b5248e7a4f0be4e","name":"transforme en nombre + format pour influx","func":"var conso = parseFloat(msg.payload.conso);\nmsg.payload = [];\nfields = {\"value\":conso};\ntags = {\"entity\":\"conso_teleinfo\"};\nmsg.payload = [fields,tags];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":980,"y":700,"wires":[["928ba4948daffb74","a9c26856092ca80e"]]},{"id":"4f94ced32ce12610","type":"debug","z":"e696907b37e7e85e","g":"7b5248e7a4f0be4e","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":610,"y":660,"wires":[]},{"id":"3b19b1a1b023096a","type":"debug","z":"e696907b37e7e85e","g":"7b5248e7a4f0be4e","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":630,"y":760,"wires":[]},{"id":"928ba4948daffb74","type":"debug","z":"e696907b37e7e85e","g":"7b5248e7a4f0be4e","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":1230,"y":660,"wires":[]},{"id":"e0eacbd20878ddef","type":"debug","z":"e696907b37e7e85e","g":"7b5248e7a4f0be4e","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":470,"y":620,"wires":[]},{"id":"afb5126fd7f39255","type":"debug","z":"e696907b37e7e85e","g":"7b5248e7a4f0be4e","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":470,"y":800,"wires":[]},{"id":"a9c26856092ca80e","type":"influxdb out","z":"e696907b37e7e85e","g":"7b5248e7a4f0be4e","influxdb":"ebaa14d3d3724a8b","name":"Conso W","measurement":"W","precision":"","retentionPolicy":"","database":"","retentionPolicyV18Flux":"","org":"","bucket":"","x":1240,"y":700,"wires":[]},{"id":"83801c775f3c3764","type":"change","z":"e696907b37e7e85e","g":"febd8ca7ce62062d","name":"","rules":[{"t":"set","p":"index_wh_start_day","pt":"flow","to":"index_wh","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":680,"y":1020,"wires":[[]]},{"id":"ee902c8c2450430d","type":"cronplus","z":"e696907b37e7e85e","g":"febd8ca7ce62062d","name":"start periods","outputField":"payload","timeZone":"","persistDynamic":false,"commandResponseMsgOutput":"output2","outputs":2,"options":[{"name":"day","topic":"day","payloadType":"default","payload":"","expressionType":"cron","expression":"0 0 0 * * ? *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"},{"name":"month","topic":"month","payloadType":"default","payload":"","expressionType":"cron","expression":"0 0 0 1 * ? *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"},{"name":"year","topic":"year","payloadType":"default","payload":"","expressionType":"cron","expression":"0 0 0 1 1 ? *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"},{"name":"hour","topic":"hour","payloadType":"default","payload":"","expressionType":"cron","expression":"0 0 * * * *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"}],"x":130,"y":1060,"wires":[["65816f0f67af7c93"],[]]},{"id":"f1a27f03854a4322","type":"change","z":"e696907b37e7e85e","g":"febd8ca7ce62062d","name":"","rules":[{"t":"set","p":"index_wh_start_month","pt":"flow","to":"index_wh","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":690,"y":1060,"wires":[[]]},{"id":"e720d8dc8c97cce6","type":"change","z":"e696907b37e7e85e","g":"febd8ca7ce62062d","name":"","rules":[{"t":"set","p":"index_wh_start_year","pt":"flow","to":"index_wh","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":680,"y":1100,"wires":[[]]},{"id":"65816f0f67af7c93","type":"switch","z":"e696907b37e7e85e","g":"febd8ca7ce62062d","name":"period select","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"hour","vt":"str"},{"t":"eq","v":"day","vt":"str"},{"t":"eq","v":"month","vt":"str"},{"t":"eq","v":"year","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":370,"y":1060,"wires":[["e0309afc949f64ea"],["83801c775f3c3764"],["f1a27f03854a4322"],["e720d8dc8c97cce6"]]},{"id":"88c3675a91ec7b0b","type":"inject","z":"e696907b37e7e85e","g":"febd8ca7ce62062d","name":"Manual init >> DO NOT PRESS UNTIL REALLY NEEDED >>","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":280,"y":980,"wires":[["83801c775f3c3764","f1a27f03854a4322","e720d8dc8c97cce6"]]},{"id":"97fa70081cc748b7","type":"ha-entity","z":"e696907b37e7e85e","name":"index","server":"df03acce.f940b","version":2,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"EDF_Index"},{"property":"device_class","value":"energy"},{"property":"icon","value":""},{"property":"unit_of_measurement","value":"Wh"},{"property":"state_class","value":"measurement"},{"property":"last_reset","value":"1970-01-01T00:00:00+00:00"}],"state":"payload","stateType":"msg","attributes":[{"property":"","value":"","valueType":"str"}],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","outputOnStateChange":false,"outputPayload":"$entity().state ? \"on\": \"off\"","outputPayloadType":"jsonata","x":750,"y":180,"wires":[[]]},{"id":"d3c7ea4fdf95e5fe","type":"rbe","z":"e696907b37e7e85e","name":"","func":"deadband","gap":"","start":"","inout":"out","septopics":true,"property":"payload","topi":"topic","x":580,"y":240,"wires":[["97fa70081cc748b7","ea9815c048bbe7c4"]]},{"id":"dc654a17d288215d","type":"rbe","z":"e696907b37e7e85e","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"payload","topi":"topic","x":570,"y":280,"wires":[["51aaf1a56f3a8a5b"]]},{"id":"257ab7a9df69312f","type":"rbe","z":"e696907b37e7e85e","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"payload","x":570,"y":400,"wires":[["9d56391114945469"]]},{"id":"a6aa402a9b5d6d3a","type":"rbe","z":"e696907b37e7e85e","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"payload","x":570,"y":360,"wires":[["75436fd8edb49b87"]]},{"id":"55f4a36e812a06bb","type":"rbe","z":"e696907b37e7e85e","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"payload","x":570,"y":320,"wires":[["ef6bd70fd81b83a4"]]},{"id":"f1de51170f1fbc33","type":"change","z":"e696907b37e7e85e","g":"2b2fa39a512f535c","name":"","rules":[{"t":"set","p":"index_wh_end_day","pt":"flow","to":"index_wh","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":1200,"wires":[["6eb9026986d19685"]]},{"id":"77377368081ff759","type":"change","z":"e696907b37e7e85e","g":"2b2fa39a512f535c","name":"","rules":[{"t":"set","p":"index_wh_end_month","pt":"flow","to":"index_wh","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":370,"y":1260,"wires":[["a0c0626b97739c0a"]]},{"id":"5642c3efb86a8e34","type":"change","z":"e696907b37e7e85e","g":"2b2fa39a512f535c","name":"","rules":[{"t":"set","p":"index_wh_end_year","pt":"flow","to":"index_wh","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":1320,"wires":[["ef06e9b85b8ca9be"]]},{"id":"c955a35bcd602643","type":"calculator","z":"e696907b37e7e85e","g":"2b2fa39a512f535c","name":"","inputMsgField":"payload","outputMsgField":"payload","operation":"sub","constant":"","round":false,"decimals":"0","x":740,"y":1200,"wires":[["fe0d6e3f9c842e2e"]]},{"id":"6eb9026986d19685","type":"function","z":"e696907b37e7e85e","g":"2b2fa39a512f535c","name":"","func":"var start_day = flow.get(\"index_wh_start_day\");\nvar end_day = flow.get(\"index_wh_end_day\");\nmsg.payload = [end_day,start_day];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":600,"y":1200,"wires":[["c955a35bcd602643"]]},{"id":"ae63f8e588661688","type":"calculator","z":"e696907b37e7e85e","g":"2b2fa39a512f535c","name":"","inputMsgField":"payload","outputMsgField":"payload","operation":"sub","constant":"","round":false,"decimals":"0","x":740,"y":1260,"wires":[["859532bf22a1c8da"]]},{"id":"a0c0626b97739c0a","type":"function","z":"e696907b37e7e85e","g":"2b2fa39a512f535c","name":"","func":"var start_month = flow.get(\"index_wh_start_month\");\nvar end_month = flow.get(\"index_wh_end_month\");\nmsg.payload = [end_month,start_month];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":600,"y":1260,"wires":[["ae63f8e588661688"]]},{"id":"99aed81b18d589ed","type":"calculator","z":"e696907b37e7e85e","g":"2b2fa39a512f535c","name":"","inputMsgField":"payload","outputMsgField":"payload","operation":"sub","constant":"","round":false,"decimals":"0","x":740,"y":1320,"wires":[["f250b3686a9f4cdf"]]},{"id":"ef06e9b85b8ca9be","type":"function","z":"e696907b37e7e85e","g":"2b2fa39a512f535c","name":"","func":"var start_year = flow.get(\"index_wh_start_year\");\nvar end_year = flow.get(\"index_wh_end_year\");\nmsg.payload = [end_year,start_year];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":600,"y":1320,"wires":[["99aed81b18d589ed"]]},{"id":"9b747fb74062a489","type":"inject","z":"e696907b37e7e85e","g":"2b2fa39a512f535c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"60","crontab":"","once":true,"onceDelay":"10","topic":"","payload":"","payloadType":"date","x":130,"y":1260,"wires":[["f1de51170f1fbc33","77377368081ff759","5642c3efb86a8e34"]]},{"id":"201a2786812e35b5","type":"influxdb out","z":"e696907b37e7e85e","g":"2b2fa39a512f535c","influxdb":"ebaa14d3d3724a8b","name":"Conso Wh day","measurement":"Wh","precision":"","retentionPolicy":"","database":"","retentionPolicyV18Flux":"","org":"","bucket":"","x":1260,"y":1200,"wires":[]},{"id":"fe0d6e3f9c842e2e","type":"function","z":"e696907b37e7e85e","g":"2b2fa39a512f535c","name":"transforme en nombre + format pour influx","func":"var conso = parseFloat(msg.payload);\nmsg.payload = [];\nfields = {\"value\":conso};\ntags = {\"entity\":\"conso_day\"};\nmsg.payload = [fields,tags];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":980,"y":1200,"wires":[["201a2786812e35b5"]]},{"id":"78829ff3a4c25467","type":"influxdb out","z":"e696907b37e7e85e","g":"2b2fa39a512f535c","influxdb":"ebaa14d3d3724a8b","name":"Conso Wh month","measurement":"Wh","precision":"","retentionPolicy":"","database":"","retentionPolicyV18Flux":"","org":"","bucket":"","x":1270,"y":1260,"wires":[]},{"id":"859532bf22a1c8da","type":"function","z":"e696907b37e7e85e","g":"2b2fa39a512f535c","name":"transforme en nombre + format pour influx","func":"var conso = parseFloat(msg.payload);\nmsg.payload = [];\nfields = {\"value\":conso};\ntags = {\"entity\":\"conso_month\"};\nmsg.payload = [fields,tags];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":980,"y":1260,"wires":[["78829ff3a4c25467"]]},{"id":"e5d4a8bf41762695","type":"influxdb out","z":"e696907b37e7e85e","g":"2b2fa39a512f535c","influxdb":"ebaa14d3d3724a8b","name":"Conso Wh year","measurement":"Wh","precision":"","retentionPolicy":"","database":"","retentionPolicyV18Flux":"","org":"","bucket":"","x":1260,"y":1320,"wires":[]},{"id":"f250b3686a9f4cdf","type":"function","z":"e696907b37e7e85e","g":"2b2fa39a512f535c","name":"transforme en nombre + format pour influx","func":"var conso = parseFloat(msg.payload);\nmsg.payload = [];\nfields = {\"value\":conso};\ntags = {\"entity\":\"conso_year\"};\nmsg.payload = [fields,tags];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":980,"y":1320,"wires":[["e5d4a8bf41762695"]]},{"id":"9dfc0278e41d17e8","type":"rbe","z":"e696907b37e7e85e","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"payload","x":570,"y":480,"wires":[["e9a33be3f1863923"]]},{"id":"aee8608e9a0debb4","type":"rbe","z":"e696907b37e7e85e","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"payload","x":570,"y":520,"wires":[["bb684e72129421b0"]]},{"id":"e0309afc949f64ea","type":"change","z":"e696907b37e7e85e","g":"febd8ca7ce62062d","name":"","rules":[{"t":"set","p":"index_wh_start_hour","pt":"flow","to":"index_wh","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":680,"y":980,"wires":[[]]},{"id":"64705c4cb6f96343","type":"rbe","z":"e696907b37e7e85e","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"payload","x":570,"y":440,"wires":[["5a25efee594de258"]]},{"id":"ea9815c048bbe7c4","type":"mqtt out","z":"e696907b37e7e85e","name":"","topic":"edf/index","qos":"1","retain":"true","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"5a2b8339.021dfc","x":760,"y":240,"wires":[]},{"id":"a456eb659f24299d","type":"influxdb out","z":"e696907b37e7e85e","influxdb":"ebaa14d3d3724a8b","name":"EDF debian","measurement":"","precision":"","retentionPolicy":"","database":"","retentionPolicyV18Flux":"","org":"","bucket":"","x":330,"y":540,"wires":[]},{"id":"51aaf1a56f3a8a5b","type":"mqtt out","z":"e696907b37e7e85e","name":"","topic":"edf/intensite","qos":"1","retain":"true","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"5a2b8339.021dfc","x":770,"y":280,"wires":[]},{"id":"ef6bd70fd81b83a4","type":"mqtt out","z":"e696907b37e7e85e","name":"","topic":"edf/puissance","qos":"1","retain":"true","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"5a2b8339.021dfc","x":780,"y":320,"wires":[]},{"id":"75436fd8edb49b87","type":"mqtt out","z":"e696907b37e7e85e","name":"","topic":"edf/puiss_max_jour","qos":"1","retain":"true","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"5a2b8339.021dfc","x":790,"y":360,"wires":[]},{"id":"9d56391114945469","type":"mqtt out","z":"e696907b37e7e85e","name":"","topic":"edf/puiss_max_hier","qos":"1","retain":"true","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"5a2b8339.021dfc","x":790,"y":400,"wires":[]},{"id":"5a25efee594de258","type":"mqtt out","z":"e696907b37e7e85e","name":"","topic":"edf/heure_edf","qos":"1","retain":"true","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"5a2b8339.021dfc","x":780,"y":440,"wires":[]},{"id":"e9a33be3f1863923","type":"mqtt out","z":"e696907b37e7e85e","name":"","topic":"edf/jour_edf","qos":"1","retain":"true","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"5a2b8339.021dfc","x":770,"y":480,"wires":[]},{"id":"bb684e72129421b0","type":"mqtt out","z":"e696907b37e7e85e","name":"","topic":"edf/mois_edf","qos":"1","retain":"true","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"5a2b8339.021dfc","x":770,"y":520,"wires":[]},{"id":"d563729e7bf63bcb","type":"serial-port","serialport":"/dev/ttyUSB0","serialbaud":"9600","databits":"7","parity":"even","stopbits":"1","waitfor":"","dtr":"none","rts":"none","cts":"none","dsr":"none","newline":"0x3","bin":"false","out":"char","addchar":"","responsetimeout":"10000"},{"id":"ebaa14d3d3724a8b","type":"influxdb","hostname":"192.168.10.4","port":"8086","protocol":"http","database":"edf","name":"debian edf","usetls":false,"tls":"ee38ec139a23466a","influxdbVersion":"1.x","url":"http://localhost:8086","rejectUnauthorized":true},{"id":"df03acce.f940b","type":"server","name":"Home Assistant","version":2,"addon":false,"rejectUnauthorizedCerts":false,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30"},{"id":"5a2b8339.021dfc","type":"mqtt-broker","name":"MQTT Docker","broker":"192.168.10.4","port":"1883","clientid":"","autoConnect":true,"usetls":false,"compatmode":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""},{"id":"ee38ec139a23466a","type":"tls-config","name":"","cert":"","key":"","ca":"","certname":"","keyname":"","caname":"","servername":"","verifyservercert":false}]
Mon module arrive bien à lire les données et les envoi bien à MQTT.
J’ai correctement configuré mon influxDB (V2) OUT et IN et quelques données ont bien été envoyés, presque toutes les tables sont là, il manque la table « conso_teleinfo »
Je rencontre deux problèmes
Problème 1 :
Le sensor « index » ne fonctionne pas, j’ai ces erreurs dans les logs de NodeRed :
2 Feb 22:53:15 - [error] [influxdb in:last index] HttpError: compilation failed: error @1:17-1:24: string literal key value must have a value
error @1:36-1:65: expected comma in property list, got ASSIGN
error @1:43-1:64: string literal key entity must have a value
error @1:52-1:64: invalid expression @1:63-1:64: '
error @1:52-1:64: unexpected token for property key: ASSIGN (=)
error @1:103-1:105: unexpected token for property key: DURATION (1s)
2 Feb 22:53:15 - [error] [influxdb in:2min ago index] HttpError: compilation failed: error @1:17-1:24: string literal key value must have a value
2 Feb 22:54:48 - [error] [ha-sensor:index] ValidationError: "attributes[0].property" is not allowed to be empty
2 Feb 22:55:49 - [error] [ha-sensor:index] ValidationError: "attributes[0].property" is not allowed to be empty
Problème 2 :
Parmis les capteurs qui remontent , certain n’ont pas de valeur (certainement lié au problème N° 1)
Les logs
Logger: homeassistant.components.influxdb.sensor
Source: components/influxdb/sensor.py:248
Integration: InfluxDB (documentation, issues)
First occurred: 10:08:53 (4 occurrences)
Last logged: 10:09:54
Query returned no results, sensor state set to UNKNOWN: from(bucket:"edf") |> range(start: -15m, stop: now()) |> filter(fn: (r) => r["entity"] == "conso_teleinfo") |> last(column: "_value").
Query returned multiple results, only value from first one is shown: from(bucket:"edf") |> range(start: -15m, stop: now()) |> filter(fn: (r) => r["entity"] == "teleinfo") |> last(column: "_value").
Logger: homeassistant.helpers.entity
Source: helpers/template.py:1446
First occurred: 10:52:54 (27 occurrences)
Last logged: 14:49:55
Update for sensor.edf_conso_aujourd_hui fails
Update for sensor.edf_conso_mois fails
Update for sensor.edf_conso_annee fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1745, in forgiving_float_filter
return float(value)
ValueError: could not convert string to float: 'None'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 548, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 746, in async_device_update
raise exc
File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/influxdb/sensor.py", line 252, in update
value = self._value_template.render_with_possible_json_value(
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 597, in render_with_possible_json_value
).result()
File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 458, in result
return self.__get_result()
File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
raise self._exception
File "/usr/src/homeassistant/homeassistant/util/async_.py", line 62, in run_callback
future.set_result(callback(*args))
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 624, in async_render_with_possible_json_value
return _render_with_context(self.template, compiled, **variables).strip()
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1984, in _render_with_context
return template.render(**kwargs)
File "/usr/local/lib/python3.10/site-packages/jinja2/environment.py", line 1301, in render
self.environment.handle_exception()
File "/usr/local/lib/python3.10/site-packages/jinja2/environment.py", line 936, in handle_exception
raise rewrite_traceback_stack(source=source)
File "<template>", line 1, in top-level template code
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1748, in forgiving_float_filter
raise_no_default("float", value)
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1446, in raise_no_default
raise ValueError(
ValueError: Template error: float got invalid input 'None' when rendering template '{{ value | float / 1000 }}' but no default was specified
La conf des sensors :
sensor:
- platform: influxdb
api_version: 2
organization: HomeAssitant
token: montoken
host: 192.168.1.10
port: 9595
ssl: false
bucket: edf
queries_flux:
- name: edf_puissance_instantanee
unique_id: edf_puissance_instantanee
unit_of_measurement: W
group_function: last
bucket: edf
query: >
filter(fn: (r) => r["entity"] == "conso_teleinfo")
- name: edf_intensite_instantanee
unique_id: edf_intensite_instantanee
unit_of_measurement: A
group_function: last
bucket: edf
query: >
filter(fn: (r) => r["entity"] == "teleinfo")
- name: edf_conso_aujourd_hui
unique_id: edf_conso_aujourd_hui
unit_of_measurement: kWh
value_template: '{{ value | float / 1000 }}'
group_function: last
bucket: edf
query: >
filter(fn: (r) => r["entity"] == "conso_day")
- name: edf_conso_mois
unique_id: edf_conso_mois
unit_of_measurement: kWh
value_template: '{{ value | float / 1000 }}'
group_function: last
bucket: edf
query: >
filter(fn: (r) => r["entity"] == "conso_month")
- name: edf_conso_annee
unique_id: edf_conso_annee
unit_of_measurement: kWh
value_template: '{{ value | float / 1000 }}'
group_function: last
bucket: edf
query: >
filter(fn: (r) => r["entity"] == "conso_year")
Merci d’avance pour votre aide.
Bonjour,
Mon compteur étant repassé en mode Historique, mes trames arrivent donc de nouveau correctement, du coup avez vous une idées des requêtes a renseigner dans le flow initial du tuto pour InfluxDB V2 ?
Merci
Bonjour,
je viens d’adapter la configuration de @SNoof (Merci infiniment !) en regardant ce qu’avait fait @fredarro il y a deux ans (Flow node-red sur Tic standard - #2 par fredarro) pour :
Tout me semble bien fonctionner jusqu’à l’intégration dans InfluxDB, et je compte partager mes résultats. Avant cela, j’aimerai avoir des retours d’experts sur quelques points :
1. @SNoof utilise une validation de trame juste après la sortie de la TIC historique. J’ai enlevé cette étape ne sachant pas l’adapter facilement à la TIC standard. Est-ce important si on a une TIC propre a priori ? Quel intérêt ?
2. Avant d’injecter dans InfluxDB, j’ai utiliser le noeud des configurations de @SNoof et de @fredarro, à savoir le code suivant :
var INDEX_KWH = msg.payload;
msg.payload = [];
fields = {"value":INDEX_KWH};
tags = {"entity":"teleinfo_total_kwh"};
msg.payload = [fields,tags];
return msg;
J’ai le message d’erreur suivant sur le noeud : Invalid Properties (Error in Javascript Codes)
J’ai l’impression que tout fonctionne malgré tout (cf. imprim écran
old = msg.payload.old.old_state;
current = msg.payload.new.new_state;
diff_index = current - old;
diff_seconds = (msg.payload.new.new_date - msg.payload.old.old_date) / 1000;
if (diff_seconds == 0) {
conso = 0;
} else {
coeff = diff_seconds / 3600
conso = diff_index / coeff
conso = Math.round(conso*100)/100
}
msg2 = {};
msg2.payload = {};
msg2.payload.conso = conso;
msg2.payload.diff_sec = diff_seconds;
msg2.payload.old_time = msg.payload.old.old_date;
msg2.payload.new_time = msg.payload.new.new_date;
return msg2;
3. Je suis une bille et commence tout juste à utiliser InfluxDB et Grafana. J’ai vu que @SNoof mettait le même tag avant injection pour des valeurs différentes (par exemple pour Index Wh et Puissance). Quel est l’intérêt ? J’ai l’impression qu’il vaut mieux séparer chaque injection par un tag différent, mais je me dis que mon ignorance des étapes suivantes me met peut-être sur une fausse route…
Plutôt que de partager un code mal pensé, grossièrement bricolé, j’aimerai voir vos retours avant de le proposer à la communauté.
Merci encore à tous les contributeurs, ce forum est une mine d’or !
Bonjour, je pensais m’en sortir mais c’est la galère, il y aurai t’il une transcription du dashboard grafana avec influxdb2 et le language flux?
Merci
Bonjour,
sur mon flow, j’ai remarqué qu’à chaque mise à jour de nodered, les start index doivent être réinitialisés manuellement avec le bouton Manual Init.
Quelqu’un a une parade pour pas avoir à tout remettre à zéro à chaque mise à jour ?
Par ailleurs, j’ai aussi remarqué qu’à chaque mise à jour de hass, je devais faire un restart flow pour que les devices hass envoient bien tous des données. Idem, quelqu’un a une parade (ou un élément à ajouter dans le flow ?)
Lo,
Je viens de lire ta réponse et je suis dans le même cas de figure que toi aujourd’hui,
Je suis en mode standard HP/HC avec un module Zlinky_TIC - Zigbee,
Pourrais-tu me partager tes flows stp,
Te remerciant par avance de ton partage,
Au plaisir,
Bonne soirée,
Voici mon flow : teleinfo_NR_Influx_hass/TIC standard/contrat_tempo at main · heaven988/teleinfo_NR_Influx_hass · GitHub
J’ai dû le mettre sur Github car HACF limite à 150 000 caractères !
Je suis passé en Tempo depuis, mais il suffit d’enlever cette partie (EASF03 à EASF06) avant de tout initialiser.
Je suis toujours en attente de retours de personnes plus avisées que moi pour savoir si j’ai des erreurs gênantes et sur la logique des tag dans influxdb.
En attendant, ça fonctionne !
Bonsoir,
Merci pour ton partage,
Je vais regarder ton flow demain dans la journée et essayer de le faire fonctionner,
Je ne manquerai pas de te faire un retour dans le week-end,
Au plaisir,
Bonne soirée,
J’ai importé le flow, je rencontre quelques soucis avec les notes function :
Je ne comprends pas pourquoi j’ai ce type d’erreur dans le debug,
Au plaisir,
Bon dimanche,
Bonjour à tous.
je déterre un peu le topic car je suis passé sur des panneaux photovoltaïques récemment.
j’utilise les flow pour du monophasé et HC/HP et ça fonctionne très bien, sauf quand je décide de mettre à jour la base de donnée qui se trouve sur un synology et qu’elle pête, supprimant par la même 2 ans de statistiques de conso (rhaaaa).
Mais c’est un autre sujet.
je n’ai pas l’impression que le module tic usb récupère des valeurs d’injection des panneaux:
ADCO XXXXXXXXXXXX D
OPTARIF HC… <
ISOUSC 30 9
HCHC 008243564 &
HCHP 008769857 E
PTEC HP…
IINST 015 ]
IMAX 090 H
PAPP 00000 !
HHPHC A ,
MOTDETAT 000000 B
mais je me trompe peut-être ?
Bonjour,
Aprés 1 an de bon fonctionnement et sans doute suite à une mise à jour de node red , le module cron-plus n’est plus opérationnel et le téléchargement dans le panel ne fonctionne pas . Vous avez le même probléme ?
Merci
Je suis en nodered 4.0.2 (la dernière) et mon noeud cronplus (2.1.0) fonctionne bien.
Tu as des logs nodered qui pourraient aider ?
merci pour cette prompte réponse.
Nodered 4.02 ,
erreur à l’install :
2024-07-22T19:06:27.024Z Installer : node-red-contrib-cron-plus 2.1.0
2024-07-22T19:06:26.935Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --omit=dev --engine-strict node-red-contrib-cron-plus@2.1.0
2024-07-22T19:06:29.135Z [out]
2024-07-22T19:06:29.135Z [out] up to date in 2s
2024-07-22T19:06:29.150Z rc=0
log node-red :
22 Jul 20:44:52 - [info] Installing module: node-red-contrib-cron-plus, version: 2.1.0
22 Jul 20:44:54 - [info] Installed module: node-red-contrib-cron-plus
22 Jul 20:44:55 - [warn] Installation of module node-red-contrib-cron-plus failed:
22 Jul 20:44:55 - [warn] ------------------------------------------
22 Jul 20:44:55 - [warn] undefined
22 Jul 20:44:55 - [warn] ------------------------------------------
Error: Install failed
at /opt/node_modules/@node-red/registry/lib/installer.js:290:25
at processTicksAndRejections (node:internal/process/task_queues:95:5)
22 Jul 20:44:55 - [error] Error: Install failed
Ton nodered c’est l’addon HA ? ou de l’autohébergé ? (docker, node…)
c’est :
Home Assistant Community Add-on: Node-RED
Un autre module peux t il le remplacer ? c’est quoi sa config ? merci