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

Help wanted related to shelly1 with temperature module #81

Open
fenrus opened this issue Feb 17, 2022 · 1 comment
Open

Help wanted related to shelly1 with temperature module #81

fenrus opened this issue Feb 17, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@fenrus
Copy link

fenrus commented Feb 17, 2022

Hi,

I've been looking at your project, and it's looking great!

I'm currently pulling temperature values from Shelly1 hardware with temperature module. The hardware module can have up to three temp sensors attached.

I've implemented it as three separate metrics, because i have yet to figure out how to put it all in the same one. (Is this possible?)

The documentation for this hardware and module can be found here: https://shelly-api-docs.shelly.cloud/gen1/#shelly1-1pm-mqtt

here's some JSON example data on the topic "shellies/shelly1-C45BBE77777B/ext_temperatures" is this:

{
  "0": {
    "hwID": "28f7f676e0000000",
    "tC": 25.9
  },
  "1": {
    "hwID": "28f7f676e0011111",
    "tC": 15.9
  },
  "2": {
    "hwID": "28f7f676e0022222",
    "tC": 6.9
  }
}

The config i'm using is roughly this:

mqtt:
  topic_path: shellies/+/ext_temperatures
  device_id_regex: "shellies/(?P<deviceid>.*)/ext_temperatures"

metrics:
  - prom_name: shelly_temperature_0
    mqtt_name: 0.tC
    help: shelly temperature reading
    type: gauge
    const_labels:
      sensor_type: shelly

Metrics are repeated prom_names "shelly_temperature_1 and 2, as well as mqtt_names: 1.tC and 2.tC

I'm greatful for any assistance.

@hikhvar
Copy link
Owner

hikhvar commented Feb 19, 2022

The current data processing model of mqtt2prometheus doesn't allow to extract multiple instances of the same time series from the same mqtt event 🤔

I think with the implementation of #74 one could consider to implement something like this. Meanwhile one could try to change the __name__ label during relabeling in Prometheus.

@hikhvar hikhvar added the enhancement New feature or request label Aug 25, 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