Folgender Fehler beim Validate:
INFO ESPHome 2025.7.5
INFO Reading configuration /config/esphome/hzg-temperatur.yaml…
Failed config
binary_sensor.template: [source /config/esphome/hzg-temperatur.yaml:93]
platform: template
name: Gasverbrauch-m3
device_class: gas
[unit_of_measurement] is an invalid option for [binary_sensor.template]. Please check the indentation.
unit_of_measurement: m³
[state_class] is an invalid option for [binary_sensor.template]. Did you mean [state_topic], [on_state_change], [device_class]?
state_class: total_increasing
icon: mdi:fire
[accuracy_decimals] is an invalid option for [binary_sensor.template]. Please check the indentation.
accuracy_decimals: 2
lambda: |-
return id(total_pulses) * id(impuls_ratio);
ESP_LOGD(„Gaszähler m³ TAG“, „Pulse bisher: %d“, id(total_pulses));
Config sieht so aus:
# Gaszähler - zählt alle Impulse hoch und rechnet diese um in m³
- platform: template
name: "Gasverbrauch-m3"
device_class: gas
unit_of_measurement: "m³"
state_class: "total_increasing"
icon: "mdi:fire"
accuracy_decimals: 2
lambda: |-
return id(total_pulses) * id(impuls_ratio);
ESP_LOGD("Gaszähler m³ TAG", "Pulse bisher: %d", id(total_pulses));
# Gaszähler - zählt alle Impulse hoch, umrechnung in kWh (mal 9,957 - Stand Aug.2025) GAS
- platform: template
name: "Gasverbrauch-kWh"
device_class: gas
unit_of_measurement: "kWh"
state_class: "total_increasing"
icon: "mdi:fire"
accuracy_decimals: 2
lambda: |-
return id(total_pulses) * id(impuls_ratio) * 9.957;
ESP_LOGD("Gaszähler kWh TAG", "Pulse bisher: %d", id(total_pulses));