-
Notifications
You must be signed in to change notification settings - Fork 0
/
telegraf-kamstrup-heatmeters.conf
executable file
·94 lines (72 loc) · 3.32 KB
/
telegraf-kamstrup-heatmeters.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
# Configuration file for Telegraf,
# Take care that the Kamstrup MQTT data is passed on via Telegraf to InfluxDB (v1 and v2)
# Kamstrup heat/energy meter
[[inputs.mqtt_consumer]]
alias = "kamstrup_mqtt_heatmeter"
name_override = "kamstrup_mqtt_heatmeter"
servers = ["tcp://mqtt:1883"]
username = "username"
password = "password"
qos = 0
# Adapt based on names on config.py
topics = [ "kamstrup/MC303", "kamstrup/MC601" ]
persistent_session = false
client_id = "telegraf_kamstrup"
data_format = "json_v2"
[[inputs.mqtt_consumer.json_v2]]
# A string that will become the new measurement name
# HIJN: dont see anything changing...
measurement_name = "kamstrup"
# If you're not using UTC, leave out the two timestamp
# lines and see if it works. Otherwise, you'll have
# metrics in the past/future.
timestamp_path = "@this.timestamp"
timestamp_format = "unix"
[[inputs.mqtt_consumer.json_v2.object]]
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 = ["topic", "FABRICATION_NO"]
# 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 = ["DATE", "DATE_TIME_GENERAL", "ENERGY_WH_d0_t1", "ENERGY_WH_d0_t2", "ENERGY_WH_d3_t0", "ON_TIME", "VOLUME_d1_t0", "VOLUME_d2_t0", "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]
FLOW_TEMPERATURE = "float"
RETURN_TEMPERATURE = "float"
ENERGY_WH = "uint"
POWER_W = "float"
VOLUME_FLOW = "float"
P_Ea = "uint"
# InfluxDB v1
[[outputs.influxdb]]
urls = ["http://influxdb:8086"]
database = "kamstrup" # required
namepass = ["kamstrup_mqtt_heatmeter"]
## If true, the 'database_tag' will not be included in the written metric.
#exclude_database_tag = true
## 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 = "kamstrup"
namepass = ["kamstrup_mqtt_heatmeter"]