Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions content/components/sensor/filter/clamp.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
2 changes: 2 additions & 0 deletions content/components/sensor/filter/delta.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand All @@ -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%
```
16 changes: 6 additions & 10 deletions content/components/sensor/filter/filter_out.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;
```
2 changes: 2 additions & 0 deletions content/components/sensor/filter/lambda.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;
```
Expand All @@ -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 {};
Expand Down
9 changes: 3 additions & 6 deletions content/components/sensor/filter/offset.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;
```
2 changes: 1 addition & 1 deletion content/components/sensor/filter/or.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions content/components/sensor/filter/round.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
20 changes: 10 additions & 10 deletions content/components/sensor/filter/round_to_multiple_of.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
6 changes: 2 additions & 4 deletions content/components/sensor/filter/skip_initial.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
6 changes: 1 addition & 5 deletions content/components/sensor/filter/throttle.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;
```
2 changes: 1 addition & 1 deletion content/components/sensor/filter/throttle_with_priority.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion content/components/sensor/filter/timeout.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions content/components/sensor/filter/to_ntc_resistance.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions content/components/sensor/filter/to_ntc_temperature.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down