mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-18 23:06:58 +00:00
update Brother integration examples with new template sensor format (#19656)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
parent
7e079e8e21
commit
5a2698745e
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user