Homeassistant Prometheus Query

Inspired from homeassitant Command line Sensor this sensor take values from Prometheus metrics using PromQL query
Alternatives To Homeassistant Prometheus Query
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Grafana55,565252420 hours ago3,297September 23, 20223,584agpl-3.0TypeScript
The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
Prometheus48,409594a day ago703September 12, 2022888apache-2.0Go
The Prometheus monitoring system and time series database.
Skywalking21,88744a day ago24August 30, 202269apache-2.0Java
APM, Application Performance Monitoring System
Thanos11,7776720 hours ago451August 26, 2022387apache-2.0Go
Highly available Prometheus setup with long term storage capabilities. A CNCF Incubating project.
Node_exporter8,925167a day ago119March 30, 2022198apache-2.0Go
Exporter for machine metrics
Victoriametrics8,5954a day ago174September 08, 2022666apache-2.0Go
VictoriaMetrics: fast, cost-effective monitoring solution and time series database
Kube Prometheus5,323
3 days ago27June 17, 2022165apache-2.0Jsonnet
Use Prometheus to monitor Kubernetes and applications running on Kubernetes
Fluent Bit4,595
21 hours ago3June 15, 2022590apache-2.0C
Fast and Lightweight Logs and Metrics processor for Linux, BSD, OSX and Windows
Kube State Metrics4,56048a day ago93June 03, 202266apache-2.0Go
Add-on agent to generate and expose cluster-level metrics.
M34,43562 days ago994April 07, 2022210apache-2.0Go
M3 monorepo - Distributed TSDB, Aggregator and Query Engine, Prometheus Sidecar, Graphite Compatible, Metrics Platform
Alternatives To Homeassistant Prometheus Query
Select To Compare


Alternative Project Comparisons
Readme

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"
    unique_id: "tempPisa"
    prometheus_url: http://localhost:9090
    prometheus_query: temperature{job="cfrt",location=~"Pisa Fac Agraria.*",province="PI",region="Toscana"}
    unit_of_measurement: "°C"
    platform: prometheus_query
    name: "Temperature Cecina"
    unique_id: "tempCecina"
    prometheus_url: http://localhost:9090
    prometheus_query: temperature{job="cfrt",location=~"Cecina.*",province="LI",region="Toscana"}
    unit_of_measurement: "°C"
    platform: prometheus_query
    name: "Wind Quercianella"
    unique_id: "windQuercianella"
    prometheus_url: http://localhost:9090
    prometheus_query: wind_speed{job="cfrt",location="Quercianella",province="LI",region="Toscana"} * 3.6


Configuration Variables

  • name

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

  • unique_id: sensor Entity Id (See home assitant docs)

    (string)(Required if using more than one sensor) Id 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.

  • state_class

    (string)(Optional) Defines the type of sensor. measurement for metrics that are gauges,total_increasing for metrics that are counters.

  • device_class

    (string)(Optional) Defines the type of device. see Here for device types, such as energy, battery, temperature

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

Popular Metrics Projects
Popular Prometheus Projects
Popular Operations Categories

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Python
Sensor
Metrics
Prometheus
Home Assistant
Measurements