-
Notifications
You must be signed in to change notification settings - Fork 158
/
Copy pathinfluxdata_weather_station.yml
626 lines (620 loc) · 19.8 KB
/
influxdata_weather_station.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
apiVersion: influxdata.com/v2alpha1
kind: Label
metadata:
name: amusing-mendel-c76001
spec:
color: '#BF3D5E'
name: Influxdata
---
apiVersion: influxdata.com/v2alpha1
kind: Label
metadata:
name: earning-turing-c76003
spec:
color: '#be2ee4'
name: IoT
---
apiVersion: influxdata.com/v2alpha1
kind: Variable
metadata:
name: exciting-mendel-076001
spec:
associations:
- kind: Label
name: amusing-mendel-c76001
- kind: Label
name: earning-turing-c76003
language: flux
name: bucket
query: |-
buckets()
|> filter(fn: (r) => r.name !~ /^_/)
|> rename(columns: {name: "_value"})
|> keep(columns: ["_value"])
type: query
---
apiVersion: influxdata.com/v2alpha1
kind: Variable
metadata:
name: stubborn-dewdney-076007
spec:
associations:
- kind: Label
name: amusing-mendel-c76001
- kind: Label
name: earning-turing-c76003
language: flux
name: weatherStation
query: |-
import "influxdata/influxdb/v1"
v1.tagValues(
bucket: v.bucket,
tag: "clientId",
predicate: (r) => true,
)
selected:
- virtual_device
type: query
---
apiVersion: influxdata.com/v2alpha1
kind: Dashboard
metadata:
name: victorious-wilson-c76001
spec:
associations:
- kind: Label
name: amusing-mendel-c76001
- kind: Label
name: earning-turing-c76003
charts:
- colors:
- hex: '#4591ED'
id: "0"
name: ocean
type: min
value: 10
- hex: '#32B08C'
id: 9n37j1onaK5AeiB5UBr2r
name: viridian
type: threshold
value: 20
- hex: '#FFB94A'
id: YnrvMstwOQGOj6MI80Mie
name: pineapple
type: threshold
value: 24
- hex: '#F95F53'
id: "1"
name: curacao
type: max
value: 30
decimalPlaces: 1
height: 3
kind: Gauge
name: Current Temperature
queries:
- query: |-
from(bucket: v.bucket)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "environment")
|> filter(fn: (r) => r["_field"] == "Temperature")
|> filter(fn: (r) => r["clientId"] == v.weatherStation)
|> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)
|> yield(name: "last")
staticLegend: {}
suffix: ' °C'
tickSuffix: ' °C'
width: 3
- colors:
- hex: '#00C9FF'
id: base
name: laser
type: text
decimalPlaces: 0
height: 2
kind: Single_Stat
name: Uptime
queries:
- query: |-
import "math"
import "date"
from(bucket: v.bucket)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "device_status")
|> filter(fn: (r) => r["clientId"] == v.weatherStation)
|> filter(fn: (r) => r["_field"] == "uptime")
|> last()
|> map(fn: (r) => ({ r with _value: math.round(x: r._value / 3600.) * 3600. * 1000000000. }))
|> toUInt()
|> map(fn:(r) => ({ r with _value: if r._value != 0 then string(v: duration(v: r._value)) else "0hr" }))
staticLegend: {}
width: 1
yPos: 3
- colors:
- hex: '#00C9FF'
id: base
name: laser
type: text
decimalPlaces: 2
height: 1
kind: Single_Stat
name: Last Reset Reason
queries:
- query: "from(bucket: v.bucket)\n |> range(start: v.timeRangeStart, stop:
v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"device_status\")\n
\ |> filter(fn: (r) => r[\"reset_reason\"] != \"\")\n |> filter(fn:
(r) => r[\"clientId\"] == v.weatherStation)\n |> group()\n |> last()
\n |> keep(columns: [\"reset_reason\"])"
staticLegend: {}
width: 3
yPos: 5
- axes:
- base: "10"
name: x
scale: linear
- base: "10"
name: "y"
scale: linear
colorMapping:
WS-ESP8266-SHTC3-Prague,CZ-SHTC3-C-1.10-Bonitoo-ng-Temperature-environment-WS-E8DB84AD4497-temperature-: '#007C76'
colors:
- hex: '#DA6FF1'
id: EFmzeV_WxvD0Mblh2EbRy
name: Ectoplasm
type: scale
- hex: '#00717A'
id: LHTrE1tzHjmS66bbsqDqm
name: Ectoplasm
type: scale
- hex: '#ACFF76'
id: EWNkJeep7De69XLvYuujQ
name: Ectoplasm
type: scale
geom: monotoneX
height: 3
heightRatio: 0.2
hoverDimension: auto
kind: Xy
legendColorizeRows: true
legendOpacity: 1
legendOrientationThreshold: 1e+08
name: Temperature
position: overlaid
queries:
- query: |-
all = from(bucket: v.bucket)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "environment")
|> filter(fn: (r) => r["clientId"] == v.weatherStation)
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
t = all
|> filter(fn: (r) => r["_field"] == "Temperature")
|> yield(name: "temperature")
staticLegend:
heightRatio: 0.2
widthRatio: 1
width: 6
widthRatio: 1
xCol: _time
yCol: _value
yPos: 6
- axes:
- base: "10"
name: x
scale: linear
- base: "10"
name: "y"
scale: linear
colorMapping:
WS-ESP8266-SHTC3-Prague,CZ-SHTC3-C-1.10-Bonitoo-ng-Humidity-environment-WS-E8DB84AD4497-humidity-: '#FDC44F'
colors:
- hex: '#DA6FF1'
id: EFmzeV_WxvD0Mblh2EbRy
name: Ectoplasm
type: scale
- hex: '#00717A'
id: LHTrE1tzHjmS66bbsqDqm
name: Ectoplasm
type: scale
- hex: '#ACFF76'
id: EWNkJeep7De69XLvYuujQ
name: Ectoplasm
type: scale
geom: monotoneX
height: 3
heightRatio: 0.2
hoverDimension: auto
kind: Xy
legendColorizeRows: true
legendOpacity: 1
legendOrientationThreshold: 1e+08
name: Humidity
position: overlaid
queries:
- query: |-
all = from(bucket: v.bucket)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "environment")
|> filter(fn: (r) => r["clientId"] == v.weatherStation)
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
rh = all
|> filter(fn: (r) => r["_field"] == "Humidity")
|> yield(name: "humidity")
staticLegend:
heightRatio: 0.2
widthRatio: 1
width: 6
widthRatio: 1
xCol: _time
yCol: _value
yPos: 9
- axes:
- base: "10"
name: x
scale: linear
- base: "10"
name: "y"
scale: linear
colorMapping:
WS-ESP8266-Prague,CZ-1.10-Bonitoo-ng-heap_fragmentation-device_status-WS-E8DB84AD4497-mem-: '#DA6FF1'
colors:
- hex: '#DA6FF1'
id: EFmzeV_WxvD0Mblh2EbRy
name: Ectoplasm
type: scale
- hex: '#00717A'
id: LHTrE1tzHjmS66bbsqDqm
name: Ectoplasm
type: scale
- hex: '#ACFF76'
id: EWNkJeep7De69XLvYuujQ
name: Ectoplasm
type: scale
geom: monotoneX
height: 3
heightRatio: 0.2
hoverDimension: auto
kind: Xy
legendColorizeRows: true
legendOpacity: 1
legendOrientationThreshold: 1e+08
name: Heap Fragmentation
position: overlaid
queries:
- query: |-
all = from(bucket: v.bucket)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "device_status")
|> filter(fn: (r) => r["clientId"] == v.weatherStation)
mem = all
|> filter(fn: (r) => r["_field"] == "heap_fragmentation")
|> filter(fn: (r) => not exists r["reset_reason"])
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
|> yield(name: "mem")
staticLegend:
heightRatio: 0.2
widthRatio: 1
width: 6
widthRatio: 1
xCol: _time
yCol: _value
yPos: 12
- colors:
- hex: '#00C9FF'
id: base
name: laser
type: text
decimalPlaces: 0
height: 2
kind: Single_Stat
name: Device Resets
queries:
- query: "from(bucket: v.bucket)\n |> range(start: v.timeRangeStart, stop:
v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"device_status\")\n
\ |> filter(fn: (r) => r[\"reset_reason\"] != \"\")\n |> filter(fn:
(r) => r[\"clientId\"] == v.weatherStation)\n |> drop(columns: [\"_measurement\",\"_start\",\"_stop\",
\"Device\", \"Location\",\"clientId\"]) \n |> pivot(rowKey:[\"_time\"],
columnKey: [\"_field\"], valueColumn: \"_value\")\n |> group()\n
\ |> count(column: \"reset_reason\")"
staticLegend: {}
suffix: x
width: 1
xPos: 1
yPos: 3
- colors:
- hex: '#00C9FF'
id: base
name: laser
type: text
decimalPlaces: 0
height: 2
kind: Single_Stat
name: WiFi Disconnects
queries:
- query: |-
from(bucket: v.bucket)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "device_status")
|> filter(fn: (r) => r["_field"] == "wifi_disconnects")
|> filter(fn: (r) => r["clientId"] == v.weatherStation)
|> filter(fn: (r) => not exists r["reset_reason"])
|> sum(column: "_value")
staticLegend: {}
suffix: x
width: 1
xPos: 2
yPos: 3
- colors:
- hex: '#FFB94A'
id: "0"
name: pineapple
type: min
- hex: '#32B08C'
id: fGQj5on3GcEZ5KWvBJnAn
name: viridian
type: threshold
value: 30
- hex: '#FFB94A'
id: p6FU_TM4oYcsJghawmMNO
name: pineapple
type: threshold
value: 60
- hex: '#DC4E58'
id: YR-ZRW3rK2j1qbkAZy4ow
name: fire
type: threshold
value: 80
- hex: '#9394FF'
id: "1"
name: comet
type: max
value: 100
decimalPlaces: 1
height: 3
kind: Gauge
name: Current Humidity
queries:
- query: |-
from(bucket: v.bucket)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "environment")
|> filter(fn: (r) => r["_field"] == "Humidity")
|> filter(fn: (r) => r["clientId"] == v.weatherStation)
|> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)
|> yield(name: "last")
staticLegend: {}
suffix: ' %'
tickSuffix: ' %'
width: 3
xPos: 3
- colors:
- hex: '#BF3D5E'
id: "0"
name: ruby
type: min
- hex: '#32B08C'
id: "1"
name: viridian
type: max
value: 100
decimalPlaces: 0
height: 3
kind: Gauge
name: Free Memory
queries:
- query: |-
max = 52472.
free = from(bucket: v.bucket)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "device_status")
|> filter(fn: (r) => r["clientId"] == v.weatherStation)
|> filter(fn: (r) => not exists r["reset_reason"])
|> filter(fn: (r) => r["_field"] == "free_heap")
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
|> map(fn: (r) => ({ r with _value: r._value / max * 100.}))
|> yield(name: "free")
staticLegend: {}
suffix: ' %'
tickSuffix: ' %'
width: 3
xPos: 3
yPos: 3
- colors:
- hex: '#4591ED'
id: base
name: ocean
type: background
fieldOptions:
- displayName: Device
fieldName: Device
visible: true
- displayName: HumiditySensor
fieldName: HumiditySensor
visible: true
- displayName: TemperatureSensor
fieldName: TemperatureSensor
visible: true
- displayName: Version
fieldName: Version
visible: true
- displayName: WiFi
fieldName: WiFi
visible: true
height: 2
kind: Table
name: Device Info
queries:
- query: |-
from(bucket: v.bucket)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "environment")
|> filter(fn: (r) => r["_field"] == "Temperature")
|> filter(fn: (r) => r["clientId"] == v.weatherStation)
|> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)
|> last()
|> keep(columns: ["Device", "HumiditySensor", "TemperatureSensor", "Version", "WiFi"])
|> yield(name: "last")
staticLegend: {}
tableOptions:
verticalTimeAxis: true
timeFormat: YYYY-MM-DD HH:mm:ss
width: 6
xPos: 6
- allowPanAndZoom: true
geoLayers:
- colorDimension:
label: Value
name: color
colorField: _value
intensityDimension:
name: intensity
layerType: pointMap
radiusDimension:
name: radius
viewColors:
- hex: '#7A65F2'
id: "0"
name: star
type: min
- hex: '#7A65F2'
id: "1"
name: star
type: text
value: 50
- hex: '#7A65F2'
id: "2"
name: star
type: max
value: 100
height: 7
kind: Geo
latLonColumns:
lat:
column: Lat
key: field
lon:
column: Lon
key: field
name: IP Geo Location
queries:
- query: |-
from(bucket: v.bucket)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "environment")
|> filter(fn: (r) => r["_field"] == "Lat" or r["_field"] == "Lon")
|> filter(fn: (r) => r["clientId"] == v.weatherStation )
|> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)
|> last()
s2Column: Location
staticLegend: {}
width: 6
xPos: 6
yPos: 2
zoom: 6
- axes:
- base: "10"
name: x
scale: linear
- base: "10"
name: "y"
scale: linear
colorMapping:
WS-ESP8266-Prague,CZ-1.10-Bonitoo-ng-free_heap-device_status-WS-E8DB84AD4497-mem-: '#DA6FF1'
colors:
- hex: '#DA6FF1'
id: EFmzeV_WxvD0Mblh2EbRy
name: Ectoplasm
type: scale
- hex: '#00717A'
id: LHTrE1tzHjmS66bbsqDqm
name: Ectoplasm
type: scale
- hex: '#ACFF76'
id: EWNkJeep7De69XLvYuujQ
name: Ectoplasm
type: scale
geom: monotoneX
height: 3
heightRatio: 0.2
hoverDimension: auto
kind: Xy
legendColorizeRows: true
legendOpacity: 1
legendOrientationThreshold: 1e+08
name: Free Memory
position: overlaid
queries:
- query: |-
all = from(bucket: v.bucket)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "device_status")
|> filter(fn: (r) => r["clientId"] == v.weatherStation)
mem = all
|> filter(fn: (r) => r["_field"] == "free_heap")
|> filter(fn: (r) => not exists r["reset_reason"])
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
|> yield(name: "mem")
staticLegend:
heightRatio: 0.2
widthRatio: 1
width: 6
widthRatio: 1
xCol: _time
xPos: 6
yCol: _value
yPos: 9
- axes:
- base: "10"
name: x
scale: linear
- base: "10"
name: "y"
scale: linear
colorMapping:
WS-ESP8266-Prague,CZ-1.10-Bonitoo-ng-max_alloc_heap-device_status-WS-E8DB84AD4497-mem-: '#DA6FF1'
colors:
- hex: '#DA6FF1'
id: EFmzeV_WxvD0Mblh2EbRy
name: Ectoplasm
type: scale
- hex: '#00717A'
id: LHTrE1tzHjmS66bbsqDqm
name: Ectoplasm
type: scale
- hex: '#ACFF76'
id: EWNkJeep7De69XLvYuujQ
name: Ectoplasm
type: scale
geom: monotoneX
height: 3
heightRatio: 0.2
hoverDimension: auto
kind: Xy
legendColorizeRows: true
legendOpacity: 1
legendOrientationThreshold: 1e+08
name: Max Memory Allocation
position: overlaid
queries:
- query: |-
all = from(bucket: v.bucket)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "device_status")
|> filter(fn: (r) => r["clientId"] == v.weatherStation)
mem = all
|> filter(fn: (r) => r["_field"] == "max_alloc_heap")
|> filter(fn: (r) => not exists r["reset_reason"])
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
|> yield(name: "mem")
staticLegend:
heightRatio: 0.2
widthRatio: 1
width: 6
widthRatio: 1
xCol: _time
xPos: 6
yCol: _value
yPos: 12
description: Weather station is a smart IoT device that shows various information
on the embedded OLED display. Created for Influxdata company by Bonitoo.io
name: Influxdata Weather Station