Bonjour,
Il manque les consommations pour le Shelly 4pm pro.
Afin que tout cela fonctionne, j’ai rajouté ceci dans le json de configuration ( et ce pour les 4 sorties )
{
"name": "Conso",
"type": "info",
"subtype": "numeric",
"isVisible": 0,
"isHistorized": 0,
"logicalId": "switch:0.conso"
},
et ceci dans shelly.class.php
public function refreshPlus() {
$status = $this->sendCommand('rpc/Shelly.GetStatus');
if ($status == false) {
$this->checkAndUpdateCmd('online', 0);
return;
} else {
$this->checkAndUpdateCmd('online', 1);
}
$data = json_decode($status,true);
foreach ($data as $key => $value) {
if (strpos($key,'input') !== false) {
$this->checkAndUpdateCmd($key . '.state', $value['state']);
}
if (strpos($key,'switch') !== false) {
$this->checkAndUpdateCmd($key . '.output', $value['output']);
if (isset($value['apower'])) {
$this->checkAndUpdateCmd($key . '.apower', $value['apower']);
}
if (isset($value['voltage'])) {
$this->checkAndUpdateCmd($key . '.voltage', $value['voltage']);
}
if (isset($value['current'])) {
$this->checkAndUpdateCmd($key . '.current', $value['current']);
}
**if (isset($value['aenergy']['total'])) {
$this->checkAndUpdateCmd($key . '.conso', $value['aenergy']['total']);
}**
}
}
}