@@ -8,6 +8,76 @@ metrics:
88 tls :
99 certificateFile : " "
1010 privateKeyFile : " "
11+ stalenessInterval : 5m # Deletes metrics if we have not received any updates for them within the given interval
12+ metricsMapping :
13+ # LYWSD03MMC mappings
14+ - name : " temperature_celsius"
15+ description : " sensor value."
16+ namespace : " yasp"
17+ subsystem : " lywsd03mmc"
18+ type : Gauge
19+ labels :
20+ - device
21+ - deviceType
22+ - name : " humidity_percent"
23+ description : " sensor value."
24+ namespace : " yasp"
25+ subsystem : " lywsd03mmc"
26+ type : Gauge
27+ labels :
28+ - device
29+ - deviceType
30+ - name : " battery_percent"
31+ description : " sensor value."
32+ namespace : " yasp"
33+ subsystem : " lywsd03mmc"
34+ type : Gauge
35+ labels :
36+ - device
37+ - deviceType
38+ # P1P2 mappings
39+ - name : " temperature"
40+ description : " p1p2 target temperature."
41+ namespace : " yasp"
42+ subsystem : " p1p2"
43+ type : Gauge
44+ labels :
45+ - device
46+ - name : " status"
47+ description : " p1p2 operation status."
48+ namespace : " yasp"
49+ subsystem : " p1p2"
50+ type : Gauge
51+ labels :
52+ - device
53+ - name : " test_mode"
54+ description : " p1p2 test mode status."
55+ namespace : " yasp"
56+ subsystem : " p1p2"
57+ type : Gauge
58+ labels :
59+ - device
60+ - name : " error_code"
61+ description : " p1p2 error code."
62+ namespace : " yasp"
63+ subsystem : " p1p2"
64+ type : Gauge
65+ labels :
66+ - device
67+ - name : " mode"
68+ description : " p1p2 mode, 1 = cooling, 2 = heating."
69+ type : Gauge
70+ namespace : " yasp"
71+ subsystem : " p1p2"
72+ labels :
73+ - device
74+ - name : " fan_speed"
75+ description : " p1p2 fan speed, 1 = low, 2 = medium, 3 = high."
76+ namespace : " yasp"
77+ subsystem : " p1p2"
78+ type : Gauge
79+ labels :
80+ - device
1181sensors :
1282 - name : Xiaomi Mi Temperature and Humidity Monitor 2
1383 enabled : false
@@ -26,7 +96,7 @@ sensors:
2696 password : " "
2797 clientId : LYWSD03MMC_Subscriber
2898 keepAlive : 5
29- connectRetryDelay : 5s
99+ qos : 0
30100 memphis :
31101 enabled : false
32102 hostname : 127.0.0.1:6666
@@ -48,7 +118,6 @@ sensors:
48118 password : " "
49119 clientId : LYWSD03MMC_Publisher
50120 keepAlive : 5
51- connectRetryDelay : 5s
52121 qos : 0
53122 retain : false
54123 - influxdb2 :
@@ -78,45 +147,36 @@ sensors:
78147 {{- else if or (eq (index .Properties "unit") "Humidity") (eq (index .Properties "unit") "Battery") -}}
79148 _percent
80149 {{- end -}}
81- description: "sensor value." # Templating supported
82150 namespace: "yasp"
83151 subsystem: "{{- index .Properties \"deviceType\" | ToLower -}}" # Templating supported
152+ value: "{{ index .Properties \"value\" | ToNumber }}" # Templating supported
84153 labels:
85154 device: "{{- index .Properties \"deviceName\" -}}" # Templating supported on both keys and values
86155 deviceType: "{{- index .Properties \"deviceType\" -}}"
87- type: Gauge # Templating supported
88- value: "{{ index .Properties \"value\" | ToNumber }}" # Templating supported
89- condition: "" # Templating supported
90156 # Individual mapping per unit example
91157 # - name: Temperature
92- # description: Temperature sensor value.
93158 # namespace: ""
94159 # subsystem: ""
160+ # value: "{{ index .Properties \"value\" | ToNumber }}"
95161 # labels:
96162 # device: "{{ index .Properties \"deviceName\" }}"
97163 # deviceType: "{{ index .Properties \"deviceType\" }}"
98- # type: Gauge
99- # value: "{{ index .Properties \"value\" | ToNumber }}"
100164 # condition: "{{ eq (index .Properties \"unit\") \"Temperature\" }}"
101165 # - name: Humidity
102- # description: Humidity sensor value.
103166 # namespace: ""
104167 # subsystem: ""
168+ # value: "{{ index .Properties \"value\" | ToNumber }}"
105169 # labels:
106170 # device: "{{ index .Properties \"deviceName\" }}"
107171 # deviceType: "{{ index .Properties \"deviceType\" }}"
108- # type: Gauge
109- # value: "{{ index .Properties \"value\" | ToNumber }}"
110172 # condition: "{{ eq (index .Properties \"unit\") \"Humidity\" }}"
111173 # - name: Battery
112- # description: Battery sensor value.
113174 # namespace: ""
114175 # subsystem: ""
176+ # value: "{{ index .Properties \"value\" | ToNumber }}"
115177 # labels:
116178 # device: "{{ index .Properties \"deviceName\" }}"
117179 # deviceType: "{{ index .Properties \"deviceType\" }}"
118- # type: Gauge
119- # value: "{{ index .Properties \"value\" | ToNumber }}"
120180 # condition: "{{- if eq (index .Properties \"unit\") \"Battery\" -}}true{{- else - }}false{{- end -}}"
121181 devices :
122182 - name : Your Sensor
@@ -135,54 +195,42 @@ sensors:
135195 - tcp://localhost:1883
136196 clientId : P1P2_Subscriber
137197 keepAlive : 5
138- connectRetryDelay : 5s
198+ qos : 0
139199 outputs :
140200 - prometheus :
141201 enabled : true
142202 metricsMapping :
143203 - name : " temperature"
144- description : " p1p2 target temperature."
145- type : Gauge
146204 value : " {{ index .Properties \" temperature\" | ToNumber }}"
147205 namespace : " yasp"
148206 subsystem : " p1p2"
149207 labels :
150208 device : " {{ index .Properties \" bridge\" }}"
151209 - name : " status"
152- description : " p1p2 operation status."
153- type : Gauge
154210 value : " {{ index .Properties \" status\" | ToNumber }}"
155211 namespace : " yasp"
156212 subsystem : " p1p2"
157213 labels :
158214 device : " {{ index .Properties \" bridge\" }}"
159215 - name : " testMode"
160- description : " p1p2 test mode status."
161- type : Gauge
162216 value : " {{ index .Properties \" testMode\" | ToNumber }}"
163217 namespace : " yasp"
164218 subsystem : " p1p2"
165219 labels :
166220 device : " {{ index .Properties \" bridge\" }}"
167221 - name : " errorCode"
168- description : " p1p2 error code."
169- type : Gauge
170222 value : " {{ index .Properties \" errorCode\" | ToNumber }}"
171223 namespace : " yasp"
172224 subsystem : " p1p2"
173225 labels :
174226 device : " {{ index .Properties \" bridge\" }}"
175227 - name : " mode"
176- description : " p1p2 mode, 1 = cooling, 2 = heating."
177- type : Gauge
178228 value : " {{ index .Properties \" modeId\" | ToNumber }}"
179229 namespace : " yasp"
180230 subsystem : " p1p2"
181231 labels :
182232 device : " {{ index .Properties \" bridge\" }}"
183233 - name : " fanSpeed"
184- description : " p1p2 fan speed, 1 = low, 2 = medium, 3 = high."
185- type : Gauge
186234 value : " {{ index .Properties \" fanSpeedId\" | ToNumber }}"
187235 namespace : " yasp"
188236 subsystem : " p1p2"
0 commit comments