Table of Contents

Class BinarySensorConfig

Namespace
HaMqttDiscoverable.Entities
Assembly
HaMqttDiscoverable.dll

Configuration for a read-only BinarySensor entity, reporting one of two states.

public sealed class BinarySensorConfig : EntityConfig
Inheritance
BinarySensorConfig
Inherited Members

Properties

Component

The MQTT component Home Assistant should treat this entity as, e.g. sensor or switch. Used to build the discovery topic; not part of the discovery payload itself.

public override string Component { get; }

Property Value

string

ExpireAfter

If set, the sensor becomes "unknown" when no update is received within this many seconds.

[JsonPropertyName("expire_after")]
public int? ExpireAfter { get; set; }

Property Value

int?

PayloadOff

The payload that means "off"/"clear"/"false". Defaults to "OFF".

[JsonPropertyName("payload_off")]
public string PayloadOff { get; set; }

Property Value

string

PayloadOn

The payload that means "on"/"detected"/"true". Defaults to "ON".

[JsonPropertyName("payload_on")]
public string PayloadOn { get; set; }

Property Value

string