User Tools

Site Tools


homeautomatisation:influxdb:examples_influxdb

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
homeautomatisation:influxdb:examples_influxdb [2022/03/10 22:51] illuhomeautomatisation:influxdb:examples_influxdb [2022/03/11 22:24] (current) illu
Line 1: Line 1:
 +
 +====== Last value for snapshot ======
 +
 get only the last value from iobroker shelly power, if its none in range, fill with previous value. get only the last value from iobroker shelly power, if its none in range, fill with previous value.
-<code sql>+<code>
 from(bucket: "iobroker") from(bucket: "iobroker")
   |> range(start:0)   |> range(start:0)
Line 12: Line 15:
  
 {{:homeautomatisation:influxdb:grafana_last_watt.jpg?400|}} {{:homeautomatisation:influxdb:grafana_last_watt.jpg?400|}}
 +
 +
 +====== Integral for Watt hours / from W to Wh ======
 +
 +<code>
 +from(bucket: "iobroker")
 +  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
 +  |> filter(fn: (r) => r["_measurement"] == "0_userdata.0.Wattzähler.Arbeitszimmer.Watt_Aktuell")
 +  |> filter(fn: (r) => r["_field"] == "value")
 +  |> integral(unit:1h)
 +</code>
 +
 +{{:homeautomatisation:influxdb:grafana_watth.jpg?400|}}
 +  
homeautomatisation/influxdb/examples_influxdb.1646949081.txt.gz · Last modified: 2022/03/10 22:51 by illu