diff --git a/source/_docs/mqtt/discovery.markdown b/source/_docs/mqtt/discovery.markdown index 6210a70f7fb..3edba916f14 100644 --- a/source/_docs/mqtt/discovery.markdown +++ b/source/_docs/mqtt/discovery.markdown @@ -164,6 +164,7 @@ Supported abbreviations: 'mode_stat_t': 'mode_state_topic', 'modes': 'modes', 'name': 'name', + 'obj_id': 'object_id', 'off_dly': 'off_delay', 'on_cmd_type': 'on_command_type', 'opt': 'optimistic', @@ -481,3 +482,22 @@ If the device supports gps coordinates then they can be sent to Home Assistant b "gps_accuracy": 1.2 } ``` + +### Use object_id to influence the entity id + + +The entity id is automatically generated from the entity's name. All MQTT entity components optionally support providing an `object_id` which will be used instead if provided. + +- Configuration topic: `homeassistant/sensor/device1/config` +- Example configuration payload: + +```json +{ + "name":"My Super Device", + "object_id":"device1", + "state_topic": "homeassistant/sensor/device1/state", + } +``` + +In the example above, the the entity_id will be `sensor.device1` instead of `sensor.my_super_device`. + diff --git a/source/_integrations/alarm_control_panel.mqtt.markdown b/source/_integrations/alarm_control_panel.mqtt.markdown index 917808420c9..7c5301a367e 100644 --- a/source/_integrations/alarm_control_panel.mqtt.markdown +++ b/source/_integrations/alarm_control_panel.mqtt.markdown @@ -157,6 +157,10 @@ name: required: false type: string default: MQTT Alarm +object_id: + description: Used instead of `name` for automatic generation of `entity_id` + required: false + type: string payload_arm_away: description: The payload to set armed-away mode on your Alarm Panel. required: false diff --git a/source/_integrations/binary_sensor.mqtt.markdown b/source/_integrations/binary_sensor.mqtt.markdown index 5b157f66614..42f6f88cc3a 100644 --- a/source/_integrations/binary_sensor.mqtt.markdown +++ b/source/_integrations/binary_sensor.mqtt.markdown @@ -140,6 +140,10 @@ name: required: false type: string default: MQTT Binary Sensor +object_id: + description: Used instead of `name` for automatic generation of `entity_id` + required: false + type: string off_delay: description: "For sensors that only send `on` state updates (like PIRs), this variable sets a delay in seconds after which the sensor's state will be updated back to `off`." required: false diff --git a/source/_integrations/camera.mqtt.markdown b/source/_integrations/camera.mqtt.markdown index 8a2b2b22474..ff34358a5d9 100644 --- a/source/_integrations/camera.mqtt.markdown +++ b/source/_integrations/camera.mqtt.markdown @@ -119,6 +119,10 @@ name: description: The name of the camera. required: false type: string +object_id: + description: Used instead of `name` for automatic generation of `entity_id` + required: false + type: string topic: description: The MQTT topic to subscribe to. required: true diff --git a/source/_integrations/climate.mqtt.markdown b/source/_integrations/climate.mqtt.markdown index d30809f571c..8770595cded 100644 --- a/source/_integrations/climate.mqtt.markdown +++ b/source/_integrations/climate.mqtt.markdown @@ -234,6 +234,10 @@ name: required: false type: string default: MQTT HVAC +object_id: + description: Used instead of `name` for automatic generation of `entity_id` + required: false + type: string payload_available: description: The payload that represents the available state. required: false diff --git a/source/_integrations/cover.mqtt.markdown b/source/_integrations/cover.mqtt.markdown index c79c1695329..87711d9d187 100644 --- a/source/_integrations/cover.mqtt.markdown +++ b/source/_integrations/cover.mqtt.markdown @@ -141,6 +141,10 @@ name: required: false type: string default: MQTT Cover +object_id: + description: Used instead of `name` for automatic generation of `entity_id` + required: false + type: string optimistic: description: Flag that defines if switch works in optimistic mode. required: false diff --git a/source/_integrations/device_tracker.mqtt.markdown b/source/_integrations/device_tracker.mqtt.markdown index e1611f4d41a..29336ff231f 100644 --- a/source/_integrations/device_tracker.mqtt.markdown +++ b/source/_integrations/device_tracker.mqtt.markdown @@ -165,6 +165,10 @@ name: description: The name of the MQTT device_tracker. required: false type: string +object_id: + description: Used instead of `name` for automatic generation of `entity_id` + required: false + type: string payload_available: description: The payload that represents the available state. required: false diff --git a/source/_integrations/fan.mqtt.markdown b/source/_integrations/fan.mqtt.markdown index c9822ad3875..e499e18b17a 100644 --- a/source/_integrations/fan.mqtt.markdown +++ b/source/_integrations/fan.mqtt.markdown @@ -132,6 +132,10 @@ name: required: false type: string default: MQTT Fan +object_id: + description: Used instead of `name` for automatic generation of `entity_id` + required: false + type: string optimistic: description: Flag that defines if fan works in optimistic mode required: false diff --git a/source/_integrations/humidifier.mqtt.markdown b/source/_integrations/humidifier.mqtt.markdown index 7e7b9155c63..954a518802b 100644 --- a/source/_integrations/humidifier.mqtt.markdown +++ b/source/_integrations/humidifier.mqtt.markdown @@ -148,6 +148,10 @@ name: required: false type: string default: MQTT humidifier +object_id: + description: Used instead of `name` for automatic generation of `entity_id` + required: false + type: string optimistic: description: Flag that defines if humidifier works in optimistic mode required: false diff --git a/source/_integrations/light.mqtt.markdown b/source/_integrations/light.mqtt.markdown index cbe84aa36be..79b0b15a950 100644 --- a/source/_integrations/light.mqtt.markdown +++ b/source/_integrations/light.mqtt.markdown @@ -230,6 +230,10 @@ name: required: false type: string default: MQTT Light +object_id: + description: Used instead of `name` for automatic generation of `entity_id` + required: false + type: string on_command_type: description: "Defines when on the payload_on is sent. Using `last` (the default) will send any style (brightness, color, etc) topics first and then a `payload_on` to the `command_topic`. Using `first` will send the `payload_on` and then any style topics. Using `brightness` will only send brightness commands instead of the `payload_on` to turn the light on." required: false @@ -588,6 +592,10 @@ name: required: false type: string default: MQTT JSON Light +object_id: + description: Used instead of `name` for automatic generation of `entity_id` + required: false + type: string optimistic: description: Flag that defines if the light works in optimistic mode. required: false @@ -928,6 +936,10 @@ name: required: false type: string default: MQTT Template Light +object_id: + description: Used instead of `name` for automatic generation of `entity_id` + required: false + type: string optimistic: description: Flag that defines if the light works in optimistic mode. required: false diff --git a/source/_integrations/lock.mqtt.markdown b/source/_integrations/lock.mqtt.markdown index 6bb982fe96c..3efc9aabc43 100644 --- a/source/_integrations/lock.mqtt.markdown +++ b/source/_integrations/lock.mqtt.markdown @@ -128,6 +128,10 @@ name: required: false type: string default: MQTT Lock +object_id: + description: Used instead of `name` for automatic generation of `entity_id` + required: false + type: string optimistic: description: Flag that defines if lock works in optimistic mode. required: false diff --git a/source/_integrations/number.mqtt.markdown b/source/_integrations/number.mqtt.markdown index 21d655ee2d3..33cd5485399 100644 --- a/source/_integrations/number.mqtt.markdown +++ b/source/_integrations/number.mqtt.markdown @@ -131,6 +131,10 @@ name: description: The name of the Number. required: false type: string +object_id: + description: Used instead of `name` for automatic generation of `entity_id` + required: false + type: string optimistic: description: Flag that defines if number works in optimistic mode. required: false diff --git a/source/_integrations/scene.mqtt.markdown b/source/_integrations/scene.mqtt.markdown index 5adcd8e61ef..5a97a511118 100644 --- a/source/_integrations/scene.mqtt.markdown +++ b/source/_integrations/scene.mqtt.markdown @@ -73,6 +73,10 @@ name: required: false type: string default: MQTT Scene +object_id: + description: Used instead of `name` for automatic generation of `entity_id` + required: false + type: string payload_available: description: The payload that represents the available state. required: false diff --git a/source/_integrations/select.mqtt.markdown b/source/_integrations/select.mqtt.markdown index d9b03afeb33..07cff5d4d8d 100644 --- a/source/_integrations/select.mqtt.markdown +++ b/source/_integrations/select.mqtt.markdown @@ -125,6 +125,10 @@ name: description: The name of the Select. required: false type: string +object_id: + description: Used instead of `name` for automatic generation of `entity_id` + required: false + type: string optimistic: description: Flag that defines if the select works in optimistic mode. required: false diff --git a/source/_integrations/sensor.mqtt.markdown b/source/_integrations/sensor.mqtt.markdown index a1acc6a5f26..5f810e3b941 100644 --- a/source/_integrations/sensor.mqtt.markdown +++ b/source/_integrations/sensor.mqtt.markdown @@ -137,6 +137,10 @@ name: required: false type: string default: MQTT Sensor +object_id: + description: Used instead of `name` for automatic generation of `entity_id` + required: false + type: string payload_available: description: The payload that represents the available state. required: false diff --git a/source/_integrations/switch.mqtt.markdown b/source/_integrations/switch.mqtt.markdown index 296121f9d2c..f538d59429f 100644 --- a/source/_integrations/switch.mqtt.markdown +++ b/source/_integrations/switch.mqtt.markdown @@ -128,6 +128,10 @@ name: required: false type: string default: MQTT Switch +object_id: + description: Used instead of `name` for automatic generation of `entity_id` + required: false + type: string optimistic: description: Flag that defines if switch works in optimistic mode. required: false diff --git a/source/_integrations/vacuum.mqtt.markdown b/source/_integrations/vacuum.mqtt.markdown index 9565d37229e..de2d70e02b9 100644 --- a/source/_integrations/vacuum.mqtt.markdown +++ b/source/_integrations/vacuum.mqtt.markdown @@ -140,6 +140,10 @@ name: required: false type: string default: MQTT Vacuum +object_id: + description: Used instead of `name` for automatic generation of `entity_id` + required: false + type: string payload_available: description: The payload that represents the available state. required: false @@ -395,6 +399,10 @@ name: required: false type: string default: MQTT Vacuum +object_id: + description: Used instead of `name` for automatic generation of `entity_id` + required: false + type: string payload_available: description: The payload that represents the available state. required: false