Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Off Topic
    4. Grafana
    5. Label Beschriftung in Grafana mit InfluxDB2 als KW anzeigen

    NEWS

    • Neues Video über Aliase, virtuelle Geräte und Kategorien

    • Wir empfehlen: Node.js 22.x

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    Label Beschriftung in Grafana mit InfluxDB2 als KW anzeigen

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

      Hallo zusmammen,

      wie kann ich mir statt Datum und Uhrzeit nur die KW bei einem Wochnchart für Stromverbrauch anzeigen.

      64887867-8121-4ad3-a64f-eb4076b892eb-image.png

      import "timezone"
      option location = timezone.location(name: "Europe/Berlin")
      
      
      from(bucket: "My_DB")
        |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
        |> filter(fn: (r) => r["_measurement"] == "smartmeter.0.1-0:1_8_0__255.value")
        |> filter(fn: (r) => r["_field"] == "value")
        |> aggregateWindow(every: 1w, fn: last, timeSrc: "_start", createEmpty: false, offset: -3d)
        |> difference(nonNegative: true, columns: ["_value"])
       
        |> map(fn: (r) => ({
              r with 
              kw: string(v: time(v: r._time))
           }))
        |> yield(name: "weekly_mean")
      

      Danke
      Gruß

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

      Support us

      ioBroker
      Community Adapters
      Donate

      763
      Online

      32.1k
      Users

      80.6k
      Topics

      1.3m
      Posts

      1
      1
      45
      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