Frequently update a sensor value for usage in ESPHome, update HA less often

Hi there!

I’m playing around with a soil moisture sensor in combination with a small pump.
The goal is to automatically water my plant when the soil moisture voltage reaches a certain threshold (pump on) and stop the pump again when another threshold has been reached.

I’ve set the update_interval of the soil moisture sensor to 1second. The soil moisture sensor updates very quickly and the pump gets stopped in time before the soil gets too wet.

The only downside of this approach is that the device is also sending updates to home assistant every second. This is a bit too much, since the values would not change that quickly if the pump is not on.

I tried the sliding_window_moving_average configuration and I hoped it would use the value for turning on / off the pump without sending updates to home assistant. But unfortunately this is not working in the way that I expected.

How can I turn on / off the pump (switch) on the device but only send out updates every couple of minutes to home assistant?

instead of making it complex programming why not put the machine in a sleep mode for 15min to 1 hour ? do the check and return to sleep

1 Like

Make the sensor controlling the pump local only by setting internal: true

Then make a new template sensor that will report to HA on a suitable update interval.

I am assuming the pump is controlled by the same ESP as the sensor it attached to.

Thanks! Internal was the solution I was looking for. I achieved the same by simply removing the name.