I saw the string_value_mapping so something similar or a solution for generic data types should be possible.
This would support more sensors like motion, contact, water etc.
example config:
metrics:
- prom_name: contact
mqtt_name: contact
sensor_name_filter: "^Contact[0-]+$"
help: Door/Window Contact Sensor
type: gauge
bool_value_mapping:
# A map of bool to metric value.
map:
false: 0
true: 1
# Metric value to use if a match cannot be found in the map above.
# If not specified, parsing error will occur.
error_value: 2
const_labels:
sensor_type: aqara
I saw the
string_value_mapping
so something similar or a solution for generic data types should be possible.This would support more sensors like motion, contact, water etc.
example config: