TCS Pune

Home Assistant MQTT Discovery

IoT & Wireless practical

Home Assistant MQTT Discovery

Create a test sensor/entity through MQTT discovery and verify availability handling.

Topology and objective

Device → MQTT broker → Home Assistant discovery/state/availability topics.

Hardware and tools

  • Supported development board
  • USB data cable
  • Current-limited supply
  • Serial monitor and logic analyser when applicable

Security and RF safety

  • Use broker authentication and topic ACLs.nDo not expose Home Assistant or MQTT directly to the internet.nRemove test entities and retained messages after the lab.

Practical procedure

  1. Use a dedicated test device ID.nPublish retained discovery configuration.nPublish state and online availability.nRestart subscriber and verify retained restoration.nPublish offline and remove test discovery when complete.

Telemetry / payload

{"name":"Lab Temperature","state_topic":"tcs/lab/ha01/state","availability_topic":"tcs/lab/ha01/status","unit_of_measurement":"°C"}

Starter code / config

Discovery topic: homeassistant/sensor/ha01/temperature/config

Expected results

CheckpointExpectedTool
DiscoveryEntity appears onceHome AssistantnAvailability

Troubleshooting

SymptomCheckAction
Entity missingValidate discovery prefix and retained JSONRepublish valid confignStale entity
Local-only sandbox

Commands & telemetry simulator

Device statusOfflineNever seen
Latest value
Messages0this session

Send command

Simulator ready. No network connection is used.
Privacy: Use test credentials and non-sensitive sample data. Never publish Wi-Fi passwords, API tokens, device certificates, SIM credentials or precise personal GPS locations.
Ready when you are

Need help with your laptop or computer?

Send us the model and fault details. Start your repair request online or contact TCS Pune directly.

WA