GRDF: Gazpar_2_MQTT

Solution pour Apexcharts basé sur les statistiques long termes.

type: custom:apexcharts-card
graph_span: 100d
series:
  - entity: AJOUTEZ N'IMPORTE-QUELLE-ENTITÉ-EXISTANTE
    name: current
    color: red
    stroke_width: 1.3
    data_generator: |
      const stat_entity = 'gazpar:VOTRE_LTS_ENTITÉ_consumption_stat';
      var statistics = await hass.callWS({
          type: 'recorder/statistics_during_period',
          start_time: new Date(start).toISOString(),
          end_time: new Date(end).toISOString(),
          statistic_ids: [stat_entity],
          period: "hour",
      });
      var stats = statistics[stat_entity];
      var result = [];
      var len = stats.length;
      for (let i = 0; i < len; i++) {
        let stat = stats[i].state;
        result.push([(new Date(stats[i].end).getTime()),stat]);
        }
      return result;

Bonjour,
vu le nombre important de messages et suivi du sujet. Pour éviter de saturer, l’envoie de mail quand un nouveau message est écrit. Nous passons le sujet en archive.

Un nouveau sujet est ouvert ici: