Last active
January 10, 2022 21:54
-
-
Save nbuchwitz/c706208e0e381e66ce8c602f5a6a75de to your computer and use it in GitHub Desktop.
esphome gas meter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"annotations": { | |
"list": [ | |
{ | |
"builtIn": 1, | |
"datasource": "-- Grafana --", | |
"enable": true, | |
"hide": true, | |
"iconColor": "rgba(0, 211, 255, 1)", | |
"name": "Annotations & Alerts", | |
"type": "dashboard" | |
} | |
] | |
}, | |
"editable": true, | |
"gnetId": null, | |
"graphTooltip": 0, | |
"id": 35, | |
"links": [], | |
"panels": [ | |
{ | |
"aliasColors": { | |
"Außentemperatur": "dark-blue", | |
"Erdgas": "super-light-orange", | |
"temperature.mean": "red" | |
}, | |
"bars": true, | |
"dashLength": 10, | |
"dashes": false, | |
"datasource": "home_assistant", | |
"description": "", | |
"fieldConfig": { | |
"defaults": { | |
"custom": {} | |
}, | |
"overrides": [] | |
}, | |
"fill": 1, | |
"fillGradient": 0, | |
"gridPos": { | |
"h": 12, | |
"w": 24, | |
"x": 0, | |
"y": 0 | |
}, | |
"hiddenSeries": false, | |
"id": 2, | |
"legend": { | |
"alignAsTable": true, | |
"avg": true, | |
"current": false, | |
"max": true, | |
"min": false, | |
"show": true, | |
"total": false, | |
"values": true | |
}, | |
"lines": false, | |
"linewidth": 1, | |
"nullPointMode": "null", | |
"options": { | |
"alertThreshold": true | |
}, | |
"percentage": false, | |
"pluginVersion": "7.3.6", | |
"pointradius": 2, | |
"points": false, | |
"renderer": "flot", | |
"seriesOverrides": [ | |
{ | |
"alias": "Außentemperatur", | |
"bars": false, | |
"fill": 0, | |
"lines": true, | |
"yaxis": 2 | |
} | |
], | |
"spaceLength": 10, | |
"stack": false, | |
"steppedLine": false, | |
"targets": [ | |
{ | |
"alias": "Erdgas", | |
"groupBy": [ | |
{ | |
"params": [ | |
"1d" | |
], | |
"type": "time" | |
}, | |
{ | |
"params": [ | |
"none" | |
], | |
"type": "fill" | |
} | |
], | |
"measurement": "m³/ min", | |
"orderByTime": "ASC", | |
"policy": "default", | |
"refId": "A", | |
"resultFormat": "time_series", | |
"select": [ | |
[ | |
{ | |
"params": [ | |
"value" | |
], | |
"type": "field" | |
}, | |
{ | |
"params": [], | |
"type": "sum" | |
} | |
] | |
], | |
"tags": [] | |
}, | |
{ | |
"alias": "Außentemperatur", | |
"groupBy": [ | |
{ | |
"params": [ | |
"5m" | |
], | |
"type": "time" | |
}, | |
{ | |
"params": [ | |
"none" | |
], | |
"type": "fill" | |
} | |
], | |
"measurement": "temperature", | |
"orderByTime": "ASC", | |
"policy": "default", | |
"refId": "B", | |
"resultFormat": "time_series", | |
"select": [ | |
[ | |
{ | |
"params": [ | |
"value" | |
], | |
"type": "field" | |
}, | |
{ | |
"params": [], | |
"type": "mean" | |
} | |
] | |
], | |
"tags": [ | |
{ | |
"key": "entity_id", | |
"operator": "=", | |
"value": "gartenhaus_temperature" | |
} | |
] | |
} | |
], | |
"thresholds": [], | |
"timeFrom": null, | |
"timeRegions": [], | |
"timeShift": null, | |
"title": "Gasverbrauch pro Tag", | |
"tooltip": { | |
"shared": true, | |
"sort": 0, | |
"value_type": "individual" | |
}, | |
"type": "graph", | |
"xaxis": { | |
"buckets": null, | |
"mode": "time", | |
"name": null, | |
"show": true, | |
"values": [] | |
}, | |
"yaxes": [ | |
{ | |
"format": "m3", | |
"label": null, | |
"logBase": 1, | |
"max": null, | |
"min": null, | |
"show": true | |
}, | |
{ | |
"format": "celsius", | |
"label": null, | |
"logBase": 1, | |
"max": null, | |
"min": null, | |
"show": true | |
} | |
], | |
"yaxis": { | |
"align": false, | |
"alignLevel": null | |
} | |
}, | |
{ | |
"datasource": "home_assistant", | |
"description": "", | |
"fieldConfig": { | |
"defaults": { | |
"custom": { | |
"align": null, | |
"filterable": false | |
}, | |
"mappings": [], | |
"thresholds": { | |
"mode": "absolute", | |
"steps": [ | |
{ | |
"color": "green", | |
"value": null | |
}, | |
{ | |
"color": "red", | |
"value": 80 | |
} | |
] | |
} | |
}, | |
"overrides": [ | |
{ | |
"matcher": { | |
"id": "byName", | |
"options": "Time" | |
}, | |
"properties": [ | |
{ | |
"id": "unit", | |
"value": "time:DD.MM.YYYY" | |
}, | |
{ | |
"id": "custom.width", | |
"value": 94 | |
}, | |
{ | |
"id": "custom.align", | |
"value": "center" | |
}, | |
{ | |
"id": "displayName", | |
"value": "Datum" | |
}, | |
{ | |
"id": "custom.filterable", | |
"value": true | |
} | |
] | |
}, | |
{ | |
"matcher": { | |
"id": "byName", | |
"options": "Erdgas" | |
}, | |
"properties": [ | |
{ | |
"id": "custom.displayMode", | |
"value": "basic" | |
}, | |
{ | |
"id": "unit", | |
"value": "m3" | |
}, | |
{ | |
"id": "displayName", | |
"value": "Verbrauch pro Tag" | |
}, | |
{ | |
"id": "color", | |
"value": { | |
"fixedColor": "orange", | |
"mode": "fixed" | |
} | |
}, | |
{ | |
"id": "noValue", | |
"value": "keine Daten" | |
} | |
] | |
}, | |
{ | |
"matcher": { | |
"id": "byRegexp", | |
"options": "/^temp/" | |
}, | |
"properties": [ | |
{ | |
"id": "unit", | |
"value": "celsius" | |
}, | |
{ | |
"id": "color", | |
"value": { | |
"mode": "thresholds" | |
} | |
}, | |
{ | |
"id": "thresholds", | |
"value": { | |
"mode": "absolute", | |
"steps": [ | |
{ | |
"color": "rgb(22, 31, 22)", | |
"value": null | |
}, | |
{ | |
"color": "dark-blue", | |
"value": -10 | |
}, | |
{ | |
"color": "light-blue", | |
"value": -5 | |
}, | |
{ | |
"color": "super-light-blue", | |
"value": 1 | |
}, | |
{ | |
"color": "super-light-green", | |
"value": 5 | |
}, | |
{ | |
"color": "green", | |
"value": 10 | |
}, | |
{ | |
"color": "#EAB839", | |
"value": 20 | |
}, | |
{ | |
"color": "orange", | |
"value": 30 | |
} | |
] | |
} | |
}, | |
{ | |
"id": "custom.displayMode", | |
"value": "color-background" | |
}, | |
{ | |
"id": "custom.width", | |
"value": 150 | |
}, | |
{ | |
"id": "decimals", | |
"value": 1 | |
} | |
] | |
}, | |
{ | |
"matcher": { | |
"id": "byName", | |
"options": "temp_avg" | |
}, | |
"properties": [ | |
{ | |
"id": "displayName", | |
"value": "Mittlere Temperatur" | |
} | |
] | |
}, | |
{ | |
"matcher": { | |
"id": "byName", | |
"options": "temp_min" | |
}, | |
"properties": [ | |
{ | |
"id": "displayName", | |
"value": "Tiefsttemperatur" | |
} | |
] | |
}, | |
{ | |
"matcher": { | |
"id": "byName", | |
"options": "temp_max" | |
}, | |
"properties": [ | |
{ | |
"id": "displayName", | |
"value": "Höchsttemperatur" | |
} | |
] | |
} | |
] | |
}, | |
"gridPos": { | |
"h": 14, | |
"w": 24, | |
"x": 0, | |
"y": 12 | |
}, | |
"id": 4, | |
"options": { | |
"frameIndex": 1, | |
"showHeader": true, | |
"sortBy": [ | |
{ | |
"desc": true, | |
"displayName": "Datum" | |
} | |
] | |
}, | |
"pluginVersion": "7.3.6", | |
"targets": [ | |
{ | |
"alias": "Erdgas", | |
"groupBy": [ | |
{ | |
"params": [ | |
"1d" | |
], | |
"type": "time" | |
}, | |
{ | |
"params": [ | |
"none" | |
], | |
"type": "fill" | |
} | |
], | |
"measurement": "m³/ min", | |
"orderByTime": "ASC", | |
"policy": "default", | |
"refId": "A", | |
"resultFormat": "time_series", | |
"select": [ | |
[ | |
{ | |
"params": [ | |
"value" | |
], | |
"type": "field" | |
}, | |
{ | |
"params": [], | |
"type": "sum" | |
} | |
] | |
], | |
"tags": [] | |
}, | |
{ | |
"alias": "temp_avg", | |
"groupBy": [ | |
{ | |
"params": [ | |
"1d" | |
], | |
"type": "time" | |
}, | |
{ | |
"params": [ | |
"none" | |
], | |
"type": "fill" | |
} | |
], | |
"measurement": "temperature", | |
"orderByTime": "ASC", | |
"policy": "default", | |
"refId": "B", | |
"resultFormat": "time_series", | |
"select": [ | |
[ | |
{ | |
"params": [ | |
"value" | |
], | |
"type": "field" | |
}, | |
{ | |
"params": [], | |
"type": "mean" | |
} | |
] | |
], | |
"tags": [ | |
{ | |
"key": "entity_id", | |
"operator": "=", | |
"value": "gartenhaus_temperature" | |
} | |
] | |
}, | |
{ | |
"alias": "temp_min", | |
"groupBy": [ | |
{ | |
"params": [ | |
"1d" | |
], | |
"type": "time" | |
}, | |
{ | |
"params": [ | |
"none" | |
], | |
"type": "fill" | |
} | |
], | |
"measurement": "temperature", | |
"orderByTime": "ASC", | |
"policy": "default", | |
"refId": "D", | |
"resultFormat": "time_series", | |
"select": [ | |
[ | |
{ | |
"params": [ | |
"value" | |
], | |
"type": "field" | |
}, | |
{ | |
"params": [], | |
"type": "min" | |
} | |
] | |
], | |
"tags": [ | |
{ | |
"key": "entity_id", | |
"operator": "=", | |
"value": "gartenhaus_temperature" | |
} | |
] | |
}, | |
{ | |
"alias": "temp_max", | |
"groupBy": [ | |
{ | |
"params": [ | |
"1d" | |
], | |
"type": "time" | |
}, | |
{ | |
"params": [ | |
"none" | |
], | |
"type": "fill" | |
} | |
], | |
"measurement": "temperature", | |
"orderByTime": "ASC", | |
"policy": "default", | |
"refId": "C", | |
"resultFormat": "time_series", | |
"select": [ | |
[ | |
{ | |
"params": [ | |
"value" | |
], | |
"type": "field" | |
}, | |
{ | |
"params": [], | |
"type": "max" | |
} | |
] | |
], | |
"tags": [ | |
{ | |
"key": "entity_id", | |
"operator": "=", | |
"value": "gartenhaus_temperature" | |
} | |
] | |
} | |
], | |
"timeFrom": null, | |
"timeShift": null, | |
"title": "Gasverbrauch", | |
"transformations": [ | |
{ | |
"id": "seriesToColumns", | |
"options": {} | |
} | |
], | |
"type": "table" | |
} | |
], | |
"refresh": "30m", | |
"schemaVersion": 26, | |
"style": "dark", | |
"tags": [], | |
"templating": { | |
"list": [] | |
}, | |
"time": { | |
"from": "now-30d", | |
"to": "now" | |
}, | |
"timepicker": { | |
"refresh_intervals": [ | |
"30m", | |
"1h", | |
"1d" | |
] | |
}, | |
"timezone": "", | |
"title": "Gas", | |
"uid": "ukywgW-Mk", | |
"version": 20 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
esphome: | |
name: meter | |
platform: ESP8266 | |
board: d1_mini | |
build_path: ./builds/meter | |
substitutions: | |
esp_name: "Meter" | |
wifi: | |
ssid: !secret wifi_ssid | |
password: !secret wifi_password | |
fast_connect: true | |
logger: | |
api: | |
password: !secret api_password | |
ota: | |
password: !secret ota_password | |
binary_sensor: | |
- platform: status | |
name: "${esp_name} - Status" | |
sensor: | |
- platform: wifi_signal | |
name: "${esp_name} - WiFi Signal" | |
update_interval: 3s | |
- platform: pulse_counter | |
pin: D1 | |
name: "Gas Cubic meters used" | |
update_interval : 60s | |
filters: | |
- multiply: 0.01 | |
unit_of_measurement: "m³/ min" | |
id: gas | |
accuracy_decimals: 3 | |
icon: 'mdi:fire' | |
- platform: template | |
name: "Gas Total m³" | |
lambda: |- | |
static float total_value = 0.0; | |
total_value += id(gas).state; | |
return total_value; | |
unit_of_measurement: "m³" | |
icon: 'mdi:fire' | |
update_interval: 60s | |
accuracy_decimals: 3 |
Hello!
Congratulations, nice work!
For me, the total value is always reset when ESP starts again.
Is there a solution to this?
Great job!.
Is this Grafana with data being taken solely from HomeAssistant and not from InfluxDB?
I'm not using Grafana, but this looks like a good reason to try it out.
Hello.
Looks very good and just what I was looking for to run on HA. I downloaded the json file and imported to Grafana but I'm just seeing two blank titled panels. Fairly new to this stuff so my question is, will the panels remain blank until I connect an ESP? I would have thought I'd get some information showing up even if there is no data. Any advice?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The gas meter is connected via a reed contact to the ESP8266:
(M is the gas meter)