Device types

Device type represents a single entity in the Home Assistant panel. It can be a sensor, lock, camera or anything that’s listed in the table below.

Your physical device (for example ESP-01 board) can have multiple device types assigned. They will be displayed as child entities in the HA panel.

Limitations

Registering a new device type requires some flash and RAM memory to be utilized. On less powerful units like Arduino Uno, you may quickly hit the limit of resources, so keeping the device simple is recommended. Hitting the resource limit will result in random reboots of the device.

By default, the maximum number of device types is 6. You can increase the limit using the HAMqtt class constructor as follows:

#include <Ethernet.h>
#include <ArduinoHA.h>

byte mac[] = {0x00, 0x10, 0xFA, 0x6E, 0x38, 0x4A};
EthernetClient client;
HADevice device(mac, sizeof(mac));
HAMqtt mqtt(client, device, 12); // <------------ 12 is a new limit of device types

void setup() {
    Ethernet.begin(mac);

    // your setup logic goes here
}

void loop() {
    Ethernet.maintain();
    mqtt.loop();

    // your loop logic goes here
}

Please note that this limit cannot be changed at runtime.

Supported device types

Device type

Supported

Documentation

Binary sensor

HABinarySensor

Button

HAButton

Camera

HACamera

Cover

HACover

Device tracker

HADeviceTracker

Device trigger

HADeviceTrigger

Fan

HAFan

Humidifier

HVAC

HAHVAC

Light

HALight

Lock

HALock

Number

HANumber

Scene

HAScene

Select

HASelect

Sensor (text)

HASensor

Sensor (number)

HASensorNumber

Switch

HASwitch

Tag scanner

HATagScanner

Vacuum