Class Device
- Namespace
- HaMqttDiscoverable
- Assembly
- HaMqttDiscoverable.dll
Describes the physical device an entity belongs to, as understood by Home Assistant's device registry. Entities that share the same Identifiers are grouped under a single device in Home Assistant.
public sealed class Device
- Inheritance
-
Device
- Inherited Members
Properties
ConfigurationUrl
A URL that shows more info about the device.
[JsonPropertyName("configuration_url")]
public string? ConfigurationUrl { get; set; }
Property Value
Connections
A list of [connection_type, connection_identifier] tuples, e.g. ["mac", "AA:BB:CC:DD:EE:FF"].
[JsonPropertyName("connections")]
public List<List<string>>? Connections { get; set; }
Property Value
HardwareVersion
The hardware version of the device.
[JsonPropertyName("hw_version")]
public string? HardwareVersion { get; set; }
Property Value
Identifiers
One or more unique identifiers for the device (e.g. a serial number). At least one identifier or a Connections entry is required for Home Assistant to be able to link entities to this device.
[JsonPropertyName("identifiers")]
public List<string> Identifiers { get; set; }
Property Value
Manufacturer
The manufacturer of the device.
[JsonPropertyName("manufacturer")]
public string? Manufacturer { get; set; }
Property Value
Model
The model name of the device.
[JsonPropertyName("model")]
public string? Model { get; set; }
Property Value
ModelId
The model identifier/SKU of the device.
[JsonPropertyName("model_id")]
public string? ModelId { get; set; }
Property Value
Name
The name of the device as shown in Home Assistant.
[JsonPropertyName("name")]
public string? Name { get; set; }
Property Value
SoftwareVersion
The firmware/software version running on the device.
[JsonPropertyName("sw_version")]
public string? SoftwareVersion { get; set; }
Property Value
SuggestedArea
Suggests an area in Home Assistant this device should be placed in.
[JsonPropertyName("suggested_area")]
public string? SuggestedArea { get; set; }
Property Value
ViaDevice
The identifier of a device that "routes" messages for this device, e.g. a hub or gateway. Must match the Identifiers of another discovered device.
[JsonPropertyName("via_device")]
public string? ViaDevice { get; set; }
Property Value
Methods
Create(string, string, string?, string?, string?)
Creates a device with a single identifier, which covers the common case.
public static Device Create(string identifier, string name, string? manufacturer = null, string? model = null, string? softwareVersion = null)