Remplacer on/off auto d'un ballon d'eau chaude

les gen2 il faut l’id pour appeler certain status

Mais ce n’est pas la même façon d’appeler le status … température
http://192.168.x.x/rpc/Switch.GetStatus?id=0
tu devrais avoir les T° en °C et °F du type

{"id":0, "source":"init", "output":true, "apower":1.1, "voltage":232.5, "current":0.000, "aenergy":{"total":543470.125,"by_minute":[3.630,17.113,16.595],"minute_ts":1679154313},"temperature":{"tC":45.6, "tF":114.1}}
{
id: 0,
source: "init",
output: true,
apower: 1.1,
voltage: 232.5,
current: 0,
aenergy: {
total: 543470.125,
by_minute: [
3.63,
17.113,
16.595
],
minute_ts: 1679154313
},
temperature: {
tC: 45.6,
tF: 114.1
}
}

superbe, là, j’ai tout ce que je souhaitais !!!

{"id":0, "source":"WS_in", "output":true, "apower":2340.1, "voltage":233.3, "current":9.840, "aenergy":{"total":3468.031,"by_minute":[36384.289,38801.355,39473.785],"minute_ts":1679155135},"temperature":{"tC":55.5, "tF":131.9}}

merci, je continue a fouiner

Ok
Mais en général l’addon Shelly te remontes tout ce que tu pourrais avoir besoin !

Mais si tu veux vraiment fouiller dans ton Shelly, ils ont implémenté (en interne) un système de script, devrait te faire passer pas mal de temps !
Voir image
puis
image
Clique sur Library pour récupérer quelques exemple !

Exemple pour `consume-limited-power.js`
// Copyright 2021 Allterco Robotics EOOD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Shelly is a Trademark of Allterco Robotics

// Shelly Script example: Shelly Plus 1PM - Stop the output after consuming
// certain amount of power
//
// This script listens for the event when the output is turned on, and starts
// counting the power reported in NotifyStatus every minute It is accumulated in
// a counter and if the combined consumption is over a threshold the output is
// turned off

let startMonitor = false;
let eAccumulator = 0;
let maxEnergy = 120; //threshold, in milliwatthours
Shelly.addEventHandler(function (event, user_data) {
  if (typeof event.info.output !== "undefined") {
    if (event.info.output) {
      startMonitor = true;
      eAccumulator = 0;
    } else {
      startMonitor = false;
    }
  }
}, null);

Shelly.addStatusHandler(function (event, user_data) {
  print(JSON.stringify(event));
  if (typeof event.delta.aenergy !== "undefined") {
    if (startMonitor) {
      eAccumulator = eAccumulator + event.delta.aenergy.by_minute[0];
      if (eAccumulator > maxEnergy) {
        print("Will turn off because of power consumed");
        Shelly.call(
          "switch.set",
          { id: 0, on: false },
          function (result, code, msg, ud) {},
          null
        );
      }
    }
  }
}, null);

merci !!!
j’ai fini par me créer un virtuel alimenté par un scénario qui récupère les données avec (http://192.168.xxx.xxx/rpc/Switch.GetStatus?id=0) qui sera plus précis que le plugin Shelly qui ne remonte pas la température par exemple.
je me suis cassé le nez a essayer par le plugin script, j’ai donc fournis le json a chatgpt qui m’a sorti un code en 2 secondes :wink:

oups, je parle de Jeedom car sous HA tout remonte nickel. Pour le moment, je fais double boulot pour tester et me mettre en route

A titre indicatif, j’ai un Shelly 1PM qui est logé dans le boîtier de raccordement de mon boiler d’ECS électrique.
Il prend donc sa propre température + celle de la chauffe du boiler (il est au pied de la résistance chauffante).
La puissance du boiler est de 2 kW
1PM

Il est installé depuis presque 2 ans et la chauffe du boiler s’opère tous les jours (ou plutôt toutes les nuits).
La t° monte jusque 85°C en début de chauffe.
temp 1PM
@+ Guy