mirror of
https://github.com/nikdoof/homeassistant-prometheus-query.git
synced 2025-12-23 07:19:22 +00:00
First upload to github
This commit is contained in:
36
README.md
Normal file
36
README.md
Normal file
@@ -0,0 +1,36 @@
|
||||
# homeassistant-prometheus-query
|
||||
Inspired from homeassitant Command line Sensor this sensor take values from [Prometheus](https://prometheus.io/) metrics using [PromQL](https://prometheus.io/docs/prometheus/latest/querying/basics/) query . It allow to specify one or more query.
|
||||
|
||||
## Configuration
|
||||
|
||||
To enable it, add the following lines to your `configuration.yaml`:
|
||||
|
||||
```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 retrieva 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.
|
||||
Reference in New Issue
Block a user