Class Availability
- Namespace
- HaMqttDiscoverable
- Assembly
- HaMqttDiscoverable.dll
Describes an MQTT topic Home Assistant should watch to know whether an entity (or device) is currently online. When omitted, entities default to using the connection's own last-will/birth mechanism managed by HaMqttConnection.
public sealed class Availability
- Inheritance
-
Availability
- Inherited Members
Constructors
Availability()
Creates an empty availability config. Set Topic before use.
public Availability()
Availability(string)
Creates an availability config for the given topic, using Home Assistant's default "online"/"offline" payloads.
public Availability(string topic)
Parameters
topicstring
Properties
PayloadAvailable
The payload that indicates the entity/device is available. Defaults to "online".
[JsonPropertyName("payload_available")]
public string PayloadAvailable { get; set; }
Property Value
PayloadNotAvailable
The payload that indicates the entity/device is unavailable. Defaults to "offline".
[JsonPropertyName("payload_not_available")]
public string PayloadNotAvailable { get; set; }
Property Value
Topic
The MQTT topic Home Assistant subscribes to for availability updates.
[JsonPropertyName("topic")]
public string Topic { get; set; }
Property Value
ValueTemplate
Defines a JSONPath to extract the availability value from a JSON payload.
[JsonPropertyName("value_template")]
public string? ValueTemplate { get; set; }