update Brother integration examples with new template sensor format (#19656)

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
Chris Turra 2021-10-11 07:56:14 -07:00 committed by GitHub
parent 7e079e8e21
commit 5a2698745e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,21 +37,21 @@ For some Brother devices, `SNMPv3 read-write access and v1/v2c read-only access`
## Sensor Example
You can configure Home Assistant to alert you when the printer jams or runs out of paper as follows. First, add the following to `configuration.yaml` under the `binary_sensor:` section (replace `sensor.hl_l2340d_status` with the actual name of your sensor):
You can configure Home Assistant to alert you when the printer jams or runs out of paper as follows. First, add the following to `configuration.yaml` under the `template:` section (Note: replace `sensor.hl_l2340d_status` with the actual name of your sensor):
{% raw %}
```yaml
- platform: template
sensors:
laser_out_of_paper:
value_template: "{{ is_state('sensor.hl_l2340d_status', 'no paper') }}"
friendly_name: "Laser Printer Out of Paper"
- platform: template
sensors:
laser_paper_jam:
value_template: "{{ is_state('sensor.hl_l2340d_status', 'paper jam') }}"
friendly_name: "Laser Printer Paper Jam"
template:
- binary_sensor:
- name: 'Laser Printer Out Of Paper'
state: >
{{ is_state('sensor.hl_l2340d_status', 'no paper') }}
- binary_sensor:
- name: 'Later Printer Paper Jam'
state: >
{{ is_state('sensor.hl_l2340d_status', 'paper jam') }}
```
{% endraw %}
@ -62,14 +62,15 @@ Then, add this under the `alert:` section:
laser_out_of_paper:
name: Laser Printer is Out of Paper
done_message: Laser Printer Has Paper
entity_id: binary_sensor.laser_out_of_paper
entity_id: binary_sensor.laser_printer_out_of_paper
can_acknowledge: true
notifiers:
- my_phone_notify
laser_paper_jam:
name: Laser Printer has a Paper Jam
done_message: Laser Printer Paper Jam Cleared
entity_id: binary_sensor.laser_paper_jam
entity_id: binary_sensor.laser_printer_paper_jam
can_acknowledge: true
notifiers:
- my_phone_notify