I have a power metering sensor(this is just an example, it can be other sensors) and I’d like it to send updates only if:
- last value was sent 20s ago
- or if value has changed by more than 20% and last value was sent 1s ago
sensor:
- platform: hlw8012
model: BL0937
update_interval: 0.1s
power:
name: "Power"
filters:
- median:
window_size: 7
send_every: 4
send_first_at: 3
- throttle: 1s
- or:
- throttle: 20s
- delta: 20%
After testing, this code works as expected. But there is one thing I don’t understand, What should “update_interval” be set to?