Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Support for boolean / non-string datatype mappings #103

Open
hacker-h opened this issue Nov 13, 2022 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@hacker-h
Copy link

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
@hikhvar
Copy link
Owner

hikhvar commented Dec 31, 2022

Will happily review any pull request in that direction.

@hikhvar hikhvar added the enhancement New feature or request label Dec 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants