add new parameters CCANS and CCAIN
This commit is contained in:
parent
431afd8295
commit
e5a7dcd51c
9
tic.cpp
9
tic.cpp
@ -156,14 +156,15 @@ static void processTrame(String &data) {
|
|||||||
}
|
}
|
||||||
// If a match is found, update the corresponding TicValues entry if the group confirms the checksum
|
// If a match is found, update the corresponding TicValues entry if the group confirms the checksum
|
||||||
if (t < NB_ETIQUETTE) {
|
if (t < NB_ETIQUETTE) {
|
||||||
//If there is a value update....
|
//If there is a value update or an horodate change, the value is identified as "updated"
|
||||||
if (TicValues[t].value.compareTo(gd.value) != 0 || TicValues[t].horodate.compareTo(gd.horodate) != 0) {
|
if (TicValues[t].value.compareTo(gd.value) != 0 || TicValues[t].horodate.compareTo(gd.horodate) != 0) {
|
||||||
//There is some noise on instantaneous value, filter
|
//There is some noise on instantaneous values, make a basic filter. Also helps to reduce MQTT load
|
||||||
if (SelectedEtiquette[t] == "SINSTS" || SelectedEtiquette[t] == "SINSTS1" || SelectedEtiquette[t] == "SINSTS2" || SelectedEtiquette[t] == "SINSTS3") {
|
if (SelectedEtiquette[t] == "SINSTS" || SelectedEtiquette[t] == "SINSTS1" || SelectedEtiquette[t] == "SINSTS2" || SelectedEtiquette[t] == "SINSTS3" | SelectedEtiquette[t] == "SINSTI") {
|
||||||
int oldval = TicValues[t].value.toInt();
|
int oldval = TicValues[t].value.toInt();
|
||||||
int newcal = (gd.value.toInt() + oldval) / 2;
|
int newcal = (gd.value.toInt() + oldval) / 2;
|
||||||
//there is a significant change, so update
|
//there is a significant change, so update
|
||||||
if (newcal < oldval * 0.92 || newcal > oldval * 1.02) {
|
//consider a change if delta is > 2%
|
||||||
|
if (newcal < oldval * 0.98 || newcal > oldval * 1.02) {
|
||||||
gd.updated = true;
|
gd.updated = true;
|
||||||
TicValues[t] = gd;
|
TicValues[t] = gd;
|
||||||
} else {
|
} else {
|
||||||
|
8
tic.h
8
tic.h
@ -113,9 +113,9 @@ union RegistreStatus {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const static String SelectedEtiquette[NB_ETIQUETTE] = {
|
const static String SelectedEtiquette[NB_ETIQUETTE] = {
|
||||||
"ADSC", // Adresse du compteur
|
//"ADSC", // Adresse du compteur
|
||||||
//"DATE", // Date et heure courantes
|
//"DATE", // Date et heure courantes
|
||||||
"NGTF", // Numéro de gestionnaire de réseau de transport
|
//"NGTF", // Numéro de gestionnaire de réseau de transport
|
||||||
"LTARF", // Libellé du tarif en cours
|
"LTARF", // Libellé du tarif en cours
|
||||||
"EAST", // Énergie active soutirée totale
|
"EAST", // Énergie active soutirée totale
|
||||||
"EASF01", "EASF02", "EASF03", "EASF04", // Énergie active soutirée par période tarifaire
|
"EASF01", "EASF02", "EASF03", "EASF04", // Énergie active soutirée par période tarifaire
|
||||||
@ -135,7 +135,8 @@ const static String SelectedEtiquette[NB_ETIQUETTE] = {
|
|||||||
"MSG1", "MSG2", // Messages d'information
|
"MSG1", "MSG2", // Messages d'information
|
||||||
"PPOINTE", // Préavis de pointe mobile
|
"PPOINTE", // Préavis de pointe mobile
|
||||||
"SMAXSN", "SMAXSN1", "SMAXSN2", "SMAXSN3", //Puissance app max soutiree
|
"SMAXSN", "SMAXSN1", "SMAXSN2", "SMAXSN3", //Puissance app max soutiree
|
||||||
"SMAXIN" //Puissance app max injectée
|
"SMAXIN", //Puissance app max injectée
|
||||||
|
"CCASN", "CCAIN" // point de la courbe de charge soustirée / injectée
|
||||||
};
|
};
|
||||||
|
|
||||||
// Tableau pour stocker les valeurs des groupes TIC identifiés
|
// Tableau pour stocker les valeurs des groupes TIC identifiés
|
||||||
@ -166,6 +167,7 @@ const static String kPointeMobile[4] = { "no", "PM1", "PM2", "PM3" };
|
|||||||
void readTicPort();
|
void readTicPort();
|
||||||
String ticValuesAsJson();
|
String ticValuesAsJson();
|
||||||
String ticBasicValuesAsJson();
|
String ticBasicValuesAsJson();
|
||||||
|
// Prototypes des fonctions pour envoyer les infos MQTT
|
||||||
void mqttPublish(PubSubClient *mqttclient);
|
void mqttPublish(PubSubClient *mqttclient);
|
||||||
void mqttForcePublish(PubSubClient *mqttclient);
|
void mqttForcePublish(PubSubClient *mqttclient);
|
||||||
#endif
|
#endif
|
Loading…
Reference in New Issue
Block a user