forked from hansij66/dsmr2mqtt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
telegraf-dsmr.conf
executable file
·103 lines (86 loc) · 3.34 KB
/
telegraf-dsmr.conf
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
# Configuration file for telegraf
# Parse MQTT
# Store in influxdb v1
[[inputs.mqtt_consumer]]
# use underscores
alias = "dsmr"
name_override = "dsmr"
servers = ["tcp://mqtt:1883"]
username = "ijntema"
password = "mosquitto0000"
qos = 0
persistent_session = false
topics = [ "dsmr/el", "dsmr/gas" ]
client_id = "telegraf-dsmr-d"
data_format = "json_v2"
[[inputs.mqtt_consumer.json_v2]]
# A string that will become the new measurement name
measurement_name = "dsmr"
# A string with valid GJSON path syntax to a valid timestamp (single value)
timestamp_path = "@this.timestamp"
timestamp_format = "unix"
[[inputs.mqtt_consumer.json_v2.object]]
# A string with valid GJSON path syntax, can include array's and object's
path = "@this"
### Configuration to define what JSON keys should be included and how (field/tag) ###
# List of JSON keys (for a nested key, prepend the parent keys with underscores) to be a tag instead of a field,
# when adding a JSON key in this list you don't have to define it in the included_keys list
# database tag to determine which influxdb to be used
tags = ["serial"]
# List of JSON keys (for a nested key, prepend the parent keys with underscores) that shouldn't be included in result
# Exclude the mqtt/json key "timestamp" from influxdb
excluded_keys = ["timestamp"]
# A map of JSON keys (for a nested key, prepend the parent keys with underscores) with a type (int,uint,float,string,bool)
[inputs.mqtt_consumer.json_v2.object.fields]
V1 = "uint"
V2 = "uint"
V3 = "uint"
V1_sags = "uint"
V2_sags = "uint"
V3_sags = "uint"
V1_swells = "uint"
V2_swells = "uint"
V3_swells = "uint"
el_consumed = "uint"
el_returned = "uint"
p_consumed = "uint"
p_generated = "uint"
# P1_consumed = "uint"
# P1_generated = "uint"
# P2_consumed = "uint"
# P2_generated = "uint"
# P3_consumed = "uint"
# P3_generated = "uint"
long_power_failures = "uint"
power_failures = "uint"
timestamp = "uint"
gas_consumed = "uint"
# Influx DB v1
[[outputs.influxdb]]
urls = ["http://influxdb:8086"]
# database = "dsmr" # required
database = "dsmr"
namepass = ["dsmr"]
## Retention policy to write to. Empty string writes to the default rp.
retention_policy = ""
## Write consistency (clusters only), can be: "any", "one", "quorum", "all"
write_consistency = "any"
## Write timeout (for the InfluxDB client), formatted as a string.
## If not provided, will default to 5s. 0s means no timeout (not recommended).
timeout = "5s"
# Prepare for transition to InfluxDB v2
[[outputs.influxdb_v2]]
## The URLs of the InfluxDB cluster nodes.
##
## Multiple URLs can be specified for a single cluster, only ONE of the
## urls will be written to each interval.
## ex: urls = ["https://us-west-2-1.aws.cloud2.influxdata.com"]
urls = ["http://influxdb2:8086"]
## API token for authentication/write access to bucket.
token = "my secrete token=="
## Organization is the name of the organization you wish to write to; must exist.
## Created at initialization of InfluxDB2 instance
organization = "Home"
## Make sure that bucket does exist
bucket = "dsmr"
namepass = ["dsmr"]