Note de ce sujet :
  • Moyenne : 0 (0 vote(s))
  • 1
  • 2
  • 3
  • 4
  • 5
Intégration shelly PRO em
#7
J'ai repris mon code, pour reprendre les procédures d'André pour la lecture des JSON.
Plus de bibliothèque à ajouter.
J'ai corrigé également une erreur qui provoquait une un problème sur la seconde sonde.

Remplacer le pavé commenté "//Monophasé" du fichier Source_ShellyEm.ino :

Déclaré au début du document la variable tmp.
//ADD PERSO : AJOUT VARIABLE pour la lecture des infos EM PRO
String tmp;

Code :
//Monophasé

    //***************** ADD PERSO : PRO EM ******************
    ShEm_dataBrute = "<strong>Monophasé</strong><br>" + Shelly_Data;
   
    tmp=PrefiltreJson("em1:"+ String(Voie),":",Shelly_Data);

    //Récupération partie pince sur la voie paramètré
    Pw = ValJson("act_power",tmp);
    voltage = ValJson("voltage",tmp);
    pf = ValJson("pf",tmp);
    pf = abs(pf);
    if (pf > 1) pf = 1;
    if (Voie == voie) {  //voie du routeur
      if (Pw >= 0) {
          PuissanceS_M_inst = Pw;
          PuissanceI_M_inst = 0;
          if (pf > 0.01) {
            PVAS_M_inst = PfloatMax(Pw / pf);
          } else {
            PVAS_M_inst = 0;
          }
          PVAI_M_inst = 0;
        } else {
          PuissanceS_M_inst = 0;
          PuissanceI_M_inst = -Pw;
          if (pf > 0.01) {
            PVAI_M_inst = PfloatMax(-Pw / pf);
          } else {
            PVAI_M_inst = 0;
          }
          PVAS_M_inst = 0;
        }
        tmp=PrefiltreJson("em1data:"+ String(Voie),":",Shelly_Data);
        Energie_M_Soutiree = myLongJson("total_act_energy",tmp);
        Energie_M_Injectee = myLongJson("total_act_ret_energy",tmp);
        PowerFactor_M = pf;
        Tension_M = voltage;
        Pva_valide=true;
      } else {  // voie secondaire
        if (LissageLong) {
          PwMoy2 = 0.2 * Pw + 0.8 * PwMoy2;  //Lissage car moins de mesure sur voie secondaire
          pfMoy2 = 0.2 * pf + 0.8 * pfMoy2;
          Pw = PwMoy2;
          pf = pfMoy2;
        }
        if (Pw >= 0) {
          PuissanceS_T_inst = Pw;
          PuissanceI_T_inst = 0;
          if (pf > 0.01) {
            PVAS_T_inst = PfloatMax(Pw / pf);
          } else {
            PVAS_T_inst = 0;
          }
          PVAI_T_inst = 0;
        } else {
          PuissanceS_T_inst = 0;
          PuissanceI_T_inst = -Pw;
          if (pf > 0.01) {
            PVAI_T_inst = PfloatMax(-Pw / pf);
          } else {
            PVAI_T_inst = 0;
          }
          PVAS_T_inst = 0;
        }
        tmp=PrefiltreJson("em1data:"+ String(Voie),":",Shelly_Data);
        Energie_T_Soutiree = myLongJson("total_act_energy",tmp);
        Energie_T_Injectee = myLongJson("total_act_ret_energy",tmp);
        PowerFactor_T = pf;
        Tension_T = voltage;
      }
Répondre


Messages dans ce sujet
Intégration shelly PRO em - par Raphael591 - 12-06-2024, 05:49 PM
RE: Intégration shelly PRO em - par F1ATB - 12-06-2024, 07:10 PM
RE: Intégration shelly PRO em - par Raphael591 - 12-06-2024, 07:16 PM
RE: Intégration shelly PRO em - par F1ATB - 12-06-2024, 07:18 PM
RE: Intégration shelly PRO em - par Raphael591 - 12-06-2024, 07:53 PM
RE: Intégration shelly PRO em - par DanielJ - 17-06-2024, 04:00 PM
RE: Intégration shelly PRO em - par Raphael591 - 23-06-2024, 03:33 PM
RE: Intégration shelly PRO em - par F1ATB - 23-06-2024, 04:31 PM
RE: Intégration shelly PRO em - par DanielJ - 26-06-2024, 12:36 PM
RE: Intégration shelly PRO em - par Raphael591 - 26-06-2024, 02:31 PM
RE: Intégration shelly PRO em - par F1ATB - 03-07-2024, 04:23 PM
RE: Intégration shelly PRO em - par DanielJ - 03-07-2024, 06:56 PM
RE: Intégration shelly PRO em - par Raphael591 - 03-07-2024, 10:01 PM
RE: Intégration shelly PRO em - par F1ATB - 04-07-2024, 08:31 AM
RE: Intégration shelly PRO em - par Raphael591 - 04-07-2024, 09:49 AM

Atteindre :


Utilisateur(s) parcourant ce sujet : 4 visiteur(s)