From 62cfb78c9f1e430dc3cb0bb50f21c197e3c4a468 Mon Sep 17 00:00:00 2001 From: Petr Kejval Date: Mon, 6 Oct 2025 13:07:12 +0200 Subject: [PATCH 1/5] optimistic mode --- content/components/sensor/filter/heartbeat.md | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/content/components/sensor/filter/heartbeat.md b/content/components/sensor/filter/heartbeat.md index fd73ad0eb7..c1c31da549 100644 --- a/content/components/sensor/filter/heartbeat.md +++ b/content/components/sensor/filter/heartbeat.md @@ -3,9 +3,16 @@ description: "" headless: true --- -Send the value periodically with the specified time interval. -If the sensor value changes during the interval the interval will not reset. -The last value of the sensor will be sent. +Send the sensor value periodically at the specified time interval. If the sensor value changes during this interval, the timer will not reset — the last known value of the sensor will still be sent when the interval elapses. -So a value of `10s` will cause the filter to output values every 10s regardless -of the input values. +For example, a value of `10s` will cause the filter to output the last known value every 10 seconds, regardless of how often the input value changes. + +When using `optimistic` mode, the filter will still repeat the last known value at the configured interval, but in addition, every new incoming value is published immediately as it arrives. +This ensures that the sensor output updates instantly on change, while maintaining a steady periodic "heartbeat" of the last value between updates. This mode is useful for sensors where immediate responsiveness is desired. + +Configuration variables: + +- **period** (Required, time): +The interval at which the last known value is republished. +- **optimistic** (*Optional*, boolean): +When enabled, every new incoming value is published immediately as it arrives, regardless of the configured time interval. From 1b84646ad5f5d0989a9d576c1bc3a2532a5d0b0d Mon Sep 17 00:00:00 2001 From: Petr Kejval Date: Mon, 6 Oct 2025 13:19:55 +0200 Subject: [PATCH 2/5] fix space --- content/components/sensor/filter/heartbeat.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/components/sensor/filter/heartbeat.md b/content/components/sensor/filter/heartbeat.md index c1c31da549..411f894c35 100644 --- a/content/components/sensor/filter/heartbeat.md +++ b/content/components/sensor/filter/heartbeat.md @@ -14,5 +14,5 @@ Configuration variables: - **period** (Required, time): The interval at which the last known value is republished. -- **optimistic** (*Optional*, boolean): +- **optimistic** (*Optional*, boolean): When enabled, every new incoming value is published immediately as it arrives, regardless of the configured time interval. From 0b0add95db6a40009c05073e1e67e2098d2ee303 Mon Sep 17 00:00:00 2001 From: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com> Date: Tue, 21 Oct 2025 09:04:28 -0400 Subject: [PATCH 3/5] Fix line length --- content/components/sensor/filter/heartbeat.md | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/content/components/sensor/filter/heartbeat.md b/content/components/sensor/filter/heartbeat.md index 411f894c35..1c92a5b37b 100644 --- a/content/components/sensor/filter/heartbeat.md +++ b/content/components/sensor/filter/heartbeat.md @@ -3,16 +3,20 @@ description: "" headless: true --- -Send the sensor value periodically at the specified time interval. If the sensor value changes during this interval, the timer will not reset — the last known value of the sensor will still be sent when the interval elapses. +Send the sensor value periodically at the specified time interval. If the sensor value changes +during this interval, the timer will not reset — the last known value of the sensor will still +be sent when the interval elapses. -For example, a value of `10s` will cause the filter to output the last known value every 10 seconds, regardless of how often the input value changes. +For example, a value of `10s` will cause the filter to output the last known value every 10 seconds, +regardless of how often the input value changes. -When using `optimistic` mode, the filter will still repeat the last known value at the configured interval, but in addition, every new incoming value is published immediately as it arrives. -This ensures that the sensor output updates instantly on change, while maintaining a steady periodic "heartbeat" of the last value between updates. This mode is useful for sensors where immediate responsiveness is desired. +When using `optimistic` mode, the filter will still repeat the last known value at the configured interval, +but in addition, every new incoming value is published immediately as it arrives. This ensures that the +sensor output updates instantly on change, while maintaining a steady periodic "heartbeat" of the last value +between updates. This mode is useful for sensors where immediate responsiveness is desired. Configuration variables: -- **period** (Required, time): -The interval at which the last known value is republished. -- **optimistic** (*Optional*, boolean): -When enabled, every new incoming value is published immediately as it arrives, regardless of the configured time interval. +- **period** (Required, time): The interval at which the last known value is republished. +- **optimistic** (*Optional*, boolean): When enabled, every new incoming value is published immediately as it + arrives, regardless of the configured time interval. From 5adc2722d9193712166055e730b89ff1263d6519 Mon Sep 17 00:00:00 2001 From: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com> Date: Tue, 21 Oct 2025 09:12:36 -0400 Subject: [PATCH 4/5] Add examples --- content/components/sensor/filter/heartbeat.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/content/components/sensor/filter/heartbeat.md b/content/components/sensor/filter/heartbeat.md index 1c92a5b37b..8fb9550d0e 100644 --- a/content/components/sensor/filter/heartbeat.md +++ b/content/components/sensor/filter/heartbeat.md @@ -20,3 +20,12 @@ Configuration variables: - **period** (Required, time): The interval at which the last known value is republished. - **optimistic** (*Optional*, boolean): When enabled, every new incoming value is published immediately as it arrives, regardless of the configured time interval. + +```yaml +# Example filters: +filters: + - heartbeat: 5s + - heartbeat: + period: 5s + optimistic: true +``` From 9b2bcf3a5acbfa43dd60f33317ca9f0d6bf321c7 Mon Sep 17 00:00:00 2001 From: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com> Date: Tue, 21 Oct 2025 09:15:29 -0400 Subject: [PATCH 5/5] Clean up example --- content/components/sensor/filter/heartbeat.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/components/sensor/filter/heartbeat.md b/content/components/sensor/filter/heartbeat.md index 8fb9550d0e..4db73688ff 100644 --- a/content/components/sensor/filter/heartbeat.md +++ b/content/components/sensor/filter/heartbeat.md @@ -22,7 +22,7 @@ Configuration variables: arrives, regardless of the configured time interval. ```yaml -# Example filters: +# Example filters filters: - heartbeat: 5s - heartbeat: