From 5a2698745e90a3818f1014ee201bc42d777dbbe8 Mon Sep 17 00:00:00 2001 From: Chris Turra Date: Mon, 11 Oct 2021 07:56:14 -0700 Subject: [PATCH] update Brother integration examples with new template sensor format (#19656) Co-authored-by: Franck Nijhof --- source/_integrations/brother.markdown | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/source/_integrations/brother.markdown b/source/_integrations/brother.markdown index 38131400b01..db3a927dc9d 100644 --- a/source/_integrations/brother.markdown +++ b/source/_integrations/brother.markdown @@ -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