sethcurry/homeassistant

0.0.1

Latest
uploaded 2 days ago
A component for HomeAssistant autodiscovery via MQTT

readme

# homeassistant

This is a basic component for MQTT-based autodiscovery with HomeAssistant.

It handles generating the config messages HomeAssistant needs to autodiscover your device.

```
#include "homeassistant.h"

void app_main(void)
{
	ha_autodiscovery_config_t ha_temperature_cfg = {
		.name = "office Temperature",
		.unique_id = "office-temperature",
		.stat_topic = "office/climate",
		.value_template = "{{value_json.temperature}}",
		.unit_of_measurement = "C",
		.device_class = "temperature",
		.stat_class = "measurement",
		.device_id = "esp-climate",
	};

	send_ha_config(mqtt_conn, "homeassistant/sensor/office-temperature/config", &ha_temperature_cfg);
}
```

Links

Supports all targets

License: MIT

To add this component to your project, run:

idf.py add-dependency "sethcurry/homeassistant^0.0.1"

download archive

Stats

  • Archive size
    Archive size ~ 3.53 KB
  • Downloaded in total
    Downloaded in total 0 times
  • Downloaded this version
    This version: 0 times

Badge

sethcurry/homeassistant version: 0.0.1
|