Skip to content

Inspired from homeassitant Command line Sensor this sensor take values from Prometheus metrics using PromQL query

Notifications You must be signed in to change notification settings

radhus/homeassistant-prometheus-query

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

homeassistant-prometheus-query

Inspired from homeassitant Command line Sensor this sensor take values from Prometheus metrics using PromQL query . It allow to specify one or more query creating a sensors for each query.

Configuration

To enable it, add the following lines to your configuration.yaml:

# Example configuration.yaml entry
sensor:
  - platform: prometheus_query
    name: Temperature Pisa
    prometheus_url: http://localhost:9090
    prometheus_query: temperature{location="Pisa",province="PI",region="Tuscany"}
    unit_of_measurement: "°C"

Configuration Variables

  • name

(string)(Required) Name of the sensor..

  • prometheus_url

(string)(Required) the url of your Prometheus server

  • prometheus_query

(string)(Required) the PromQL query to retrieve sensor

  • unit_of_measurement

(string)(Optional) Defines the unit of measurement of the sensor, if any.

It's a custom component so it must be downloaded under /custom_components folder.

About

Inspired from homeassitant Command line Sensor this sensor take values from Prometheus metrics using PromQL query

Topics

Resources

Stars

Watchers

Forks

Languages

  • Python 100.0%