C’est un plugin développé par Jeedom et je ne sais pas comment faire un PR mais si tu veux j’ai modifié le code pour faire ce que tu veux.
FAIRE UN BACKUP DU FICHIER AVANT
Fichier : plugins/envoy/core/class/envoy.class.php
Modifier les lignes de 96 à 103
Code actuel :
$cmd_net_consumption_pwhToday=cmd::byEqLogicIdAndLogicalId($eqLogic->getId(), 'net_consumption_pwhToday');
if($cmd_net_consumption_pwhToday->execCmd() <> $enphases['consumption'][1]['whToday']){
$cmd_net_consumption_pwhToday->event($enphases['consumption'][1]['whToday']);
}
$cmd_net_consumption_pwhLastSevenDays=cmd::byEqLogicIdAndLogicalId($eqLogic->getId(), 'net_consumption_pwhLastSevenDays');
if($cmd_net_consumption_pwhLastSevenDays->execCmd() <> $enphases['consumption'][1]['whLastSevenDays']){
$cmd_net_consumption_pwhLastSevenDays->event($enphases['consumption'][1]['whLastSevenDays']);
}
Nouveau code :
$cmd_net_consumption_pwhToday=cmd::byEqLogicIdAndLogicalId($eqLogic->getId(), 'net_consumption_pwhToday');
if ($enphases['consumption'][1]['whToday'] == 0) {
$cmd_net_consumption_pwhToday->event($enphases['consumption'][0]['whToday']-$enphases['production'][1]['whToday']);
} else {
if($cmd_net_consumption_pwhToday->execCmd() <> $enphases['consumption'][1]['whToday']){
$cmd_net_consumption_pwhToday->event($enphases['consumption'][1]['whToday']);
}
}
$cmd_net_consumption_pwhLastSevenDays=cmd::byEqLogicIdAndLogicalId($eqLogic->getId(), 'net_consumption_pwhLastSevenDays');
if ($enphases['consumption'][1]['whLastSevenDays'] == 0) {
$cmd_net_consumption_pwhLastSevenDays->event($enphases['consumption'][0]['whLastSevenDays']-$enphases['production'][1]['whLastSevenDays']);
} else {
if($cmd_net_consumption_pwhLastSevenDays->execCmd() <> $enphases['consumption'][1]['whLastSevenDays']){
$cmd_net_consumption_pwhLastSevenDays->event($enphases['consumption'][1]['whLastSevenDays']);
}
}
Cela permettra de faire le calcul et doit correspondre in finé à ce que l’on pourrait retrouver sur enlighten dans la valeur « Import Net »
Impossible d’avoir l’import et l’export
Edit : J’ai modifié les tags pour ne pas parler de bug mais d’amélioration étant donné que l’on ne peut pas vraiment dire que le plugin est buggé vu que l’envoy ne fourni par la valeur