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 ## 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 %} {% raw %}
```yaml ```yaml
- platform: template template:
sensors: - binary_sensor:
laser_out_of_paper: - name: 'Laser Printer Out Of Paper'
value_template: "{{ is_state('sensor.hl_l2340d_status', 'no paper') }}" state: >
friendly_name: "Laser Printer Out of Paper" {{ is_state('sensor.hl_l2340d_status', 'no paper') }}
- platform: template
sensors: - binary_sensor:
laser_paper_jam: - name: 'Later Printer Paper Jam'
value_template: "{{ is_state('sensor.hl_l2340d_status', 'paper jam') }}" state: >
friendly_name: "Laser Printer Paper Jam" {{ is_state('sensor.hl_l2340d_status', 'paper jam') }}
``` ```
{% endraw %} {% endraw %}
@ -62,14 +62,15 @@ Then, add this under the `alert:` section:
laser_out_of_paper: laser_out_of_paper:
name: Laser Printer is Out of Paper name: Laser Printer is Out of Paper
done_message: Laser Printer Has 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 can_acknowledge: true
notifiers: notifiers:
- my_phone_notify - my_phone_notify
laser_paper_jam: laser_paper_jam:
name: Laser Printer has a Paper Jam name: Laser Printer has a Paper Jam
done_message: Laser Printer Paper Jam Cleared 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 can_acknowledge: true
notifiers: notifiers:
- my_phone_notify - my_phone_notify