mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-18 23:06:58 +00:00
Add an example for the Threshold binary sensor (#15073)
Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
parent
d85f04847a
commit
1479b2dc76
@ -60,3 +60,24 @@ name:
|
|||||||
type: string
|
type: string
|
||||||
default: Threshold
|
default: Threshold
|
||||||
{% endconfiguration %}
|
{% endconfiguration %}
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
|
||||||
|
### Is the temperature rising or falling
|
||||||
|
|
||||||
|
The hysteresis parameter can be used in this use-case to avoid frequent state changes around the maximum or the minimum of a temperature curve. We also have to utilize the [derivative sensor](/integrations/derivative/) for this use-case:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
sensor:
|
||||||
|
- platform: derivative # will be positive for rising temperatures and negative for falling temperatures
|
||||||
|
source: sensor.temperature
|
||||||
|
unit_time: min
|
||||||
|
name: temperature derivative
|
||||||
|
time_window: 00:05:00
|
||||||
|
binary_sensor:
|
||||||
|
- platform: threshold # will switch state not at 0°C/min but 0.1°C/min or -0.1°C/min depending on the current state of the sensor, respectively
|
||||||
|
entity_id: sensor.temperature_derivative
|
||||||
|
upper: 0
|
||||||
|
hysteresis: 0.1 # sensor
|
||||||
|
name: temperature rising
|
||||||
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user