Add sensor example for brother printer integration (#16373)

Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
Phil Hollenback 2021-02-01 04:39:52 -08:00 committed by GitHub
parent 3eb6856495
commit c7bf104952
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,7 +29,51 @@ Some very old Brother printers use different data format and these models are no
## Configuring the printer ## 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). 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) ![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.