esphome:
  name: waassercompteur
  friendly_name: Waassercompteur

esp32:
  board: esp32dev

logger:

web_server:

api:
  reboot_timeout: 0s
  encryption:
    key: "<random key>"

ota:
  platform: esphome
  password: "<random key>"

wifi:
  ssid: WIFI
  password: password
  ap:
    ssid: "Waassercompteur"

captive_portal:

time:
  - platform: sntp
    id: time_sntp

external_components:
  - source: github://SzczepanLeon/esphome-components@version_4
    refresh: 0d
    components: [ wmbus ]

wmbus:
  mosi_pin: GPIO13
  miso_pin: GPIO5
  clk_pin:  GPIO2
  cs_pin:   GPIO14
  gdo0_pin: GPIO15
  gdo2_pin: GPIO16 
  all_drivers: false
  log_all: false

sensor:
  - platform: wmbus
    meter_id: 0x[ID VUM SENSUS iPERL Compteur]
    type: iperl
    key: "E6C88800DEB868C0D6A84880CE982840"
    sensors:
      - name: "RSSi"
        field: "rssi"
        accuracy_decimals: 0
        unit_of_measurement: "dBm"
        device_class: "signal_strength"
        state_class: "measurement"
        entity_category: "diagnostic"
      - name: "Waasserverbrauch (Total)"
        field: "total"
        accuracy_decimals: 3
        unit_of_measurement: "m³"
        device_class: "water"
        state_class: "total_increasing"
        icon: "mdi:water"
  - platform: uptime
    type: timestamp
    name: ESP32 Startzäit
text_sensor:
  - platform: wmbus
    meter_id: 0x[ID VUM SENSUS iPERL Compteur]
    type: iperl
    key: "E6C88800DEB868C0D6A84880CE982840"
    sensors:
      - name: "Zäitstempel"
        field: "timestamp"
