|
| 1 | +--- |
| 2 | +title: "MQTT Number" |
| 3 | +description: "Instructions on how to interact with a device exposing a Number through MQQT from within Home Assistant." |
| 4 | +ha_category: |
| 5 | + - Number |
| 6 | +ha_release: 2020.02 |
| 7 | +ha_iot_class: Configurable |
| 8 | +ha_domain: mqtt |
| 9 | +--- |
| 10 | + |
| 11 | +The `mqtt` Number platform allows you to integrate devices that might expose configuration options through MQTT into Home Assistant as a Number. Every time a message under the `topic` in the configuration is received, the number entity will be updated in Home Assisant and vice-versa, keeping the device and Home Assistant in-sync. |
| 12 | + |
| 13 | +## Configuration |
| 14 | + |
| 15 | +To enable MQTT Number in your installation, add the following to your `configuration.yaml` file: |
| 16 | + |
| 17 | +```yaml |
| 18 | +# Example configuration.yaml entry |
| 19 | +Number: |
| 20 | + - platform: mqtt |
| 21 | + topic: my-device/threshold |
| 22 | +``` |
| 23 | +
|
| 24 | +{% configuration %} |
| 25 | +availability: |
| 26 | + description: A list of MQTT topics subscribed to receive availability (online/offline) updates. Must not be used together with `availability_topic`. |
| 27 | + required: false |
| 28 | + type: list |
| 29 | + keys: |
| 30 | + payload_available: |
| 31 | + description: The payload that represents the available state. |
| 32 | + required: false |
| 33 | + type: string |
| 34 | + default: online |
| 35 | + payload_not_available: |
| 36 | + description: The payload that represents the unavailable state. |
| 37 | + required: false |
| 38 | + type: string |
| 39 | + default: offline |
| 40 | + topic: |
| 41 | + description: An MQTT topic subscribed to receive availability (online/offline) updates. |
| 42 | + required: true |
| 43 | + type: string |
| 44 | +availability_topic: |
| 45 | + description: The MQTT topic subscribed to receive availability (online/offline) updates. Must not be used together with `availability`. |
| 46 | + required: false |
| 47 | + type: string |
| 48 | +device: |
| 49 | + description: "Information about the device this Number is a part of to tie it into the [device registry](https://developers.home-assistant.io/docs/en/device_registry_index.html). Only works through [MQTT discovery](/docs/mqtt/discovery/) and when [`unique_id`](#unique_id) is set." |
| 50 | + required: false |
| 51 | + type: map |
| 52 | + keys: |
| 53 | + connections: |
| 54 | + description: 'A list of connections of the device to the outside world as a list of tuples `[connection_type, connection_identifier]`. For example the MAC address of a network interface: `"connections": ["mac", "02:5b:26:a8:dc:12"]`.' |
| 55 | + required: false |
| 56 | + type: list |
| 57 | + identifiers: |
| 58 | + description: 'A list of IDs that uniquely identify the device. For example a serial number.' |
| 59 | + required: false |
| 60 | + type: [list, string] |
| 61 | + manufacturer: |
| 62 | + description: The manufacturer of the device. |
| 63 | + required: false |
| 64 | + type: string |
| 65 | + model: |
| 66 | + description: The model of the device. |
| 67 | + required: false |
| 68 | + type: string |
| 69 | + name: |
| 70 | + description: The name of the device. |
| 71 | + required: false |
| 72 | + type: string |
| 73 | + sw_version: |
| 74 | + description: The firmware version of the device. |
| 75 | + required: false |
| 76 | + type: string |
| 77 | + via_device: |
| 78 | + description: 'Identifier of a device that routes messages between this device and Home Assistant. Examples of such devices are hubs, or parent devices of a sub-device. This is used to show device topology in Home Assistant.' |
| 79 | + required: false |
| 80 | + type: string |
| 81 | +json_attributes_template: |
| 82 | + description: "Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract the JSON dictionary from messages received on the `json_attributes_topic`." |
| 83 | + required: false |
| 84 | + type: template |
| 85 | +json_attributes_topic: |
| 86 | + description: The MQTT topic subscribed to receive a JSON dictionary payload and then set as sensor attributes. Implies `force_update` of the current sensor state when a message is received on this topic. |
| 87 | + required: false |
| 88 | + type: string |
| 89 | +name: |
| 90 | + description: The name of the Number. |
| 91 | + required: false |
| 92 | + type: string |
| 93 | +topic: |
| 94 | + description: The MQTT topic to subscribe to. |
| 95 | + required: true |
| 96 | + type: string |
| 97 | +unique_id: |
| 98 | + description: An ID that uniquely identifies this Number. If two Numbers have the same unique ID Home Assistant will raise an exception. |
| 99 | + required: false |
| 100 | + type: string |
| 101 | +{% endconfiguration %} |
0 commit comments