Thanks for this, fixed my problem by comparing configs.
My ESP config was missing device_class and state_class.
I changed the measurement unit from M3 to m³ also, although I don’t think that was part of the problem.
After changing measurement unit, don’t forget to ‘Fix’ statistics too as described here above.
Dont understand how to set this up
i have a flow sensor which gives me the current flow rate, not accumlating usage.
do i need to put it through utility meter first to get it to count ? and then set it up for energy dashboard?
Hi,
if you only have a flow-rate you first must calculate the absolute value. If you have the flow every 5 minutes, you must add every 5 minutes your value to a counter. You need a always increasing value.
I also tried for hours to add the water consumption to the energy dashboard.
Ich habe an meinem Wasserzähler ein “KY-033 Linien Folger Line Tracking Sensor Modul TCRT5000”, das ich über den Analogport an einem ESP8266 angeschlossen ist, der in ESPHome eingebunden ist. Mit den Digitalen Ausgang habe ich an manchen Stellungen des Liter-Zeigers falsche Impulse bekommen, wenn der Zeiger an bestimmten Stellen stehenblieb.
Mit dem analogen Auslesen gibt es kein Problem mehr. Ich habe den A0 Port direkt mit dem Kollektor des IR-Transistors verbunden. Die Schwellwerte habe ich so gesetzt, dass genügend Hysterese zwischen ON und OFF ist.
Für das Energie-Dashboard habe ich einen Template-Sensor angelegt, dieser muss die Einheit m³ haben.
ESPHome:
#Helper that is Switched on and off by Analog Value
switch:
- platform: gpio
id: ipin
pin: 13
# Analogsensor connected to IR-Transistor
sensor:
- platform: adc
id: ntc_source
name: 'Water Meter Analog IN'
#internal: true
disabled_by_default: true
pin: A0
update_interval: 0.2s
filters:
- or:
- throttle: 10s
- delta: 0.01
on_value_range:
- below: 0.17
then:
- switch.turn_off: ipin
- above: 0.20
then:
- switch.turn_on: ipin
- platform: pulse_counter
pin: 15 #verbunden mit Pin 13
unit_of_measurement: 'l'
name: 'Water Meter House'
id: pulse_water_counter
update_interval: 60 s
internal_filter: 50ms
count_mode:
rising_edge: DISABLE
falling_edge: INCREMENT
total:
unit_of_measurement: 'm3'
name: 'Water Meter Total House'
state_class: total_increasing
id: m3_Total
filters:
- multiply: 0.001 # (1/1000 pulses per m3)
accuracy_decimals: 3
Recently I came across the same problem: all three config params are correct but no sensor in Energy dashboard settings. It appeared that another one precondition must have been met - the sensor’s data must be recorded to DB, and this is not quite obvious. I have custom settings for recorder, not to overload the DB with hundreds unneeded sensors, so after I manually added my water meters sensors to recorder config and restarted HASS - all works.