Skip to content

Commit

Permalink
feat(esphome): add observability for heating-sensor
Browse files Browse the repository at this point in the history
  • Loading branch information
tyriis committed Jan 25, 2024
1 parent 7d1ef7c commit c214738
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 0 deletions.
18 changes: 18 additions & 0 deletions kubernetes/talos-flux/apps/home-automation/esphome/flux-sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,21 @@ spec:
kind: GitRepository
name: home-ops
wait: true

---
# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/kustomization-kustomize-v1beta2.json
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
kind: Kustomization
metadata:
name: apps-esphome-obervability
namespace: flux-system
labels:
substitution.flux.home.arpa/enabled: "true"
spec:
interval: 10m
path: ./kubernetes/talos-flux/apps/home-automation/esphome/obervability
prune: true
sourceRef:
kind: GitRepository
name: home-ops
wait: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
# yaml-language-server: $schema=https://json.schemastore.org/kustomization
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: home-automation
resources:
- prometheus-rule.yaml
labels:
- pairs:
app.kubernetes.io/name: esphome-observability
app.kubernetes.io/instance: esphome-observability
app.kubernetes.io/part-of: esphome
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/monitoring.coreos.com/prometheusrule_v1.json
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: esphome-alerts
spec:
groups:
- name: esphome.sensor-heating.rules
rules:
- alert: ESPHomeHeatingSensorAbsent
annotations:
description: ESPHome sensor-heating has disappeared from Prometheus target discovery
summary: ESPHome sensor-heating has disappeared from Prometheus target discovery
expr: |-
absent(up{device="sensor-heating"})
for: 15m
labels:
severity: warning
- alert: ESPHomeHeatingSensorHighTemperature
annotations:
description: ESPHome sensor-heating temperature is too high
summary: ESPHome sensor-heating high temp
expr: |-
esphome_sensor_value{device="sensor-heating", name="Sensor Heating Temperature Flow Upstairs"} > 30
for: 10m
labels:
severity: warning
- alert: ESPHomeHeatingSensorLowTemperature
annotations:
description: ESPHome sensor-heating temperature is low
summary: ESPHome sensor-heating low temp
expr: |-
esphome_sensor_value{device="sensor-heating", name="Sensor Heating Temperature Flow Upstairs"} < 22
for: 10m
labels:
severity: warning

0 comments on commit c214738

Please sign in to comment.