Gaser

Crystal Clear action run.png
gaser

Status: unbekannt

Gaser counter.png
Beschreibung Gaszähler Impulse auslesen
Autor: raphii wu|wu
PayPal Spenden für Gaser

Description

Gaser pipicow.jpg Gaser pipicow top.jpg

Hardware

ReedSensor Raspipico


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'