Gaser: Unterschied zwischen den Versionen
Raphii (Diskussion | Beiträge) |
Wu (Diskussion | Beiträge) |
||
| (3 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
| Zeile 1: | Zeile 1: | ||
{{Infobox Projekt | {{Infobox Projekt | ||
|name = gaser | |name = gaser | ||
| − | |status = | + | |status = stable |
|autor = [[Benutzer:raphii|raphii wu|wu]] | |autor = [[Benutzer:raphii|raphii wu|wu]] | ||
|beschreibung = Gaszähler Impulse auslesen | |beschreibung = Gaszähler Impulse auslesen | ||
| Zeile 10: | Zeile 10: | ||
[[Category:Software]] | [[Category:Software]] | ||
[[Category:Hardware]] | [[Category:Hardware]] | ||
| + | [[Category:Infrastruktur]] | ||
| + | [[Category:Homeassistant]] | ||
== Description == | == Description == | ||
| − | + | Der 'Gaser' ist ein kompaktes Gerät, das an Gaszählern befestigt wird, um Verbrauchsimpulse zu erfassen und den Gasverbrauch digital zu schätzen. Der Raspberry Pi Pico W ist mit ESPhome geflasht und im Home Assistant eingebunden. Unser Gaszähler hat einen Magnet an der ersten Dezimalstelle sitzen, der den Reed-Sensor beim Umschlagen auslöst. | |
| − | |||
| − | |||
| − | |||
| − | |||
| + | ==Hardware== | ||
| − | + | *Reed-Sensor | |
| + | *Raspberry Pi Pico W | ||
| + | *Jumperwire | ||
| + | *Heißkleber | ||
| − | |||
| − | + | <gallery> | |
| − | + | Datei:gaser_pipicow.jpg | |
| − | + | Datei:gaser_pipicow_top.jpg | |
| + | </gallery> | ||
| − | + | ==Software== | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | + | esphome | |
| − | |||
| − | # Enable Home Assistant API | + | <nowiki> |
| − | api: | + | esphome: |
| − | + | name: gaser | |
| − | + | ||
| − | + | rp2040: | |
| − | ota: | + | board: rpipicow |
| − | + | framework: | |
| − | + | # Required until https://github.com/platformio/platform-raspberrypi/pull/36 is merged | |
| − | wifi: | + | platform_version: https://github.com/maxgerhardt/platform-raspberrypi.git |
| − | + | ||
| − | + | # Enable logging | |
| − | + | logger: | |
| − | + | ||
| − | + | # Enable Home Assistant API | |
| − | + | api: | |
| − | + | encryption: | |
| − | + | key: "changeme" | |
| − | globals: | + | |
| − | + | ota: | |
| − | + | password: "ch" | |
| − | + | ||
| − | + | wifi: | |
| − | binary_sensor: | + | ssid: !secret wifi_ssid |
| − | + | password: !secret wifi_password | |
| − | + | use_address: 10.1.42.247 | |
| − | + | # Enable fallback hotspot in case wifi connection fails | |
| − | + | ap: | |
| − | + | ssid: "Gaser Fallback Hotspot" | |
| − | + | password: "changeme" | |
| − | + | ||
| − | + | globals: | |
| − | + | - id: total_pulses | |
| − | + | type: int | |
| − | + | restore_value: True | |
| − | + | initial_value: '0' # hier kann der Gaszählerstand in Pulsen initialisiert werden. Also Zählerstand 1234,56 m3 zu 12345 bei einem G4 mit Puls 0.1 | |
| − | + | binary_sensor: | |
| − | + | - platform: gpio | |
| − | + | id: internal_pulse_counter | |
| − | sensor: | + | pin: |
| − | + | number: GPIO28 | |
| − | + | mode: INPUT_PULLUP | |
| − | + | name: "Live-Impuls" | |
| − | + | filters: | |
| − | + | - delayed_on: 10ms | |
| − | + | on_press: | |
| − | + | then: | |
| − | + | - lambda: id(total_pulses) += 1; | |
| − | + | - output.turn_off: led # optional: für eine LED, die den Gaszählerpuls visualisiert | |
| − | # Optional: Diese LED soll blinken, sobald ein Signal vom Gaszähler erkannt wird | + | on_release: |
| − | output: | + | then: |
| − | + | - output.turn_on: led # optional: für eine LED, die den Gaszählerpuls visualisiert | |
| − | + | sensor: | |
| − | + | - platform: template | |
| − | + | name: "Gasverbrauch" | |
| − | </nowiki> | + | device_class: gas |
| + | unit_of_measurement: "m³" | ||
| + | state_class: "total_increasing" | ||
| + | icon: "mdi:fire" | ||
| + | accuracy_decimals: 2 | ||
| + | lambda: |- | ||
| + | return id(total_pulses) * 0.1; | ||
| + | # Optional: Diese LED soll blinken, sobald ein Signal vom Gaszähler erkannt wird | ||
| + | output: | ||
| + | - platform: gpio | ||
| + | pin: LED | ||
| + | id: 'led' | ||
| + | |||
| + | </nowiki> | ||
Aktuelle Version vom 2. März 2024, 20:16 Uhr
| gaser Status: stable | |
|---|---|
| Beschreibung | Gaszähler Impulse auslesen |
| Autor: | raphii wu|wu |
| PayPal | |
Description
Der 'Gaser' ist ein kompaktes Gerät, das an Gaszählern befestigt wird, um Verbrauchsimpulse zu erfassen und den Gasverbrauch digital zu schätzen. Der Raspberry Pi Pico W ist mit ESPhome geflasht und im Home Assistant eingebunden. Unser Gaszähler hat einen Magnet an der ersten Dezimalstelle sitzen, der den Reed-Sensor beim Umschlagen auslöst.
Hardware
- Reed-Sensor
- Raspberry Pi Pico W
- Jumperwire
- Heißkleber
Software
esphome
esphome:
name: gaser
rp2040:
board: rpipicow
framework:
# Required until https://github.com/platformio/platform-raspberrypi/pull/36 is merged
platform_version: https://github.com/maxgerhardt/platform-raspberrypi.git
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "changeme"
ota:
password: "ch"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
use_address: 10.1.42.247
# Enable fallback hotspot in case wifi connection fails
ap:
ssid: "Gaser Fallback Hotspot"
password: "changeme"
globals:
- id: total_pulses
type: int
restore_value: True
initial_value: '0' # hier kann der Gaszählerstand in Pulsen initialisiert werden. Also Zählerstand 1234,56 m3 zu 12345 bei einem G4 mit Puls 0.1
binary_sensor:
- platform: gpio
id: internal_pulse_counter
pin:
number: GPIO28
mode: INPUT_PULLUP
name: "Live-Impuls"
filters:
- delayed_on: 10ms
on_press:
then:
- lambda: id(total_pulses) += 1;
- output.turn_off: led # optional: für eine LED, die den Gaszählerpuls visualisiert
on_release:
then:
- output.turn_on: led # optional: für eine LED, die den Gaszählerpuls visualisiert
sensor:
- platform: template
name: "Gasverbrauch"
device_class: gas
unit_of_measurement: "m³"
state_class: "total_increasing"
icon: "mdi:fire"
accuracy_decimals: 2
lambda: |-
return id(total_pulses) * 0.1;
# Optional: Diese LED soll blinken, sobald ein Signal vom Gaszähler erkannt wird
output:
- platform: gpio
pin: LED
id: 'led'
