forked from influxdata/community-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
868 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,263 @@ | ||
apiVersion: influxdata.com/v2alpha1 | ||
kind: Label | ||
metadata: | ||
name: tender-booth-bd5001 | ||
spec: | ||
color: '#be2ee4' | ||
name: IoT | ||
--- | ||
apiVersion: influxdata.com/v2alpha1 | ||
kind: Bucket | ||
metadata: | ||
name: inspiring-tesla-bd5001 | ||
spec: | ||
name: iot_center | ||
retentionRules: | ||
- everySeconds: 2.592e+06 | ||
type: expire | ||
--- | ||
apiVersion: influxdata.com/v2alpha1 | ||
kind: Variable | ||
metadata: | ||
name: suspicious-mahavira-fd5001 | ||
spec: | ||
language: flux | ||
name: IoT_Device | ||
query: "import \"influxdata/influxdb/v1\"\r\nv1.tagValues(bucket: \"iot_center\", | ||
tag: \"clientId\")" | ||
type: query | ||
--- | ||
apiVersion: influxdata.com/v2alpha1 | ||
kind: Dashboard | ||
metadata: | ||
name: elated-wescoff-7d5001 | ||
spec: | ||
charts: | ||
- colors: | ||
- hex: '#00C9FF' | ||
id: "0" | ||
name: laser | ||
type: min | ||
value: -30 | ||
- hex: '#BF3D5E' | ||
id: "1" | ||
name: ruby | ||
type: max | ||
value: 60 | ||
decimalPlaces: 2 | ||
height: 5 | ||
kind: Gauge | ||
name: Actual Temperature | ||
queries: | ||
- query: "from(bucket: \"iot_center\")\n |> range(start: v.timeRangeStart, | ||
stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] | ||
== \"environment\")\n |> filter(fn: (r) => r[\"_field\"] == \"Temperature\")\n | ||
\ |> filter(fn: (r) => r[\"clientId\"] == v.IoT_Device) \n |> aggregateWindow(every: | ||
v.windowPeriod, fn: last, createEmpty: false)\n |> yield(name: \"last\")" | ||
suffix: ' °C' | ||
width: 5 | ||
- axes: | ||
- base: "10" | ||
name: x | ||
scale: linear | ||
- base: "10" | ||
label: Temperature °C | ||
name: y | ||
scale: linear | ||
colors: | ||
- hex: '#31C0F6' | ||
id: 024cd205-6cf6-4aa2-b6da-d8d052bb1f9b | ||
name: Nineteen Eighty Four | ||
type: scale | ||
- hex: '#A500A5' | ||
id: c5472a5f-6349-40a2-9374-d7eaca9864e8 | ||
name: Nineteen Eighty Four | ||
type: scale | ||
- hex: '#FF7E27' | ||
id: 355ddac5-4625-49f7-aa78-00202e3e51c4 | ||
name: Nineteen Eighty Four | ||
type: scale | ||
geom: line | ||
height: 4 | ||
kind: Xy | ||
name: Temperature | ||
position: overlaid | ||
queries: | ||
- query: "from(bucket: \"iot_center\")\n |> range(start: v.timeRangeStart, | ||
stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] | ||
== \"environment\")\n |> filter(fn: (r) => r[\"_field\"] == \"Temperature\")\n | ||
\ |> filter(fn: (r) => r[\"clientId\"] == v.IoT_Device) \n |> aggregateWindow(every: | ||
v.windowPeriod, fn: mean, createEmpty: false)\n |> yield(name: \"mean\")" | ||
shade: true | ||
width: 12 | ||
xCol: _time | ||
yCol: _value | ||
yPos: 5 | ||
- axes: | ||
- base: "10" | ||
name: x | ||
scale: linear | ||
- base: "10" | ||
label: Humidity % | ||
name: y | ||
scale: linear | ||
colors: | ||
- hex: '#31C0F6' | ||
id: 024cd205-6cf6-4aa2-b6da-d8d052bb1f9b | ||
name: Nineteen Eighty Four | ||
type: scale | ||
- hex: '#A500A5' | ||
id: c5472a5f-6349-40a2-9374-d7eaca9864e8 | ||
name: Nineteen Eighty Four | ||
type: scale | ||
- hex: '#FF7E27' | ||
id: 355ddac5-4625-49f7-aa78-00202e3e51c4 | ||
name: Nineteen Eighty Four | ||
type: scale | ||
geom: line | ||
height: 4 | ||
kind: Xy | ||
name: Humidity | ||
position: overlaid | ||
queries: | ||
- query: "from(bucket: \"iot_center\")\n |> range(start: v.timeRangeStart, | ||
stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] | ||
== \"environment\")\n |> filter(fn: (r) => r[\"_field\"] == \"Humidity\")\n | ||
\ |> filter(fn: (r) => r[\"clientId\"] == v.IoT_Device) \n |> aggregateWindow(every: | ||
v.windowPeriod, fn: mean, createEmpty: false)\n |> yield(name: \"mean\")" | ||
width: 12 | ||
xCol: _time | ||
yCol: _value | ||
yPos: 9 | ||
- axes: | ||
- base: "10" | ||
name: x | ||
scale: linear | ||
- base: "10" | ||
label: Pressure hPa | ||
name: y | ||
scale: linear | ||
colors: | ||
- hex: '#31C0F6' | ||
id: 024cd205-6cf6-4aa2-b6da-d8d052bb1f9b | ||
name: Nineteen Eighty Four | ||
type: scale | ||
- hex: '#A500A5' | ||
id: c5472a5f-6349-40a2-9374-d7eaca9864e8 | ||
name: Nineteen Eighty Four | ||
type: scale | ||
- hex: '#FF7E27' | ||
id: 355ddac5-4625-49f7-aa78-00202e3e51c4 | ||
name: Nineteen Eighty Four | ||
type: scale | ||
geom: line | ||
height: 4 | ||
kind: Xy | ||
name: Pressure | ||
position: overlaid | ||
queries: | ||
- query: "from(bucket: \"iot_center\")\n |> range(start: v.timeRangeStart, | ||
stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] | ||
== \"environment\")\n |> filter(fn: (r) => r[\"_field\"] == \"Pressure\")\n | ||
\ |> filter(fn: (r) => r[\"clientId\"] == v.IoT_Device) \n |> aggregateWindow(every: | ||
v.windowPeriod, fn: mean, createEmpty: false)\n |> yield(name: \"mean\")" | ||
width: 12 | ||
xCol: _time | ||
yCol: _value | ||
yPos: 13 | ||
- axes: | ||
- base: "10" | ||
name: x | ||
scale: linear | ||
- base: "10" | ||
label: CO2 ppm | ||
name: y | ||
scale: linear | ||
colors: | ||
- hex: '#31C0F6' | ||
id: 024cd205-6cf6-4aa2-b6da-d8d052bb1f9b | ||
name: Nineteen Eighty Four | ||
type: scale | ||
- hex: '#A500A5' | ||
id: c5472a5f-6349-40a2-9374-d7eaca9864e8 | ||
name: Nineteen Eighty Four | ||
type: scale | ||
- hex: '#FF7E27' | ||
id: 355ddac5-4625-49f7-aa78-00202e3e51c4 | ||
name: Nineteen Eighty Four | ||
type: scale | ||
geom: line | ||
height: 4 | ||
kind: Xy | ||
name: CO2 | ||
position: overlaid | ||
queries: | ||
- query: "from(bucket: \"iot_center\")\n |> range(start: v.timeRangeStart, | ||
stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] | ||
== \"environment\")\n |> filter(fn: (r) => r[\"_field\"] == \"CO2\")\n | ||
\ |> filter(fn: (r) => r[\"clientId\"] == v.IoT_Device) \n |> aggregateWindow(every: | ||
v.windowPeriod, fn: mean, createEmpty: false)\n |> yield(name: \"mean\")" | ||
width: 12 | ||
xCol: _time | ||
yCol: _value | ||
yPos: 17 | ||
- axes: | ||
- base: "10" | ||
name: x | ||
scale: linear | ||
- base: "10" | ||
label: TVOC ppb | ||
name: y | ||
scale: linear | ||
colors: | ||
- hex: '#31C0F6' | ||
id: 024cd205-6cf6-4aa2-b6da-d8d052bb1f9b | ||
name: Nineteen Eighty Four | ||
type: scale | ||
- hex: '#A500A5' | ||
id: c5472a5f-6349-40a2-9374-d7eaca9864e8 | ||
name: Nineteen Eighty Four | ||
type: scale | ||
- hex: '#FF7E27' | ||
id: 355ddac5-4625-49f7-aa78-00202e3e51c4 | ||
name: Nineteen Eighty Four | ||
type: scale | ||
geom: line | ||
height: 4 | ||
kind: Xy | ||
name: TVOC | ||
position: overlaid | ||
queries: | ||
- query: "from(bucket: \"iot_center\")\n |> range(start: v.timeRangeStart, | ||
stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] | ||
== \"environment\")\n |> filter(fn: (r) => r[\"_field\"] == \"TVOC\")\n | ||
\ |> filter(fn: (r) => r[\"clientId\"] == v.IoT_Device) \n |> aggregateWindow(every: | ||
v.windowPeriod, fn: mean, createEmpty: false)\n |> yield(name: \"mean\")" | ||
width: 12 | ||
xCol: _time | ||
yCol: _value | ||
yPos: 21 | ||
- colors: | ||
- hex: '#00C9FF' | ||
id: "0" | ||
name: laser | ||
type: min | ||
- hex: '#BF3D5E' | ||
id: "1" | ||
name: ruby | ||
type: max | ||
value: 100 | ||
decimalPlaces: 2 | ||
height: 5 | ||
kind: Gauge | ||
name: Actual Humidity | ||
queries: | ||
- query: "from(bucket: \"iot_center\")\n |> range(start: v.timeRangeStart, | ||
stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] | ||
== \"environment\")\n |> filter(fn: (r) => r[\"_field\"] == \"Humidity\")\n | ||
\ |> filter(fn: (r) => r[\"clientId\"] == v.IoT_Device) \n |> aggregateWindow(every: | ||
v.windowPeriod, fn: last, createEmpty: false)\n |> yield(name: \"last\")" | ||
suffix: ' %' | ||
width: 5 | ||
xPos: 5 | ||
name: IoT Center |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# IoT Center Template | ||
|
||
Provided by: [bonitoo.io](.) | ||
|
||
This template provides a dashboard for [IoT Center](https://github.com/bonitoo-io/iot-center-v2) dev demo application. | ||
|
||
### Dashboard example | ||
|
||
![Screenshot](iot_center_dashboard.png) | ||
|
||
### Quick Install | ||
|
||
#### InfluxDB UI | ||
|
||
In the InfluxDB UI, go to Settings->Templates and enter this URL: https://github.com/influxdata/community-templates/tree/master/iot_center/iot_center.yml | ||
|
||
#### Influx CLI | ||
If you have your InfluxDB credentials [configured in the CLI](https://v2.docs.influxdata.com/v2.0/reference/cli/influx/config/), you can install this template with: | ||
|
||
``` | ||
influx apply https://github.com/influxdata/community-templates/tree/master/iot_center/iot_center.yml | ||
``` | ||
|
||
## Included Resources | ||
|
||
This template includes the following: | ||
|
||
- 1 Bucket: `iot_center` | ||
- 1 Label: `IoT` | ||
- 1 Dashboards: `IoT Center Application Monitoring` | ||
- 1 Variable: `IoT_Device` | ||
|
||
## Setup Instructions | ||
|
||
1. Load the dashboard according to the the paragraph above | ||
1. Run IoT Center application according to the [installation steps](https://github.com/bonitoo-io/iot-center-v2) | ||
1. Generate demo data using Virtual device | ||
|
||
## Contact | ||
|
||
Author: Miroslav Malecha, https://www.bonitoo.io |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** InfluxDB URL */ | ||
const INFLUX_URL = process.env.INFLUX_URL || 'http://localhost:8086' | ||
/** InfluxDB authorization token */ | ||
const INFLUX_TOKEN = process.env.INFLUX_TOKEN || 'my-token' | ||
/** Organization within InfluxDB */ | ||
const INFLUX_ORG = process.env.INFLUX_ORG || 'my-org' | ||
/** InfluxDB bucket */ | ||
const INFLUX_BUCKET = 'iot_center' | ||
|
||
// Defaults when on boarding a fresh new InfluxDB instance | ||
/** InfluxDB user */ | ||
const onboarding_username = 'my-user' | ||
/** InfluxDB password */ | ||
const onboarding_password = 'my-password' | ||
|
||
/** recommended interval for client's to refresh configuration in seconds */ | ||
const configuration_refresh = 3600 | ||
|
||
function logEnvironment() { | ||
console.log(`INFLUX_URL=${INFLUX_URL}`) | ||
console.log(`INFLUX_TOKEN=${INFLUX_TOKEN ? '***' : ''}`) | ||
console.log(`INFLUX_ORG=${INFLUX_ORG}`) | ||
console.log(`INFLUX_BUCKET=${INFLUX_BUCKET}`) | ||
} | ||
|
||
module.exports = { | ||
INFLUX_URL, | ||
INFLUX_TOKEN, | ||
INFLUX_ORG, | ||
onboarding_username, | ||
onboarding_password, | ||
configuration_refresh, | ||
INFLUX_BUCKET, | ||
logEnvironment, | ||
} |
Oops, something went wrong.