Skip to content

Commit

Permalink
Updated gosund example
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Petrausch committed Jul 18, 2020
1 parent f13c36a commit d55b834
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 56 deletions.
2 changes: 1 addition & 1 deletion config.yaml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ mqtt:
# user: bob
# password: happylittleclouds
# The Topic path to subscripe to.
topic_path: v1/devices/me
topic_path: v1/devices/me/+
# Optional: Regular expression to extract the device ID from the topic path. The default regular expression, assumes
# that the last "element" of the topic_path is the device id.
# The regular expression must contain a named capture group with the name deviceid
Expand Down
68 changes: 13 additions & 55 deletions examples/gosund_sp111.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,69 +22,27 @@ cache:
# This is a list of valid metrics. Only metrics listed here will be exported
metrics:
# The name of the metric in prometheus
- prom_name: consumed_energy_total_kilowatthours
- prom_name: consumed_energy_kilowatthours_total
mqtt_name: "ENERGY.Total"
help: "total measured kilowatthours since flash"
type: counter
- prom_name: voltage_volt
- prom_name: voltage_volts
mqtt_name: "ENERGY.Voltage"
help: "Currently measured voltage"
type: gauge
- prom_name: current_ampere
- prom_name: current_amperes
mqtt_name: "ENERGY.Current"
help: "Currently measured current"
type: gauge
- prom_name: temperature
# The name of the metric in a MQTT JSON message
mqtt_name: temperature
# The prometheus help text for this metric
help: DHT22 temperature reading
# The prometheus type for this metric. Valid values are: "gauge" and "counter"
- prom_name: power_watts
mqtt_name: "ENERGY.Power"
help: "Currently measured power"
type: gauge
# A map of string to string for constant labels. This labels will be attached to every prometheus metric
const_labels:
sensor_type: dht22
# The name of the metric in prometheus
- prom_name: humidity
# The name of the metric in a MQTT JSON message
mqtt_name: humidity
# The prometheus help text for this metric
help: DHT22 humidity reading
# The prometheus type for this metric. Valid values are: "gauge" and "counter"
- prom_name: apparent_power_watt
mqtt_name: "ENERGY.ApparentPower"
help: "Currently apparent power"
type: gauge
# A map of string to string for constant labels. This labels will be attached to every prometheus metric
const_labels:
sensor_type: dht22
# The name of the metric in prometheus
- prom_name: heat_index
# The name of the metric in a MQTT JSON message
mqtt_name: heat_index
# The prometheus help text for this metric
help: DHT22 heatIndex calculation
# The prometheus type for this metric. Valid values are: "gauge" and "counter"
type: gauge
# A map of string to string for constant labels. This labels will be attached to every prometheus metric
const_labels:
sensor_type: dht22
# The name of the metric in prometheus
- prom_name: state
# The name of the metric in a MQTT JSON message
mqtt_name: state
# Regular expression to only match sensors with the given name pattern
sensor_name_filter: "^.*-light$"
# The prometheus help text for this metric
help: Light state
# The prometheus type for this metric. Valid values are: "gauge" and "counter"
type: gauge
# A map of string to string for constant labels. This labels will be attached to every prometheus metric
const_labels:
sensor_type: ikea
# When specified, enables mapping between string values to metric values.
string_value_mapping:
# A map of string to metric value.
map:
off: 0
low: 0
# Metric value to use if a match cannot be found in the map above.
# If not specified, parsing error will occur.
error_value: 1
- prom_name: reactive_power_watt
mqtt_name: "ENERGY.ReactivePower"
help: "Currently reactive power"
type: gauge

0 comments on commit d55b834

Please sign in to comment.