diff --git a/content/components/sensor/filter/clamp.md b/content/components/sensor/filter/clamp.md index f6fd9c3bcc..ebfe96d0a6 100644 --- a/content/components/sensor/filter/clamp.md +++ b/content/components/sensor/filter/clamp.md @@ -13,11 +13,9 @@ Configuration variables: ```yaml # Example configuration entry -- platform: wifi_signal - # ... - filters: - - clamp: - min_value: 10 - max_value: 75 - ignore_out_of_range: true +filters: + - clamp: + min_value: 10 + max_value: 75 + ignore_out_of_range: true ``` diff --git a/content/components/sensor/filter/delta.md b/content/components/sensor/filter/delta.md index b9e8f4c9f0..c0646c9acc 100644 --- a/content/components/sensor/filter/delta.md +++ b/content/components/sensor/filter/delta.md @@ -12,6 +12,7 @@ For example if the filter were configured with a value of 2 and the last value p only values greater than or equal to 12 or less than or equal to 8 would be passed through. ```yaml +# Example configuration entry filters: - delta: 2.0 ``` @@ -23,6 +24,7 @@ However, if the last value passed through was 100 only values greater than or eq equal to 80 would be passed through. ```yaml +# Example configuration entry filters: - delta: 20% ``` diff --git a/content/components/sensor/filter/filter_out.md b/content/components/sensor/filter/filter_out.md index 0252b0df68..ccd7e64d10 100644 --- a/content/components/sensor/filter/filter_out.md +++ b/content/components/sensor/filter/filter_out.md @@ -7,20 +7,16 @@ headless: true ```yaml # Example configuration entry -- platform: wifi_signal - # ... - filters: - - filter_out: 85.0 +filters: + - filter_out: 85.0 ``` A list of values may be supplied, and values are templatable: ```yaml # Example configuration entry -- platform: wifi_signal - # ... - filters: - - filter_out: - - 85.0 - - !lambda return id(some_sensor).state; +filters: + - filter_out: + - 85.0 + - !lambda return id(some_sensor).state; ``` diff --git a/content/components/sensor/filter/lambda.md b/content/components/sensor/filter/lambda.md index f6247a8e8c..4e14dfb908 100644 --- a/content/components/sensor/filter/lambda.md +++ b/content/components/sensor/filter/lambda.md @@ -7,6 +7,7 @@ Perform a simple mathematical operation over the sensor values. The input value the result of the lambda is used as the output (use `return` ). ```yaml +# Example configuration entry filters: - lambda: return x * (9.0/5.0) + 32.0; ``` @@ -17,6 +18,7 @@ result in integers (not floating point values). To prevent values from being published, return `{}` : ```yaml +# Example configuration entry filters: - lambda: |- if (x < 10) return {}; diff --git a/content/components/sensor/filter/offset.md b/content/components/sensor/filter/offset.md index a208b57480..e918f6e935 100644 --- a/content/components/sensor/filter/offset.md +++ b/content/components/sensor/filter/offset.md @@ -7,10 +7,7 @@ Adds a value to each sensor value. The value may be a constant or a lambda retur ```yaml # Example configuration entry -- platform: adc - # ... - filters: - - offset: 2.0 - - multiply: 1.2 - - offset: !lambda return id(some_sensor).state; +filters: + - offset: 2.0 + - offset: !lambda return id(some_sensor).state; ``` diff --git a/content/components/sensor/filter/or.md b/content/components/sensor/filter/or.md index 077fe188c5..097071f9b6 100644 --- a/content/components/sensor/filter/or.md +++ b/content/components/sensor/filter/or.md @@ -8,7 +8,7 @@ will only pass forward values that are *either* at least 1s old or are if the ab difference is at least 5.0. ```yaml -# Example filters: +# Example configuration entry filters: - or: - throttle: 1s diff --git a/content/components/sensor/filter/round.md b/content/components/sensor/filter/round.md index 268316970c..4033686bab 100644 --- a/content/components/sensor/filter/round.md +++ b/content/components/sensor/filter/round.md @@ -6,7 +6,7 @@ headless: true Rounds the value to the given decimal places. ```yaml -- platform: ... - filters: - - round: 1 # will round to 1 decimal place +# Example configuration entry +filters: + - round: 1 # will round to 1 decimal place ``` diff --git a/content/components/sensor/filter/round_to_multiple_of.md b/content/components/sensor/filter/round_to_multiple_of.md index a53b31c89b..3c55a35b61 100644 --- a/content/components/sensor/filter/round_to_multiple_of.md +++ b/content/components/sensor/filter/round_to_multiple_of.md @@ -6,15 +6,15 @@ headless: true Rounds the value to the nearest multiple. Takes a float greater than zero. ```yaml -- platform: ... - filters: - - round_to_multiple_of: 10 - # 123 -> 120 - # 126 -> 130 +# Example configuration entry +filters: + - round_to_multiple_of: 10 + # 123 -> 120 + # 126 -> 130 -- platform: ... - filters: - - round_to_multiple_of: 0.25 - # 3.1415 -> 3.25 - # 1.6180 -> 1.5 +# Example configuration entry +filters: + - round_to_multiple_of: 0.25 + # 3.1415 -> 3.25 + # 1.6180 -> 1.5 ``` diff --git a/content/components/sensor/filter/skip_initial.md b/content/components/sensor/filter/skip_initial.md index f2b390564d..0cdd3bd806 100644 --- a/content/components/sensor/filter/skip_initial.md +++ b/content/components/sensor/filter/skip_initial.md @@ -9,8 +9,6 @@ readings have been skipped, this filter does nothing. ```yaml # Example configuration entry -- platform: wifi_signal - # ... - filters: - - skip_initial: 3 +filters: + - skip_initial: 3 ``` diff --git a/content/components/sensor/filter/throttle.md b/content/components/sensor/filter/throttle.md index 6271fd7031..251f459913 100644 --- a/content/components/sensor/filter/throttle.md +++ b/content/components/sensor/filter/throttle.md @@ -8,11 +8,7 @@ it checks if the last incoming value is at least `specified time period` old. If it is not older than the configured value, the value is not passed forward. ```yaml -# Example filters: +# Example configuration entry filters: - throttle: 1s - - heartbeat: 5s - - debounce: 0.1s - - delta: 5.0 - - lambda: return x * (9.0/5.0) + 32.0; ``` diff --git a/content/components/sensor/filter/throttle_with_priority.md b/content/components/sensor/filter/throttle_with_priority.md index 36932e2b3d..7107d57872 100644 --- a/content/components/sensor/filter/throttle_with_priority.md +++ b/content/components/sensor/filter/throttle_with_priority.md @@ -9,7 +9,7 @@ checks if the last incoming value is at least `specified time period` old. If it value, the value is not passed forward. ```yaml -# Example filters: +# Example configuration entry filters: - throttle_with_priority: timeout: 1s diff --git a/content/components/sensor/filter/timeout.md b/content/components/sensor/filter/timeout.md index 7ccf574f0b..c0ae5c669c 100644 --- a/content/components/sensor/filter/timeout.md +++ b/content/components/sensor/filter/timeout.md @@ -13,7 +13,7 @@ This filter particularly is useful when: - placed ahead of a throttle filter to ensure that the last value published will pass through the throttle. ```yaml -# Example filters: +# Example configuration entry filters: - timeout: 10s # sent value will be NaN - timeout: diff --git a/content/components/sensor/filter/to_ntc_resistance.md b/content/components/sensor/filter/to_ntc_resistance.md index 9b65cafa60..ac070d4fcb 100644 --- a/content/components/sensor/filter/to_ntc_resistance.md +++ b/content/components/sensor/filter/to_ntc_resistance.md @@ -19,6 +19,7 @@ temperatures) and note the resistance values at these temperatures. Then enter these values in the calibration parameter: ```yaml +# Example configuration entry - platform: template id: to_ntc_resistance_sensor1 unit_of_measurement: "Ohm" @@ -37,6 +38,7 @@ The filter determines coefficients for the `Steinhart-Hart`_ equation from the s pairs of values which can also be specified directly as an alternative. ```yaml +# Example configuration entry - platform: template id: to_ntc_resistance_sensor2 unit_of_measurement: "Ohm" @@ -59,6 +61,7 @@ An output component can accept values in the range of `0..1` (see [`output.set_l so that scaling with the actual resistance value of the simulated NTC is required. ```yaml +# Example configuration entry on_value: then: - output.set_level: diff --git a/content/components/sensor/filter/to_ntc_temperature.md b/content/components/sensor/filter/to_ntc_temperature.md index c85ca42c80..d938d0e590 100644 --- a/content/components/sensor/filter/to_ntc_temperature.md +++ b/content/components/sensor/filter/to_ntc_temperature.md @@ -19,6 +19,7 @@ temperatures) and note the resistance values at these temperatures. Then enter these values in the calibration parameter: ```yaml +# Example configuration entry - platform: template id: to_ntc_temperature_sensor1 unit_of_measurement: "°C" @@ -37,6 +38,7 @@ The filter determines coefficients for the `Steinhart-Hart`_ equation from the s pairs of values which can also be specified directly as an alternative. ```yaml +# Example configuration entry - platform: template id: to_ntc_temperature_sensor2 unit_of_measurement: "°C"