Question on Intergration Sensor

I have just calibrated my rain bucket to the result of a pulse counter sensor. I want to add integration sensor but the output doesnt match the pulse counter sensor.

[23:49:12][D][pulse_counter:159]: 'Rain Bucket': Retrieved counter: 4.00 pulses/min
[23:49:12][D][sensor:092]: 'Rain Bucket': Sending state 1.02564 mm/min with 2 decimals of accuracy
[23:49:12][D][sensor:092]: 'Total Daily Rain': Sending state 0.27766 mm with 4 decimals of accuracy
[23:49:12][D][pulse_counter:164]: 'Rain Bucket': Total : 4 pulses
[23:50:12][D][pulse_counter:159]: 'Rain Bucket': Retrieved counter: 0.00 pulses/min
[23:50:12][D][sensor:092]: 'Rain Bucket': Sending state 0.00000 mm/min with 2 decimals of accuracy
[23:50:12][D][sensor:092]: 'Total Daily Rain': Sending state 0.81869 mm with 4 decimals of accuracy
[23:50:12][D][pulse_counter:164]: 'Rain Bucket': Total : 4 pulses
[23:50:12][D][sensor:092]: 'Energy Meter House': Sending state 4.00000 kWh with 0 decimals of accuracy

  - platform: pulse_counter
    pin: 12
    name: "Rain Bucket" # 3.9pulses / 1mm rain
    unit_of_measurement: 'mm/min' # pulse / min
    filters:
      - multiply: 0.2564102564102564 # (60s/1000 pulses per kWh)
    id: rain_bucket
    icon: 'mdi:weather-rainy'
    # accuracy_decimals: 4
    total:  
      unit_of_measurement: 'kWh'
      name: 'Energy Meter House'
  - platform: integration
    name: "Total Daily Rain"
    sensor: rain_bucket
    unit_of_measurement: 'mm'
    icon: 'mdi:weather-rainy'
    time_unit: min

Why are you measuring rain in kWh?

:thinking:

I forgot to change it. I was just using “total” to check total pulses. I want to remove that when I get the correct value from integration.

Looks like the pulse counter total reporting does not include the filter.

Setting the integration_method to left may give you less error for this sort of input.

Thanks tom. Left worked while right didnt. I have been browsing over this parameter many times but never thought this could be the culprit.

[00:29:36][D][sensor:092]: ‘Rain Bucket’: Sending state 1.02564 mm/min with 2 decimals of accuracy
[00:29:36][D][sensor:092]: ‘Total Daily Rain’: Sending state 0.00000 mm with 4 decimals of accuracy
[00:32:36][D][sensor:092]: ‘Rain Bucket’: Sending state 0.00000 mm/min with 2 decimals of accuracy
[00:32:36][D][sensor:092]: ‘Total Daily Rain’: Sending state 1.02573 mm with 4 decimals of accuracy

Btw, what is the difference between trapezoid, left and right? The wiki didnt explain each option.

1 Like