From c7bf104952424fc0e620320ed441c9e699e9ccb0 Mon Sep 17 00:00:00 2001 From: Phil Hollenback Date: Mon, 1 Feb 2021 04:39:52 -0800 Subject: [PATCH] Add sensor example for brother printer integration (#16373) Co-authored-by: Franck Nijhof --- source/_integrations/brother.markdown | 46 ++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/source/_integrations/brother.markdown b/source/_integrations/brother.markdown index d153dce7d60..14648d2b7a4 100644 --- a/source/_integrations/brother.markdown +++ b/source/_integrations/brother.markdown @@ -29,7 +29,51 @@ Some very old Brother printers use different data format and these models are no ## Configuring the printer -To set SNMP, navigate to the printer's web interface (for example: `http://192.168.5.6`) and turn it on under Network / Protocol / SNMP. +To enable SNMP, navigate to the printer's web interface (for example: `http://192.168.5.6`) and turn it on under Network / Protocol / SNMP. For some Brother devices, `SNMPv3 read-write access and v1/v2c read-only access` is the option required (under advanced settings). ![SNMP settings on Brother Printer web interface](/images/integrations/brother/brother-printer-webui.png) + +## 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): + +{% 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' +``` + +{% endraw %} + +Then, add this under the `alert:` section: + +```yaml + 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 + 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 + can_acknowledge: true + notifiers: + - my_phone_notify +``` + +The above will send an alert for paper jam or out of paper whenever the condition is detected, assuming you have the Home Assistant app configured on your phone so that alerts can be sent directly to it. If you don't use the Home Assistant app, you will need to set up a different notifier. + +Change `my_phone_notify` to the actual notifier you are using.