mirror of
https://github.com/esphome/esphome-docs.git
synced 2025-02-04 23:52:18 +01:00
Document filter changes (#4418)
This commit is contained in:
parent
9853544bfd
commit
edb9e1021d
@ -127,12 +127,14 @@ Filters are processed in the order they are defined in your configuration.
|
|||||||
# Example filters:
|
# Example filters:
|
||||||
filters:
|
filters:
|
||||||
- offset: 2.0
|
- offset: 2.0
|
||||||
- multiply: 1.2
|
- multiply: !lambda return 1.2;
|
||||||
- calibrate_linear:
|
- calibrate_linear:
|
||||||
- 0.0 -> 0.0
|
- 0.0 -> 0.0
|
||||||
- 40.0 -> 45.0
|
- 40.0 -> 45.0
|
||||||
- 100.0 -> 102.5
|
- 100.0 -> 102.5
|
||||||
- filter_out: 42.0
|
- filter_out:
|
||||||
|
- 42.0
|
||||||
|
- 43.0
|
||||||
- median:
|
- median:
|
||||||
window_size: 5
|
window_size: 5
|
||||||
send_every: 5
|
send_every: 5
|
||||||
@ -162,7 +164,7 @@ Filters are processed in the order they are defined in your configuration.
|
|||||||
``offset``
|
``offset``
|
||||||
**********
|
**********
|
||||||
|
|
||||||
Adds a constant value to each sensor value.
|
Adds a value to each sensor value. The value may be a constant or a lambda returning a float.
|
||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
@ -172,11 +174,12 @@ Adds a constant value to each sensor value.
|
|||||||
filters:
|
filters:
|
||||||
- offset: 2.0
|
- offset: 2.0
|
||||||
- multiply: 1.2
|
- multiply: 1.2
|
||||||
|
- offset: !lambda return id(some_sensor).state;
|
||||||
|
|
||||||
``multiply``
|
``multiply``
|
||||||
************
|
************
|
||||||
|
|
||||||
Multiplies each value by a constant value.
|
Multiplies each value by a templatable value.
|
||||||
|
|
||||||
.. _sensor-filter-calibrate_linear:
|
.. _sensor-filter-calibrate_linear:
|
||||||
|
|
||||||
@ -260,6 +263,20 @@ degree with a least squares solver.
|
|||||||
filters:
|
filters:
|
||||||
- filter_out: 85.0
|
- filter_out: 85.0
|
||||||
|
|
||||||
|
A list of values may be supplied, and values are templatable:
|
||||||
|
|
||||||
|
|
||||||
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
# Example configuration entry
|
||||||
|
- platform: wifi_signal
|
||||||
|
# ...
|
||||||
|
filters:
|
||||||
|
- filter_out:
|
||||||
|
- 85.0
|
||||||
|
- !lambda return id(some_sensor).state;
|
||||||
|
|
||||||
|
|
||||||
``clamp``
|
``clamp``
|
||||||
*********
|
*********
|
||||||
|
|
||||||
@ -542,7 +559,7 @@ of the input values.
|
|||||||
************
|
************
|
||||||
|
|
||||||
After the first value has been sent, if no subsequent value is published within the
|
After the first value has been sent, if no subsequent value is published within the
|
||||||
``specified time period``, send a value which defaults to ``NaN``.
|
``specified time period``, send a templatable value which defaults to ``NaN``.
|
||||||
Especially useful when data is derived from some other communication
|
Especially useful when data is derived from some other communication
|
||||||
channel, e.g. a serial port, which can potentially be interrupted.
|
channel, e.g. a serial port, which can potentially be interrupted.
|
||||||
|
|
||||||
@ -553,7 +570,7 @@ channel, e.g. a serial port, which can potentially be interrupted.
|
|||||||
- timeout: 10s # sent value will be NaN
|
- timeout: 10s # sent value will be NaN
|
||||||
- timeout:
|
- timeout:
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
value: 0
|
value: !lambda return 0;
|
||||||
|
|
||||||
``debounce``
|
``debounce``
|
||||||
************
|
************
|
||||||
|
Loading…
Reference in New Issue
Block a user