Gaser: Unterschied zwischen den Versionen
Raphii (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung |
Raphii (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung |
||
| Zeile 14: | Zeile 14: | ||
[[Datei:gaser_pipicow.jpg]] | [[Datei:gaser_pipicow.jpg]] | ||
[[Datei:gaser_pipicow_top.jpg]] | |||
== Hardware == | == Hardware == | ||
| Zeile 25: | Zeile 25: | ||
esphome | esphome | ||
<nowiki> | |||
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: false | |||
initial_value: '0' # hier kann der Gaszählerstand initialisiert werden | |||
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' | |||
</nowiki> | |||
Version vom 29. November 2022, 22:38 Uhr
Status: unbekannt | |
|---|---|
| Beschreibung | Gaszähler Impulse auslesen |
| Autor: | raphii wu|wu |
| PayPal | |
Description
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: false
initial_value: '0' # hier kann der Gaszählerstand initialisiert werden
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'



