Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
fabaff authored Sep 7, 2018
1 parent 891fe5c commit cbf5cd7
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions source/_components/sensor.snmp.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ port:
type: string
default: '161'
community:
description: The SNMP community which is set for the device for SNMP v1 and v2c. Most devices have a default community set to `public` with read-only permission (which is sufficient).
description: "The SNMP community which is set for the device for SNMP v1 and v2c. Most devices have a default community set to `public` with read-only permission (which is sufficient)."
required: false
type: string
default: 'public'
Expand Down Expand Up @@ -71,7 +71,7 @@ priv_protocol:
type: string
default: 'none'
version:
description: Version of SNMP protocol, `1`, `2c` or `3`. Version `2c` or higher is needed to read data from 64-bit counters.
description: "Version of SNMP protocol, `1`, `2c` or `3`. Version `2c` or higher is needed to read data from 64-bit counters."
required: false
type: string
default: '1'
Expand All @@ -84,15 +84,16 @@ unit_of_measurement:
required: false
type: string
value_template:
description: Defines a [template](/docs/configuration/templating/#processing-incoming-data) to parse the value.
description: "Defines a [template](/docs/configuration/templating/#processing-incoming-data) to parse the value."
required: false
type: template
accept_errors:
description: Determines whether the sensor should start and keep working even if the SNMP host is unreachable or not responding. This allows the sensor to be initialized properly even if, for example, your printer is not on when you start Home Assistant. Defaults to `false`.
description: "Determines whether the sensor should start and keep working even if the SNMP host is unreachable or not responding. This allows the sensor to be initialized properly even if, for example, your printer is not on when you start Home Assistant."
required: false
type: string
default: false
default_value:
description: Determines what value the sensor should take if `accept_errors` is set and the host is unreachable or not responding. If not set, the sensor will have value `unknown` in case of errors.
description: "Determines what value the sensor should take if `accept_errors` is set and the host is unreachable or not responding. If not set, the sensor will have value `unknown` in case of errors."
required: false
type: string
{% endconfiguration %}
Expand Down Expand Up @@ -139,6 +140,7 @@ According to the most common SNMP standard, the uptime of a device is accessible

To create a sensor that displays the uptime for your printer in minutes, you can use this configuration:

{% raw %}
```yaml
# Example configuration.yaml entry
sensor:
Expand All @@ -148,8 +150,9 @@ sensor:
baseoid: 1.3.6.1.2.1.1.3.0
accept_errors: true
unit_of_measurement: 'minutes'
value_template: {% raw %}'{{((value | int) / 6000) | int}}'{% endraw %}
value_template: '{{((value | int) / 6000) | int}}'
```
{% endraw %}

The `accept_errors` option will allow the sensor to work even if the printer is not on when Home Assistant is first started: the sensor will just display a `-` instead of a minute count.

Expand Down

0 comments on commit cbf5cd7

Please sign in to comment.