mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-15 13:26:54 +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 %}
|
||||
|
||||
```yaml
|
||||
binary_sensor:
|
||||
- platform: template
|
||||
sensors:
|
||||
motion_battery_low:
|
||||
value_template: "{{ state_attr('sensor.motion', 'battery') < 15 }}"
|
||||
friendly_name: "Motion battery is low"
|
||||
template:
|
||||
- binary_sensor:
|
||||
- name: "Motion Battery is Low"
|
||||
state: "{{ state_attr('sensor.motion', 'battery') | float(default=0) < 15 }}"
|
||||
device_class: battery
|
||||
|
||||
alert:
|
||||
motion_battery:
|
||||
name: Motion Battery is Low
|
||||
entity_id: binary_sensor.motion_battery_low
|
||||
entity_id: binary_sensor.motion_battery_is_low
|
||||
repeat: 30
|
||||
notifiers:
|
||||
- ryans_phone
|
||||
|
Loading…
x
Reference in New Issue
Block a user