Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. sendTo getHistory mit aggregate: "count" funktioniert nicht

    NEWS

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    sendTo getHistory mit aggregate: "count" funktioniert nicht

    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      tp1de last edited by

      Hallo,

      ich verwende sendToAsync für getHistory um aggregierte Werte für ein Intervall zu erhalten. Das funktioniert auch gut:

      let result = await sendToAsync(db, "getHistory", {id: id, options: {start: end - intervall, end: end, step:3600000, aggregate: "total"}});
      console.log(JSON.stringify(result.result));
      

      Jetzt möchte ich die Anzahl der Datenpunkte (records) mit aggregate: "count" ermitteln, Das funktioniert leider nicht.

      let count = await sendToAsync(db, "getHistory", {id: id, options: {start: end - intervall, end: end, step:3600000, aggregate: "count"}});
      console.log(JSON.stringify(count.result));
      

      Was mache ich falsch?

      1 Reply Last reply Reply Quote 0
      • First post
        Last post

      Support us

      ioBroker
      Community Adapters
      Donate

      492
      Online

      31.7k
      Users

      79.8k
      Topics

      1.3m
      Posts

      1
      1
      135
      Loading More Posts
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes
      Reply
      • Reply as topic
      Log in to reply
      Community
      Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
      The ioBroker Community 2014-2023
      logo