Community Forum
    • Blog
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    téléinfo sur linky Triphasé mode Historique

    Scheduled Pinned Locked Moved PiTInfo
    8 Posts 3 Posters 343 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • E Offline
      Eric44
      last edited by

      Bonjour,
      Après avoir déménagé, je souhaite rebrancher mon installation à base de D1 mini ESP32 et PITInfo. Cette fois, mon linky est en tri-phasé et en mode historique.
      N'arrivant pas à obtenir mes résultats, j'ai fait un essai avec IDE Arduino en guise de terminal série (à 1200 bauds) et mon module uTeleinfo connecté à mon port USB mais le résultat me semble déjà à la base discutable :
      ...
      16:15:49.356 -> BB⸮HP⸮B⸮0⸮⸮069963⸮S⸮
      16:15:49.543 -> BB⸮H⸮⸮נ000⸮9⸮6⸮9⸮ҍ
      16:15:49.777 -> BB⸮HP⸮נ000⸮055⸮9⸮\⸮
      16:15:50.008 -> BB⸮H⸮⸮Ҡ000⸮⸮96⸮0⸮Í
      16:15:50.194 -> BB⸮HP⸮Ҡ0000⸮3900⸮M⸮
      16:15:50.333 -> P⸮⸮àHP⸮B⸮P⸮
      16:15:50.474 -> D⸮MA⸮N⸮----⸮"⸮
      16:15:50.660 -> ⸮⸮NSԱ⸮000⸮H⸮
      16:15:50.800 -> ⸮⸮NSԲ⸮000⸮ɍ
      16:15:50.938 -> ⸮⸮NS⸮3⸮000⸮ʍ
      16:15:51.078 -> ⸮MAر⸮060⸮6⸮
      16:15:51.218 -> ⸮MAز⸮060⸮⸮⸮
      16:15:51.359 -> ⸮MA⸮3⸮060⸮⸮⸮
      16:15:51.499 -> PMAؠ03530⸮⸮⸮
      ...

      Qu'en pensez-vous ? Une piste pour résoudre ce soucis ?
      Merci par avance

      Nicolas BernaertsN 1 Reply Last reply Reply Quote
      • Nicolas BernaertsN Offline
        Nicolas Bernaerts @Eric44
        last edited by

        @Eric44
        Cela ressemble fortement a un problème de résistance sur l'étage d'entrée de l'opto couleur. Si la résistance est variable, essayez de la modifier.

        1 Reply Last reply Reply Quote
        • E Offline
          Eric44
          last edited by

          Merci beaucoup @Nicolas-Bernaerts pour cette proposition mais vu mon niveau en électronique et la miniaturisation de la bête, je ne me vois pas changer une résistance dans le bazar.
          Il n'y aurait pas d'autres pistes logicielles ?

          Pour info, Voici la clé télé info utilisée :
          IMG_20250411_115606.jpg

          1 Reply Last reply Reply Quote
          • CharlesC Offline
            Charles
            last edited by

            @Eric44 said in téléinfo sur linky Triphasé mode Historique:

            16:15:50.008 -> BB⸮H⸮⸮Ҡ000⸮⸮96⸮0⸮Í

            Normalement le mode historique ne pose pas de soucis de résistance, c'est quel soft qui est flashé dans le D1 ?

            1 Reply Last reply Reply Quote
            • E Offline
              Eric44
              last edited by Charles

              Bonjour @Charles ,
              Le module utilisé était un wemod teleinfo qui fonctionnait très bien connecté au linky de ma précédente maison (monophasé HC/HC). Le code était écrit grâce à ton aide.
              En voici le code injecté : teleinfoLinky.txt

              #include <LibTeleinfo.h>
              
                // Parsing JSON
                #include <ArduinoJson.h>
                const size_t capacity = JSON_OBJECT_SIZE(4) + JSON_ARRAY_SIZE(4) + 60;
              
                String chaineJSONenvoyee;
                
                float frequenceInterro=60;
                String commentairePutWS="";
                int PAC = 0;
              
              
              #define SERIAL_DEBUG  Serial
              #define SERIAL_TIC    Serial1
              
              // Teleinfo RXD pin is connected to ESP32-PICO-V3-02 GPIO8
              #define TIC_RX_PIN  23
              
              _Mode_e tinfo_mode = TINFO_MODE_HISTORIQUE; 
              //_Mode_e tinfo_mode = TINFO_MODE_STANDARD; 
              
              TInfo tinfo; // Teleinfo object
              
              // Wakeup de 5 secondes
              #define uS_TO_S_FACTOR 1000000ULL  /* Conversion factor for micro seconds to seconds */
              #define TIME_TO_SLEEP  5        /* Time ESP32 will go to sleep (in seconds) */
              
              #define LEDPIN LED_BUILTIN
                
              // Uptime timer
              boolean tick1sec=0;// one for interrupt, don't mess with 
              unsigned long uptime=0; // save value we can use in sketch even if we're interrupted
              
              String sendJSON(ValueList * me, boolean all){
                bool firstdatacomplete = true;
                bool firstdataenvoyee = true;
                String chaineJSONenvoyee = "";
                String chaineJSONcomplete = "";
                String Element_Valeur = "";
                String separateur = ",";
                String sep;
              
                // Got at least one ?
                if (me) {
              
                  PAC = 0;
                  // Json start
                  chaineJSONenvoyee = "{\"commentaire\":" + "\"" + commentairePutWS + "\"";
                  chaineJSONcomplete = "{\"commentaire\":" + "\"" + commentairePutWS + "\"";
              
                  // Loop thru the node
                  while (me->next) {
                    // go to next node
                    me = me->next;
              
                    // uniquement sur les nouvelles valeurs ou celles modifiées 
                    // sauf si explicitement demandé toutes
                    if ( all || ( me->flags & (TINFO_FLAGS_UPDATED | TINFO_FLAGS_ADDED) ) ) {
                      //Serial.println("|"+String(me->name)+"|") ;
                        
              
                        /*
                        Serial.print(F("\"")) ;
                        Serial.print(me->name) ;
                        Serial.print(F("\":")) ;
                        */
                          
                        // we have at least something ?
                        if (me->value && strlen(me->value))
                        {
                          boolean isNumber = true;
                          uint8_t c;
                          char * p = me->value;
                
                          // check if value is number
                          while (*p && isNumber) {
                            if ( *p < '0' || *p > '9' )
                              isNumber = false;
                            p++;
                          }
                  
                          // this will add "" on not number values
                          if (!isNumber) {
                            Element_Valeur = "\"" + String(me->name) + "\":" + "\"" + String(me->value) + "\"";
                          }
                          // this will remove leading zero on numbers
                          else
                            //Serial.print(atol(me->value));
                            Element_Valeur = "\"" + String(me->name) + "\":" + atol(me->value);
                        }
                        
                        if (String(me->name) != "MSG1" && 
                            String(me->name) != "PJOURF+1" &&
                            String(me->name) != "ADSC" &&
                            String(me->name) != "VTIC" &&
                            String(me->name) != "NGTF" &&
                            String(me->name) != "LTARF" &&
                            String(me->name) != "EAST" &&
                            String(me->name) != "EASF01" &&
                            String(me->name) != "EASF02" &&
                            String(me->name) != "EASF03" &&
                            String(me->name) != "EASF04" &&
                            String(me->name) != "EASF05" &&
                            String(me->name) != "EASF06" &&
                            String(me->name) != "EASF07" &&
                            String(me->name) != "EASF08" &&
                            String(me->name) != "EASF09" &&
                            String(me->name) != "EASF10" &&
                            String(me->name) != "EASD01" &&
                            String(me->name) != "EASD02" &&
                            String(me->name) != "EASD03" &&
                            String(me->name) != "EASD04" &&
                            String(me->name) != "EAIT" &&
                            String(me->name) != "ERQ1" &&
                            String(me->name) != "ERQ2" &&
                            String(me->name) != "ERQ3" &&
                            String(me->name) != "ERQ4" &&
                            String(me->name) != "IRMS1" &&
                            String(me->name) != "URMS1" &&
                            String(me->name) != "PREF" &&
                            String(me->name) != "PCOUP" &&
                            String(me->name) != "PREF" &&
                            String(me->name) != "CCASN" &&
                            String(me->name) != "CCASN-1" &&
                            String(me->name) != "CCAIN" &&
                            String(me->name) != "CCAIN-1" &&
                            //String(me->name) != "UMOY1" &&
                            String(me->name) != "STGE" &&
                            String(me->name) != "PRM" &&
                            String(me->name) != "RELAIS" &&
                            String(me->name) != "NTARF" &&
                            String(me->name) != "NJOURF" &&
                            String(me->name) != "NJOURF+1" 
                            ){
                          chaineJSONenvoyee = chaineJSONenvoyee + separateur + Element_Valeur;
                        }
                        
              
                        chaineJSONcomplete = chaineJSONcomplete + separateur + Element_Valeur;
                      }
                    }
                  
                 // Json end
                 //Serial.println(F("}")) ;
                 chaineJSONenvoyee = chaineJSONenvoyee + "}";
                 chaineJSONcomplete = chaineJSONcomplete + "}";
                 Serial.println("chaineJSONcomplete = " + chaineJSONcomplete );
                 Serial.println("chaineJSONenvoyee =  " + chaineJSONenvoyee );
              
                 return chaineJSONcomplete;
                }
              }
              
              
              /* ======================================================================
              Function: NewFrame 
              Purpose : callback when we received a complete teleinfo frame
              Input   : linked list pointer on the concerned data
              Output  : - 
              Comments: -
              ====================================================================== */
              void NewFrame(ValueList * me){
                SERIAL_DEBUG.println("NewFrame - uptime=" + String(uptime));
                if (tick1sec) {
                concatlog("NewFrame - uptime=" + String(uptime));
                chaineJSONenvoyee = sendJSON(me, true);
                postconsoWS(chaineJSONenvoyee);
                postlogsindb();
                logcycle="";
                ledClignotte();
                tick1sec = false;
                }
                
              }
              
              /* ======================================================================
              Function: UpdatedFrame 
              Purpose : callback when we received a complete teleinfo frame
              Input   : linked list pointer on the concerned data
              Output  : - 
              Comments: it's called only if one data in the frame is different than
                        the previous frame
              ====================================================================== */
              void UpdatedFrame(ValueList * me){
                SERIAL_DEBUG.println("UpdatedFrame - tick1sec=" + String(tick1sec));
                if (tick1sec) {
                  concatlog("UpdatedFrame - uptime=" + String(uptime));
                chaineJSONenvoyee = sendJSON(me, true);
                postconsoWS(chaineJSONenvoyee);
                postlogsindb();
                logcycle="";
                ledClignotte();
                  tick1sec = false;
                }
                
              }
              
              /* ======================================================================
              Function: initSerial
              Purpose : Configure (or reconfigure Serial Port)
              Input   : -
              Output  : - 
              Comments: -
              ====================================================================== */
              void initSerial(){
                // Cleanup
                SERIAL_TIC.flush();
                SERIAL_TIC.end();
              
                // Configure Teleinfo 
                SERIAL_DEBUG.printf_P(PSTR("TIC RX=GPIO%d  Mode:"), TIC_RX_PIN);
                SERIAL_TIC.begin(tinfo_mode == TINFO_MODE_HISTORIQUE ? 1200 : 9600, SERIAL_7E1, TIC_RX_PIN);
              
                if ( tinfo_mode == TINFO_MODE_HISTORIQUE ) {
                  SERIAL_DEBUG.println(F("Historique"));
                } else {
                  SERIAL_DEBUG.println(F("Standard"));
                }
              }
              
              /* ======================================================================
              Function: ledOff
              Purpose : Setup I/O for RGB Led to be OFF
              Input   : -
              Output  : - 
              Comments: -
              ====================================================================== */
              void ledClignotte(){
                digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
                delay(1000);                       // wait for a second
                digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
              }
              
              /* ======================================================================
              Function: setup
              Purpose : Setup I/O and other one time startup stuff
              Input   : -
              Output  : - 
              Comments: -
              ====================================================================== */
              void setup(){
                SERIAL_DEBUG.begin(115200);
                pinMode(LED_BUILTIN, OUTPUT);
              
                // Serial, pour le debug
                SERIAL_DEBUG.println(F("\r\n\r\n"));
                SERIAL_DEBUG.println(F("================================================="));
                SERIAL_DEBUG.println(F("     D1 Mini ESP32 - Teleinfo Lynky Alim WS      "));
                SERIAL_DEBUG.println(F("================================================="));
                SERIAL_DEBUG.println(F("\r\n"));
              
              
              
                        SERIAL_DEBUG.println("[Setup] Gestion du Wifi avec WifiManager");
                      WifiGestion();
              
                      //SERIAL_DEBUG.println("[Setup] Récupération des paramètres de cet arduino : Fréquence d'interrogation et du commentaire de prise de mesure");
                      //GET_params_arduino();
              
                      SERIAL_DEBUG.println("[Setup] Alimentation des logs en BDD à travers le service REST (Requête POST)");
                      SERIAL_DEBUG.println("-------------------------------------------------------------------------------");
                      concatlog("[Setup] Alimentation des logs en BDD (Req POST)");
                      postlogsindb();
                      
                // Init Serial Port
                initSerial();
              
                // Init teleinfo
                tinfo.init(tinfo_mode);
              
                // Attacher les callback dont nous avons besoin
                // pour cette demo, ADPS et TRAME modifiée
                tinfo.attachUpdatedFrame(UpdatedFrame);
                tinfo.attachNewFrame(NewFrame); 
              }
              
              /* ======================================================================
              Function: loop
              Purpose : infinite loop main code
              Input   : -
              Output  : - 
              Comments: -
              ====================================================================== */
              void loop()
              {
                static char c;
                static unsigned long previousMillis = 0;
                static uint8_t buttonState = 0;
                static unsigned long lastDebounceTime = 0;  
              
                unsigned long currentMillis = millis();
              
                /*
                // Avons nous recu un ticker de seconde?
                if (tick1sec) {
                  tick1sec = false;
                  uptime++;
                }
                */
                
                // On a reçu un caractère ?
                if ( SERIAL_TIC.available() ) {
                  // Le lire
                  c = SERIAL_TIC.read();
              
                  // Gérer
                  tinfo.process(c);
              
                  
                  // L'affcher dans la console
                  if (c==TINFO_STX) {
                    SERIAL_DEBUG.print("<STX>");
                  } else if (c==TINFO_ETX) {
                    SERIAL_DEBUG.print("<ETX>");
                  } else if (c==TINFO_HT) {
                    SERIAL_DEBUG.print("<TAB>");
                  } else {
                    SERIAL_DEBUG.print(c);
                  }
                  
                }
              
                //SERIAL_DEBUG.println("currentMillis=" + String(currentMillis) + "previousMillis=" + String(previousMillis));
                if (currentMillis - previousMillis > 60000 ) {
                  SERIAL_DEBUG.println("IL FAUT ENREGISTRER UNE MESURE");
                  // save the last time you blinked the LED 
                  previousMillis = currentMillis;   
                  tick1sec = true;
                }
              }
              

              Suite à la proposition de @Nicolas-Bernaerts, j'ai commandé un Denky D4 1.3a mais ne connaissant pas du tout Tasmota, je me heurte à la configuration. Quel test rapide puis-je faire pour vérifier les valeurs récupérées du flux téléinfo ? (A terme, l'idée est de pouvoir injecter les consos de mes 3 phases toutes les minutes à ma base de données mySql (hébergée par AlwaysData)

              Nicolas BernaertsN 1 Reply Last reply Reply Quote
              • Nicolas BernaertsN Offline
                Nicolas Bernaerts @Eric44
                last edited by

                @Eric44
                https://github.com/NicolasBernaerts/tasmota/tree/master/teleinfo

                E 1 Reply Last reply Reply Quote
                • E Offline
                  Eric44 @Nicolas Bernaerts
                  last edited by Eric44

                  @Nicolas-Bernaerts
                  Merci pour la référence et désolé pour la réactivité, je suis encore actuellement plus sur le gros œuvre que sur la domotique 😕
                  J'ai réussi à uploader ton module téléinfo tasmota et m'y connecter. Par contre, il m'affiche l'erreur "TInfo Rx non configuré". En regardant dans les paramètres du module, je n'y vois aucun paramétrage. Peut-être est-ce là qu'il me manque quelque chose ?
                  Merci par avance de ton retour.
                  WhatsApp Image 2025-05-16 at 11.04.02.jpeg
                  WhatsApp Image 2025-05-16 at 11.04.07.jpeg

                  Nicolas BernaertsN 1 Reply Last reply Reply Quote
                  • Nicolas BernaertsN Offline
                    Nicolas Bernaerts @Eric44
                    last edited by

                    @Eric44 si rien n'est configuré c'est normal que cela ne fonctionne pas.
                    Sélectionnez Denky D4 (0) et appliquez. l'ESP devrait rebooter et être configuré.

                    1 Reply Last reply Reply Quote
                    • First post
                      Last post

                    5

                    Online

                    5.7k

                    Users

                    534

                    Topics

                    5.0k

                    Posts

                    Top Topics

                    • Bonjour Nicolas
                      G
                      Gilles15001
                      0
                      15
                      229

                    • Denky 4 - Domoticz - Triphasé -
                      Nicolas BernaertsN
                      Nicolas Bernaerts
                      0
                      7
                      36

                    • Denky D4 et Linky Standard TInfo Rx Non Configuré
                      CharlesC
                      Charles
                      0
                      5
                      92

                    • CC1101 mini shield pour raspberry
                      CharlesC
                      Charles
                      0
                      5
                      133

                    • CC1101
                      CharlesC
                      Charles
                      0
                      2
                      46

                    Popular Tags

                    teleinfo
                    24 topics
                    arduino
                    19 topics
                    remora
                    16 topics
                    esp8266
                    10 topics
                    arduipi
                    10 topics
                    wifinfo
                    7 topics
                    raspberry
                    7 topics
                    broadcast
                    7 topics
                    Copyright © 2022 Charles-Henri Hallard | Return to blog page | Powered by NodeBB