Esp2866+espeasy pulse meter

hi.

I’ve searched the forum, but haven’t found exact answer :slight_smile:

i want to add watermeter measurement to HA, i’ve already done that, but readings are resetted to initial value when esp reboots, which is inacceptable for me :wink:

so, how to configure counter sensor which get data from esp, counting pulses /is it delta value?/ on HA server instead of esp, i think that HA server is much more reboot-resistant.

is it possible to store last counter value - and automatically restore it after reboot?

i hope, that my english will be understood :wink:

You can use the statistics sensor to calculate the total of delta values.

The delta values from the sensor will be stored in the HA database, and so they will be able to be calculated again after HA restarts.

edit:

how to extract “count” data from statistics sensor?

I’m not sure what you mean?

adding statistics sensor - e.g watermeter gives me watermeter_mean sensor. sensor has multiple attributes - “max value” “median” “count” etc.

the question is, how to display only one of those attributes /by template i think?/ so that i have only “count” value instead of all of them /and “mean” value seen on main screen.

I think you need the template sensor to display only some attributes.

I know, but i don’t know how to do it…

so far i’ve got: “wodomierz” is my mqtt sensor getting pulses from nodemcu - works fine, “wodomierz_mean” is statistics sensor

  • platform: template
    sensors:
    wodomierz:
    friendly_name: “stan wodomierza”
    unit_of measurement: “L”
    value_template: “{{ states(‘sensor.wodomierz_mean.attributes.count’) }}”

and it didn’t work - i’ve got “unknown” reading…

adding | float gives me 0.0L reading …

edit - problem solved :slight_smile:

with - value_template: “{{ states.sensor.wodomierz_mean.attributes.count|float }}”

1 Like

Hi @woocash How can you measure you water, I looking for one solution.