mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-15 05:16:49 +00:00
Use modern template binary-sensor in example (#20029)
This commit is contained in:
parent
330298aba3
commit
35884cda86
@ -158,17 +158,16 @@ conjunction with a `Template Binary Sensor`. The following example does that.
|
|||||||
{% raw %}
|
{% raw %}
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
binary_sensor:
|
template:
|
||||||
- platform: template
|
- binary_sensor:
|
||||||
sensors:
|
- name: "Motion Battery is Low"
|
||||||
motion_battery_low:
|
state: "{{ state_attr('sensor.motion', 'battery') | float(default=0) < 15 }}"
|
||||||
value_template: "{{ state_attr('sensor.motion', 'battery') < 15 }}"
|
device_class: battery
|
||||||
friendly_name: "Motion battery is low"
|
|
||||||
|
|
||||||
alert:
|
alert:
|
||||||
motion_battery:
|
motion_battery:
|
||||||
name: Motion Battery is Low
|
name: Motion Battery is Low
|
||||||
entity_id: binary_sensor.motion_battery_low
|
entity_id: binary_sensor.motion_battery_is_low
|
||||||
repeat: 30
|
repeat: 30
|
||||||
notifiers:
|
notifiers:
|
||||||
- ryans_phone
|
- ryans_phone
|
||||||
|
Loading…
x
Reference in New Issue
Block a user