A basic counter with for use with automation.
Functionality could extended if

  • It could be reset a a certain time/day/week or date.
  • Values can be incremented and decremented

Example usage.

  • Count how many times my door have been opened during a day.
  • Track times something has been triggered.

Example configuration.yaml entry

  platform: counter
  name: "MQTT Sensor"
  unit_of_measurement: "L"
  reset_time: "22:00"
  increment: "1"
  decrement: "10"

I have 2 mqtt sensors that counts pulses in Wh and 1 mqtt sensor that counts pulses of 10L natural gas.

It could be very nice to show kWh or gas used in the last 15min, 60 min, current usage today, yearly and so on.

If this can already be done today, please tell my how :slight_smile:

The statistics sensor contains a counter.

I’ve got similar pulse sensors on my utility meters , did you figure out a way to calculate this in Home Assistant?

Yeah I did solve it :slight_smile:
I have written a small mqtt client that subscribes to the counter and convert the result to W…