> For the complete documentation index, see [llms.txt](https://api.intecular.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api.intecular.com/invisoutlet-c-pro/device-management/invisoutlet/home-assistant-discovery.md).

# Home Assistant Discovery

\[TCP <--> InvisOutlet]

> Send or clear the InvisOutlet entites in Home Assistant dashboard by the Home Assistant Discovery Payload.

**Request**

* <mark style="color:red;">`packetID`</mark>: Represents the ID of the packet. This can be any six digit number, no leading zeros.
* <mark style="color:red;">`payload`</mark>:&#x20;
  * <mark style="color:red;">`callbackName`</mark>: 27
  * <mark style="color:red;">`callbackArgs`</mark>:&#x20;
    * 0: Specifies which MQTT command to run: 0 - Check MQTT status; 1 - Clear all Home Assistant discovery payloads, including the original outlet/PM entities and the additional accessory-preference entities; 2 - Send the original outlet and attached-PM discovery payloads; 3 - Send the additional accessory-preference discovery payloads and current retained states. \
      *Note: Argument 3 clears stale accessory-preference discovery entries, publishes only settings supported by the attached InvisDeco, and republishes their current retained states. It does not change accessory preferences or resend the original InvisOutlet or InvisDeco discovery entities. After argument 1, send argument 2 followed by argument 3 to restore both entity sets.*

```json
{
  "packetID": 414883,  
  "payload":
  {
    "callbackName": 27,  
    "callbackArgs": [3] 
  }
}
```

**Response**

* <mark style="color:red;">`sn`</mark>: The serial number of the InvisOutlet.
* <mark style="color:red;">`packetID`</mark>: Represents the ID of the packet based on request <mark style="color:red;">`packetID`</mark>.
* <mark style="color:red;">`PUBACK`</mark> : If the request is successfully processed; 1 - The discovery payload is sent, 0 - The discovery payload is not sent or MQTT broker isn't connected.

```json
{
  "sn": "12A3520006E",
  "packetID": 414883,
  "PUBACK": 1
}
```

{% hint style="info" %}
The MQTT configuration is set via [Configure Device Configuration](/invisoutlet-pro/information-and-preferences/configure-device-configuration.md). Make sure [MQTT is connected](/invisoutlet-pro/device-management/invisoutlet/check-mqtt-status.md) to the broker before sending/clearing the Home Assistant Discovery Payload.
{% endhint %}
