I completly confused about mqtt auto-discovery. What does it means an how does it works?
I’ve several shelly switches an sensors in use, all with mqtt, but none of them appear automatic as entity in HA. That’s what I understand under “auto-discovery”
As I read here (MQTT non-autodiscovery lights/switches as devices? - Configuration - Home Assistant Community (home-assistant.io)) other use automations to “auto-discover” the mqtt entities. (what ist auto, when I have to put all information for each single entity in an automation)?
For the moment I’ve set up all my mqtt devices in a normal config.yaml file, and this works without any problem and then and then I see these entities in the entitiy list.
I’m confused…
my config:
configuration.yaml
homeassistant:
packages: !include_dir_named integrations/
sensor: !include_dir_merge_list sensors/
light: !include_dir_list lights/
mqtt-config in directory integrations/
mqtt:
discovery: true
# discovery_prefix: homeassistant
shelly_sensor.yaml in directroy sensors/
# configuration Shelly Sensors
- platform: mqtt
name: "shelly-button-wohnen-batt"
state_topic: shellies/shellybutton1-D8F15B154F21/sensor/battery
unit_of_measurement: "%"
- platform: mqtt
unique_id: shelly_sensor_win_keller1
name: "shelly-window-keller1-status"
state_topic: "shellies/shellydw2-A4CF12F42D61/sensor/state"
icon: "mdi:window-open-variant"
- platform: mqtt
name: "shelly-window-keller1-vibration"
state_topic: "shellies/shellydw2-A4CF12F42D61/sensor/vibration"
icon: "mdi:vibrate"
- platform: mqtt
name: "shelly-window-keller1-lux"
state_topic: "shellies/shellydw2-A4CF12F42D61/sensor/lux"
icon: "mdi:globe-light"
unit_of_measurement: "lux"
- platform: mqtt
name: "shelly-window-keller1-batt"
state_topic: "shellies/shellydw2-A4CF12F42D61/sensor/battery"
unit_of_measurement: "%"
- platform: mqtt
name: "shelly-window-keller1-temp"
state_topic: "shellies/shellydw2-A4CF12F42D61/sensor/temperature"
unit_of_measurement: "°C"
- platform: mqtt
name: "shelly-window-keller1-tilt"
state_topic: "shellies/shellydw2-A4CF12F42D61/sensor/tilt"
icon: "mdi:arrow-top-right"
- platform: mqtt
name: "shelly-window-keller1-illumination"
state_topic: "shellies/shellydw2-A4CF12F42D61/sensor/illumination"
icon: "mdi:brightness-6"
- platform: mqtt
name: "shelly-water-heizung-batt"
state_topic: "shellies/shellyflood-C8A7C2/sensor/battery"
unit_of_measurement: "%"
- platform: mqtt
name: "shelly-water-heizung-temp"
state_topic: "shellies/shellyflood-C8A7C2/sensor/temperature"
unit_of_measurement: "°C"
- platform: mqtt
name: "shelly-water-heizung-status"
state_topic: "shellies/shellyflood-C8A7C2/sensor/flood"
icon: "mdi:water-alert"
- platform: mqtt
name: "shelly-ht-hasenstall-temp"
state_topic: "shellies/shellyht-957402/sensor/temperature"
unit_of_measurement: "°C"
- platform: mqtt
name: "shelly-ht-hasenstall-hum"
state_topic: "shellies/shellyht-957402/sensor/humidity"
icon: "mdi:water-percent"
unit_of_measurement: "%"
- platform: mqtt
name: "shelly-ht-hasenstall-batt"
state_topic: shellies/shellyht-957402/sensor/battery
unit_of_measurement: "%"
- platform: mqtt
name: "shelly-ht-keller-temp"
state_topic: "shellies/shellyht-955504/sensor/temperature"
unit_of_measurement: "°C"
- platform: mqtt
name: "shelly-ht-keller-hum"
state_topic: "shellies/shellyht-955504/sensor/humidity"
icon: "mdi:water-percent"
unit_of_measurement: "%"
- platform: mqtt
name: "shelly-ht-keller-batt"
state_topic: shellies/shellyht-955504/sensor/battery
unit_of_measurement: "%"
- platform: mqtt
name: "shelly-ht-schlafzimmer-temp"
state_topic: "shellies/shellyht-F4466F/sensor/temperature"
unit_of_measurement: "°C"
- platform: mqtt
name: "shelly-ht-schlafzimmer-hum"
state_topic: "shellies/shellyht-F4466F/sensor/humidity"
icon: "mdi:water-percent"
unit_of_measurement: "%"
- platform: mqtt
name: "shelly-ht-schlafzimmer-batt"
state_topic: shellies/shellyht-F4466F/sensor/battery
unit_of_measurement: "%"
2 example files in directory lights/
platform: mqtt
name: "shelly_1pm_buero_mqtt"
state_topic: "shellies/shelly1pm-A4CF12F3FB52/relay/0"
command_topic: "shellies/shelly1pm-A4CF12F3FB52/relay/0/command"
payload_on: "on"
payload_off: "off"
retain: true
platform: mqtt
name: "shelly_1pm_carmen_zimmer_mqtt"
state_topic: "shellies/shelly1pm-A4CF12F3FA2C/relay/0"
command_topic: "shellies/shelly1pm-A4CF12F3FA2C/relay/0/command"
payload_on: "on"
payload_off: "off"
retain: true
and this is in my mqtt-broker: